[cfe-commits] r63546 - /cfe/trunk/Driver/AnalysisConsumer.cpp

Ted Kremenek kremenek at apple.com
Mon Feb 2 12:52:40 PST 2009


Author: kremenek
Date: Mon Feb  2 14:52:40 2009
New Revision: 63546

URL: http://llvm.org/viewvc/llvm-project?rev=63546&view=rev
Log:
AnalysisConsumer:
- Pass "Actions" vector by reference.
- Remove guard against checking macro-generated code.

Modified:
    cfe/trunk/Driver/AnalysisConsumer.cpp

Modified: cfe/trunk/Driver/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.cpp?rev=63546&r1=63545&r2=63546&view=diff

==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.cpp (original)
+++ cfe/trunk/Driver/AnalysisConsumer.cpp Mon Feb  2 14:52:40 2009
@@ -124,7 +124,7 @@
     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::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





More information about the cfe-commits mailing list