| 101 | } |
| 102 | |
| 103 | QualType ASTNode::getType(const DynTypedNode &Node) const { |
| 104 | if (const auto *AST = Node.get<VarDecl>()) |
| 105 | return AST->getType(); |
| 106 | |
| 107 | if (const auto *AST = Node.get<CXXCtorInitializer>()) { |
| 108 | auto *FD = AST->getAnyMember(); |
| 109 | if (!FD) |
| 110 | throw std::runtime_error("Unknown nullptr of LLVM instance"); |
| 111 | return FD->getType(); |
| 112 | } |
| 113 | |
| 114 | if (const auto *AST = Node.get<ReturnStmt>()) { |
| 115 | auto *RetValue = AST->getRetValue(); |
| 116 | if (!RetValue) |
| 117 | return QualType(); |
| 118 | return RetValue->getType(); |
| 119 | } |
| 120 | |
| 121 | if (const auto *AST = Node.get<Expr>()) |
| 122 | return AST->getType(); |
| 123 | |
| 124 | assert(false && "Not implemented"); |
| 125 | } |
| 126 | |
| 127 | } // namespace ftg |
no outgoing calls