| 11 | namespace ftg { |
| 12 | |
| 13 | ASTNode::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 | |
| 29 | const LocIndex &ASTNode::getIndex() const { return Index; } |
| 30 |
nothing calls this directly
no test coverage detected