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

Method getNodeForType

lib/astirmap/ASTDefNode.cpp:125–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123const ASTNode *ASTDefNode::getAssigned() const { return Assigned.get(); }
124
125const ASTNode *ASTDefNode::getNodeForType() const {
126 if (!Assigned)
127 return Assignee.get();
128
129 assert(Assignee && "Unexpected Program State");
130 if ((Assignee->getNodeType() == ASTNode::CALL) &&
131 (Assigned->getNodeType() != ASTNode::CALL))
132 return Assigned.get();
133
134 if (const auto *E = Assigned->getNode().get<Expr>()) {
135 if (E->isNullPointerConstant(Assigned->getASTUnit().getASTContext(),
136 Expr::NPC_NeverValueDependent)) {
137 return Assignee.get();
138 }
139 }
140 return Assigned.get();
141}
142
143llvm::raw_ostream &operator<<(llvm::raw_ostream &O, const ASTDefNode &Src) {
144 O << "Index: " << Src.getLocIndex().getIDAsString() << "\n"

Callers 4

checkMethod · 0.80
isBufferAllocSizeMethod · 0.80
generateTypeMethod · 0.80

Calls 2

getNodeTypeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected