File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,19 @@ class FunctionPassManager {
70
70
// /
71
71
void add (ImmutablePass *IP);
72
72
73
+ // / doInitialization - Run all of the initializers for the function passes.
74
+ // /
75
+ bool doInitialization ();
76
+
73
77
// / run - Execute all of the passes scheduled for execution. Keep
74
78
// / track of whether any of the passes modifies the function, and if
75
79
// / so, return true.
76
80
// /
77
81
bool run (Function &F);
82
+
83
+ // / doFinalization - Run all of the initializers for the function passes.
84
+ // /
85
+ bool doFinalization ();
78
86
};
79
87
80
88
} // End llvm namespace
Original file line number Diff line number Diff line change @@ -94,13 +94,26 @@ FunctionPassManager::FunctionPassManager(ModuleProvider *P) :
94
94
FunctionPassManager::~FunctionPassManager () { delete PM; }
95
95
void FunctionPassManager::add (FunctionPass *P) { PM->add (P); }
96
96
void FunctionPassManager::add (ImmutablePass *IP) { PM->add (IP); }
97
+
98
+ // / doInitialization - Run all of the initializers for the function passes.
99
+ // /
100
+ bool FunctionPassManager::doInitialization () {
101
+ return PM->doInitialization (*MP->getModule ());
102
+ }
103
+
97
104
bool FunctionPassManager::run (Function &F) {
98
105
std::string errstr;
99
106
if (MP->materializeFunction (&F, &errstr)) {
100
107
std::cerr << " Error reading bytecode file: " << errstr << " \n " ;
101
108
abort ();
102
109
}
103
- return PM->run (F);
110
+ return PM->runOnFunction (F);
111
+ }
112
+
113
+ // / doFinalization - Run all of the initializers for the function passes.
114
+ // /
115
+ bool FunctionPassManager::doFinalization () {
116
+ return PM->doFinalization (*MP->getModule ());
104
117
}
105
118
106
119
You can’t perform that action at this time.
0 commit comments