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

Method getEndLoc

lib/astirmap/ASTNode.cpp:84–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84SourceLocation ASTNode::getEndLoc(const DynTypedNode &Node,
85 const SourceLocation &BeginLoc,
86 const SourceManager &SrcManager) const {
87 auto Range = util::getMacroFunctionExpansionRange(SrcManager, BeginLoc);
88 if (Range.isValid())
89 return Range.getEnd();
90
91 SourceLocation Result;
92 if (const auto *AST = Node.get<Decl>())
93 Result = AST->getEndLoc();
94 else if (const auto *AST = Node.get<CXXCtorInitializer>())
95 Result = AST->getSourceRange().getEnd();
96 else if (const auto *AST = Node.get<Stmt>())
97 Result = AST->getEndLoc();
98 assert(Result.isValid() && "Unimplemented");
99
100 return SrcManager.getTopMacroCallerLoc(Result);
101}
102
103QualType ASTNode::getType(const DynTypedNode &Node) const {
104 if (const auto *AST = Node.get<VarDecl>())

Callers 3

checkMethod · 0.80
getNonGlobalEndOffsetMethod · 0.80

Calls 2

isValidMethod · 0.80

Tested by

no test coverage detected