mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user