| 274 | } |
| 275 | |
| 276 | bool DefAnalyzer::isInvalidRDNode(ASTIRMap &Map, const RDNode &Node) const { |
| 277 | auto D = Node.getDefinition(); |
| 278 | if (!D.first) |
| 279 | return false; |
| 280 | |
| 281 | auto *ADN = Map.getASTDefNode(*D.first, D.second); |
| 282 | // At this point, local variable should not be delcared |
| 283 | // with an initializer. |
| 284 | if (!ADN || (!Node.isRootDefinition() && isInitializedLocalVariable(Node))) |
| 285 | return true; |
| 286 | |
| 287 | auto *Assigned = ADN->getAssigned(); |
| 288 | if (!Assigned) |
| 289 | return false; |
| 290 | |
| 291 | const auto *E = Assigned->getNode().get<clang::Expr>(); |
| 292 | if (!E) |
| 293 | return false; |
| 294 | |
| 295 | if (util::isMacroArgUsedHashHashExpansion(*E, Assigned->getASTUnit())) |
| 296 | return true; |
| 297 | |
| 298 | return false; |
| 299 | } |
| 300 | |
| 301 | } // namespace ftg |
no test coverage detected