| 13 | using namespace ftg; |
| 14 | |
| 15 | std::unique_ptr<AnalyzerReport> ConstAnalyzer::getReport() { |
| 16 | auto Result = std::make_unique<ConstAnalyzerReport>(); |
| 17 | for (auto *ASTUnit : ASTUnits) { |
| 18 | auto Constants = extractConst(*ASTUnit); |
| 19 | for (auto ConstPair : Constants) { |
| 20 | if (Result->addConst(ConstPair.first, ConstPair.second)) |
| 21 | llvm::outs() << "[D] Updated Value: " << ConstPair.first << "\n"; |
| 22 | } |
| 23 | } |
| 24 | return std::move(Result); |
| 25 | } |
| 26 | |
| 27 | std::vector<std::pair<std::string, ASTValue>> |
| 28 | ConstAnalyzer::extractConst(clang::ASTUnit &AST) { |