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

Method ASTNode

lib/astirmap/ASTNode.cpp:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace ftg {
12
13ASTNode::ASTNode(nodeType Type, const DynTypedNode Node, ASTUnit &Unit)
14 : Node(Node), NodeType(Type), Unit(Unit) {
15 Ty = getType(Node);
16 const auto &SrcManager = Unit.getSourceManager();
17 auto BeginLoc = getBeginLoc(Node, SrcManager);
18 assert(BeginLoc.isValid() && "Unexpected Program State");
19 Offset = SrcManager.getDecomposedExpansionLoc(BeginLoc).second;
20 std::tie(Length, Offset) = getLengthAndOffset(Node, BeginLoc, SrcManager);
21
22 auto ExpandedBeginLoc = SrcManager.getExpansionLoc(BeginLoc);
23 Index = LocIndex(
24 util::getNormalizedPath(SrcManager.getFilename(ExpandedBeginLoc).str()),
25 SrcManager.getExpansionLineNumber(ExpandedBeginLoc),
26 SrcManager.getExpansionColumnNumber(ExpandedBeginLoc));
27}
28
29const LocIndex &ASTNode::getIndex() const { return Index; }
30

Callers

nothing calls this directly

Calls 3

LocIndexClass · 0.85
getNormalizedPathFunction · 0.85
isValidMethod · 0.80

Tested by

no test coverage detected