[llvm-branch-commits] [llvm-branch] r96870 - in /llvm/branches/Apple/Hermes: include/llvm/PassManager.h lib/VMCore/PassManager.cpp

Evan Cheng evan.cheng at apple.com
Mon Feb 22 18:24:13 PST 2010


Author: evancheng
Date: Mon Feb 22 20:24:13 2010
New Revision: 96870

URL: http://llvm.org/viewvc/llvm-project?rev=96870&view=rev
Log:
Add FunctionPassManager(ModuleProvider*) back.

Modified:
    llvm/branches/Apple/Hermes/include/llvm/PassManager.h
    llvm/branches/Apple/Hermes/lib/VMCore/PassManager.cpp

Modified: llvm/branches/Apple/Hermes/include/llvm/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/include/llvm/PassManager.h?rev=96870&r1=96869&r2=96870&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/include/llvm/PassManager.h (original)
+++ llvm/branches/Apple/Hermes/include/llvm/PassManager.h Mon Feb 22 20:24:13 2010
@@ -24,6 +24,7 @@
 class Pass;
 class ModulePass;
 class Module;
+class ModuleProvider;
 
 class PassManagerImpl;
 class FunctionPassManagerImpl;
@@ -72,6 +73,7 @@
   /// FunctionPassManager ctor - This initializes the pass manager.  It needs,
   /// but does not take ownership of, the specified Module.
   explicit FunctionPassManager(Module *M);
+  explicit FunctionPassManager(ModuleProvider *P);
   ~FunctionPassManager();
  
   /// add - Add a pass to the queue of passes to run.  This passes

Modified: llvm/branches/Apple/Hermes/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/VMCore/PassManager.cpp?rev=96870&r1=96869&r2=96870&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/VMCore/PassManager.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/VMCore/PassManager.cpp Mon Feb 22 20:24:13 2010
@@ -18,6 +18,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/Module.h"
+#include "llvm/ModuleProvider.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/raw_ostream.h"
@@ -1202,6 +1203,15 @@
   FPM->setResolver(AR);
 }
 
+FunctionPassManager::FunctionPassManager(ModuleProvider *P) : M(P->getModule()){
+  FPM = new FunctionPassManagerImpl(0);
+  // FPM is the top level manager.
+  FPM->setTopLevelManager(FPM);
+
+  AnalysisResolver *AR = new AnalysisResolver(*FPM);
+  FPM->setResolver(AR);
+}
+
 FunctionPassManager::~FunctionPassManager() {
   delete FPM;
 }





More information about the llvm-branch-commits mailing list