[cfe-commits] r58831 - /cfe/trunk/Driver/AnalysisConsumer.cpp
Ted Kremenek
kremenek at apple.com
Thu Nov 6 18:09:25 PST 2008
Author: kremenek
Date: Thu Nov 6 20:09:25 2008
New Revision: 58831
URL: http://llvm.org/viewvc/llvm-project?rev=58831&view=rev
Log:
Patch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer.
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=58831&r1=58830&r2=58831&view=diff
==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.cpp (original)
+++ cfe/trunk/Driver/AnalysisConsumer.cpp Thu Nov 6 20:09:25 2008
@@ -60,6 +60,7 @@
Actions FunctionActions;
Actions ObjCMethodActions;
Actions ObjCImplementationActions;
+ Actions TranslationUnitActions;
public:
const bool VisGraphviz;
@@ -100,6 +101,10 @@
ObjCImplementationActions.push_back(action);
}
+ void addTranslationUnitAction(CodeAction action) {
+ TranslationUnitActions.push_back(action);
+ }
+
virtual void Initialize(ASTContext &Context) {
Ctx = &Context;
}
@@ -291,6 +296,13 @@
void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) {
+ if(!TranslationUnitActions.empty()) {
+ AnalysisManager mgr(*this, &TU);
+ for (Actions::iterator I = TranslationUnitActions.begin(),
+ E = TranslationUnitActions.end(); I != E; ++I)
+ (*I)(mgr);
+ }
+
if (ObjCImplementationActions.empty())
return;
More information about the cfe-commits
mailing list