aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-01-22 00:17:48 +0000
committerChris Lattner <sabre@nondot.org>2002-01-22 00:17:48 +0000
commit35f07eb2ebf7d3a9e1a95470770b29e1b45b2cb1 (patch)
tree1da7593fd5c328177c16fad5d20bc3f2a31faf99 /lib/VMCore
parent5048c3b853b8be541479e300705a88375569c8b1 (diff)
downloadexternal_llvm-35f07eb2ebf7d3a9e1a95470770b29e1b45b2cb1.zip
external_llvm-35f07eb2ebf7d3a9e1a95470770b29e1b45b2cb1.tar.gz
external_llvm-35f07eb2ebf7d3a9e1a95470770b29e1b45b2cb1.tar.bz2
Ooops, forgot to implement void PassManager::add(BasicBlockPass *BBP)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Pass.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index 2f2fd0e..a3d03f1 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -60,13 +60,17 @@ public:
for_each(SubPasses.begin(), SubPasses.end(), deleter<MethodPass>);
}
+ void add(BasicBlockPass *BBP) {
+ if (BBPBatcher == 0) {
+ BBPBatcher = new BasicBlockPassBatcher();
+ SubPasses.push_back(BBPBatcher);
+ }
+ BBPBatcher->add(BBP);
+ }
+
void add(MethodPass *P) {
if (BasicBlockPass *BBP = dynamic_cast<BasicBlockPass*>(P)) {
- if (BBPBatcher == 0) {
- BBPBatcher = new BasicBlockPassBatcher();
- SubPasses.push_back(BBPBatcher);
- }
- BBPBatcher->add(BBP);
+ add(BBP);
} else {
BBPBatcher = 0; // Ensure that passes don't get accidentally reordered
SubPasses.push_back(P);
@@ -92,7 +96,15 @@ public:
}
};
-
+// add(BasicBlockPass*) - If we know it's a BasicBlockPass, we don't have to do
+// any checking...
+//
+void PassManager::add(BasicBlockPass *BBP) {
+ if (Batcher == 0) // If we don't have a batcher yet, make one now.
+ add((MethodPass*)BBP);
+ else
+ Batcher->add(BBP);
+}
// add(MethodPass*) - MethodPass's must be batched together... make sure this