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

Method ASTDefNode

lib/astirmap/ASTDefNode.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace ftg {
9
10ASTDefNode::ASTDefNode(VarDecl &D, ASTUnit &Unit) {
11 Assignee =
12 std::make_unique<ASTNode>(ASTNode::DECL, DynTypedNode::create(D), Unit);
13 if (!Assignee)
14 throw std::runtime_error("Failed to create ASTDeclNode");
15
16 if (auto *E = D.getInit()) {
17 Assigned = std::make_unique<ASTNode>(ASTNode::STMT,
18 DynTypedNode::create(*E), Unit);
19 assert(Assigned && "Unexpected Program State");
20
21 // NOTE: If initializer of declaration has same location as declaration,
22 // it should be considered as implicitly generated initializer.
23 // Thus, it should be considered that it has no intiizlier.
24 if (Assignee->getIndex() == Assigned->getIndex())
25 Assigned.reset();
26 }
27 SourceLoc = LocIndex(Unit.getSourceManager(), D.getLocation());
28}
29
30ASTDefNode::ASTDefNode(BinaryOperator &B, ASTUnit &Unit) {
31 if (!B.isAssignmentOp())

Callers

nothing calls this directly

Calls 7

LocIndexClass · 0.85
getDebugLocFunction · 0.85
isImplicitArgumentFunction · 0.85
isDefaultArgumentFunction · 0.85
getArgExprsFunction · 0.85
sizeMethod · 0.80
getBeginLocMethod · 0.80

Tested by

no test coverage detected