llvm.org GIT mirror llvm / 5ab6b15
Replace a few virtual with override. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217513 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 21 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
5353 static char run;
5454 static char ID;
5555 ModuleNDNM() : ModulePass(ID) { }
56 virtual bool runOnModule(Module &M) {
56 bool runOnModule(Module &M) override {
5757 run++;
5858 return false;
5959 }
60 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
60 void getAnalysisUsage(AnalysisUsage &AU) const override {
6161 AU.setPreservesAll();
6262 }
6363 };
6969 static char run;
7070 static char ID;
7171 ModuleNDM() : ModulePass(ID) {}
72 virtual bool runOnModule(Module &M) {
72 bool runOnModule(Module &M) override {
7373 run++;
7474 return true;
7575 }
8282 static char run;
8383 static char ID;
8484 ModuleNDM2() : ModulePass(ID) {}
85 virtual bool runOnModule(Module &M) {
85 bool runOnModule(Module &M) override {
8686 run++;
8787 return true;
8888 }
9797 ModuleDNM() : ModulePass(ID) {
9898 initializeModuleNDMPass(*PassRegistry::getPassRegistry());
9999 }
100 virtual bool runOnModule(Module &M) {
100 bool runOnModule(Module &M) override {
101101 EXPECT_TRUE(getAnalysisIfAvailable());
102102 run++;
103103 return false;
104104 }
105 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
105 void getAnalysisUsage(AnalysisUsage &AU) const override {
106106 AU.addRequired();
107107 AU.setPreservesAll();
108108 }
138138 runc = 0;
139139 }
140140
141 virtual void releaseMemory() {
141 void releaseMemory() override {
142142 EXPECT_GT(runc, 0);
143143 EXPECT_GT(allocated, 0);
144144 allocated--;
156156 using llvm::Pass::doInitialization;
157157 using llvm::Pass::doFinalization;
158158 #endif
159 virtual bool doInitialization(T &t) {
159 bool doInitialization(T &t) override {
160160 EXPECT_FALSE(PassTestBase

::initialized);

161161 PassTestBase

::initialized = true;

162162 return false;
163163 }
164 virtual bool doFinalization(T &t) {
164 bool doFinalization(T &t) override {
165165 EXPECT_FALSE(PassTestBase

::finalized);

166166 PassTestBase

::finalized = true;

167167 EXPECT_EQ(0, PassTestBase

::allocated);

174174 CGPass() {
175175 initializeCGPassPass(*PassRegistry::getPassRegistry());
176176 }
177 virtual bool runOnSCC(CallGraphSCC &SCMM) {
177 bool runOnSCC(CallGraphSCC &SCMM) override {
178178 EXPECT_TRUE(getAnalysisIfAvailable());
179179 run();
180180 return false;
183183
184184 struct FPass : public PassTest {
185185 public:
186 virtual bool runOnFunction(Function &F) {
186 bool runOnFunction(Function &F) override {
187187 // FIXME: PR4112
188188 // EXPECT_TRUE(getAnalysisIfAvailable());
189189 run();
208208 }
209209 using llvm::Pass::doInitialization;
210210 using llvm::Pass::doFinalization;
211 virtual bool doInitialization(Loop* L, LPPassManager &LPM) {
211 bool doInitialization(Loop* L, LPPassManager &LPM) override {
212212 initialized = true;
213213 initcount++;
214214 return false;
215215 }
216 virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
216 bool runOnLoop(Loop *L, LPPassManager &LPM) override {
217217 EXPECT_TRUE(getAnalysisIfAvailable());
218218 run();
219219 return false;
220220 }
221 virtual bool doFinalization() {
221 bool doFinalization() override {
222222 fincount++;
223223 finalized = true;
224224 return false;
241241 inited = 0;
242242 fin = 0;
243243 }
244 virtual bool doInitialization(Module &M) {
244 bool doInitialization(Module &M) override {
245245 EXPECT_FALSE(initialized);
246246 initialized = true;
247247 return false;
248248 }
249 virtual bool doInitialization(Function &F) {
249 bool doInitialization(Function &F) override {
250250 inited++;
251251 return false;
252252 }
253 virtual bool runOnBasicBlock(BasicBlock &BB) {
253 bool runOnBasicBlock(BasicBlock &BB) override {
254254 EXPECT_TRUE(getAnalysisIfAvailable());
255255 run();
256256 return false;
257257 }
258 virtual bool doFinalization(Function &F) {
258 bool doFinalization(Function &F) override {
259259 fin++;
260260 return false;
261261 }
262 virtual bool doFinalization(Module &M) {
262 bool doFinalization(Module &M) override {
263263 EXPECT_FALSE(finalized);
264264 finalized = true;
265265 EXPECT_EQ(0, allocated);
275275 OnTheFlyTest() : ModulePass(ID) {
276276 initializeFPassPass(*PassRegistry::getPassRegistry());
277277 }
278 virtual bool runOnModule(Module &M) {
278 bool runOnModule(Module &M) override {
279279 EXPECT_TRUE(getAnalysisIfAvailable());
280280 for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) {
281281 Function &F = *I;
286286 }
287287 return false;
288288 }
289 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
289 void getAnalysisUsage(AnalysisUsage &AU) const override {
290290 AU.addRequired();
291291 }
292292 };