From 2df47d4bc59eac2514c62d93e07961b469c19c6a Mon Sep 17 00:00:00 2001 From: Erki Date: Wed, 24 Feb 2021 21:49:50 +0200 Subject: [PATCH] Fixes the compiler not acknowledging preprocessor and include statements. --- op-finder/OperationFinder.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/op-finder/OperationFinder.cpp b/op-finder/OperationFinder.cpp index 1c04481..128d4ea 100644 --- a/op-finder/OperationFinder.cpp +++ b/op-finder/OperationFinder.cpp @@ -31,11 +31,6 @@ StatementMatcher UnaryArithmeticMatcher = StatementMatcher CompoundMatcher = compoundStmt().bind("compound_stmt"); -bool isInMainFile(const MatchFinder::MatchResult &result, const SourceLocation &loc) -{ - return result.Context->getSourceManager().isWrittenInMainFile(loc); -} - template StringRef getOpcode(const TOp *op) { @@ -78,9 +73,6 @@ void OperationFinder::_processAssignment(const clang::ast_matchers::MatchFinder: assert(op); - if (!isInMainFile(result, op->getBeginLoc())) - return; - const auto& loc = op->getBeginLoc(); const auto& source_manager = *result.SourceManager; @@ -101,9 +93,6 @@ void OperationFinder::_processArithmetic(const MatchFinder::MatchResult& result) assert(op); - if (!isInMainFile(result, op->getBeginLoc())) - return; - const auto& loc = op->getBeginLoc(); const auto& source_manager = *result.SourceManager; @@ -128,9 +117,6 @@ void OperationFinder::_processCompoundStmt(const clang::ast_matchers::MatchFinde if (!op || !op->isCompoundAssignmentOp()) return; - if (!isInMainFile(result, op->getBeginLoc())) - return; - const auto& loc = op->getBeginLoc(); const auto& source_manager = *result.SourceManager; @@ -152,9 +138,6 @@ void OperationFinder::_processUnaryArithmetic(const MatchFinder::MatchResult &re assert(op); assert(lhs); - if (!isInMainFile(result, lhs->getBeginLoc())) - return; - const auto& loc = lhs->getBeginLoc(); const auto& source_manager = *result.SourceManager;