diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-02 20:52:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-02 20:52:40 +0000 |
commit | 81922f01352aceeb923c0c3cc8c96b6527322384 (patch) | |
tree | 4c685a57a81ffe2e30749b440b3552340f7a80e4 /Driver/AnalysisConsumer.cpp | |
parent | 0bb20361a321593887f067515dd04cf109f4c74a (diff) |
AnalysisConsumer:
- Pass "Actions" vector by reference.
- Remove guard against checking macro-generated code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/AnalysisConsumer.cpp')
-rw-r--r-- | Driver/AnalysisConsumer.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp index 171ffbf2df..49ebde71c8 100644 --- a/Driver/AnalysisConsumer.cpp +++ b/Driver/AnalysisConsumer.cpp @@ -124,7 +124,7 @@ namespace { virtual void HandleTopLevelDecl(Decl *D); virtual void HandleTranslationUnit(TranslationUnit &TU); - void HandleCode(Decl* D, Stmt* Body, Actions actions); + void HandleCode(Decl* D, Stmt* Body, Actions& actions); }; @@ -365,21 +365,15 @@ void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) { } } -void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions actions) { +void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions& actions) { // Don't run the actions if an error has occured with parsing the file. if (Diags.hasErrorOccurred()) return; - - SourceLocation Loc = D->getLocation(); - - // Only run actions on declarations defined in actual source. - if (!Loc.isFileID()) - return; - + // Don't run the actions on declarations in header files unless // otherwise specified. - if (!AnalyzeAll && !Ctx->getSourceManager().isFromMainFile(Loc)) + if (!AnalyzeAll && !Ctx->getSourceManager().isFromMainFile(D->getLocation())) return; // Create an AnalysisManager that will manage the state for analyzing |