summaryrefslogtreecommitdiff
path: root/include/llvm/PassManager.h
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2010-05-10 20:24:27 +0000
committerDavid Greene <greened@obbligato.org>2010-05-10 20:24:27 +0000
commite89f1c4ee74349fbe08a2c1f8060a7d3b049b5ab (patch)
treef280d0fbcd41baa6f6305a7d87ed511593118378 /include/llvm/PassManager.h
parentda24b34c9ac5ad4cfaea6bbb409bd589c912551a (diff)
Fix PR6875:
This includes a patch by Roman Divacky to fix the initial crash. Move the actual addition of passes from *PassManager::add to *PassManager::addImpl. That way, when adding printer passes we won't recurse infinitely. Finally, check to make sure that we are actually adding a FunctionPass to a FunctionPassManager before doing a print before or after it. Immutable passes are strange in this way because they aren't FunctionPasses yet they can be and are added to the FunctionPassManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassManager.h')
-rw-r--r--include/llvm/PassManager.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/PassManager.h b/include/llvm/PassManager.h
index 4d9116311a0..8de0f8342d7 100644
--- a/include/llvm/PassManager.h
+++ b/include/llvm/PassManager.h
@@ -60,6 +60,9 @@ public:
bool run(Module &M);
private:
+ /// addImpl - Add a pass to the queue of passes to run, without
+ /// checking whether to add a printer pass.
+ void addImpl(Pass *P);
/// PassManagerImpl_New is the actual class. PassManager is just the
/// wraper to publish simple pass manager interface
@@ -96,6 +99,10 @@ public:
bool doFinalization();
private:
+ /// addImpl - Add a pass to the queue of passes to run, without
+ /// checking whether to add a printer pass.
+ void addImpl(Pass *P);
+
FunctionPassManagerImpl *FPM;
Module *M;
};