diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-11-20 04:39:16 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-11-20 04:39:16 +0000 |
commit | d895e29e88387d97dad1ef2d26184145e4029c56 (patch) | |
tree | 4786990b9fbdfe0f1bfb2d628515451f9b4b03be /llvm/unittests/IR/PassManagerTest.cpp | |
parent | babe7491255b8b4af57805c92237977f5d466288 (diff) | |
download | bcm5719-llvm-d895e29e88387d97dad1ef2d26184145e4029c56.tar.gz bcm5719-llvm-d895e29e88387d97dad1ef2d26184145e4029c56.zip |
[PM] Make the function pass manager more regular.
The FunctionPassManager is now itself a function pass. When run over
a function, it runs all N of its passes over that function. This is the
1:N mapping in the pass dimension only. This allows it to be used in
either a ModulePassManager or potentially some other manager that
works on IR units which are supersets of Functions.
This commit also adds the obvious adaptor to map from a module pass to
a function pass, running the function pass across every function in the
module.
The test has been updated to use this new pattern.
llvm-svn: 195192
Diffstat (limited to 'llvm/unittests/IR/PassManagerTest.cpp')
-rw-r--r-- | llvm/unittests/IR/PassManagerTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/IR/PassManagerTest.cpp b/llvm/unittests/IR/PassManagerTest.cpp index cf7b6e47488..1e02d6ba02b 100644 --- a/llvm/unittests/IR/PassManagerTest.cpp +++ b/llvm/unittests/IR/PassManagerTest.cpp @@ -120,7 +120,7 @@ TEST_F(PassManagerTest, Basic) { int FunctionPassRunCount = 0; int AnalyzedInstrCount = 0; FPM.addPass(TestFunctionPass(AM, FunctionPassRunCount, AnalyzedInstrCount)); - MPM.addPass(FPM); + MPM.addPass(createModuleToFunctionPassAdaptor(FPM)); MPM.run(M.get()); EXPECT_EQ(1, ModulePassRunCount); |