MCPcopy Create free account
hub / github.com/Samsung/UTopia / isInvalidRDNode

Method isInvalidRDNode

lib/inputanalysis/DefAnalyzer.cpp:276–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276bool 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

Callers 1

analyzeTargetCallArgMethod · 0.95

Calls 5

getDefinitionMethod · 0.80
isRootDefinitionMethod · 0.80
getAssignedMethod · 0.80
getASTDefNodeMethod · 0.45

Tested by

no test coverage detected