llvm.org GIT mirror llvm / 9173c77
[CodeGen] Let MachineVerifierPass own its banner string git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224041 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 5 years ago
2 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
559559 /// createMachineVerifierPass - This pass verifies cenerated machine code
560560 /// instructions for correctness.
561561 ///
562 FunctionPass *createMachineVerifierPass(const char *Banner = nullptr);
562 FunctionPass *createMachineVerifierPass(const std::string& Banner);
563563
564564 /// createDwarfEHPass - This pass mulches exception handling code into a form
565565 /// adapted to code generation. Required if using dwarf exception handling.
242242
243243 struct MachineVerifierPass : public MachineFunctionPass {
244244 static char ID; // Pass ID, replacement for typeid
245 const char *const Banner;
246
247 MachineVerifierPass(const char *b = nullptr)
248 : MachineFunctionPass(ID), Banner(b) {
245 const std::string Banner;
246
247 MachineVerifierPass(const std::string &banner = nullptr)
248 : MachineFunctionPass(ID), Banner(banner) {
249249 initializeMachineVerifierPassPass(*PassRegistry::getPassRegistry());
250250 }
251251
255255 }
256256
257257 bool runOnMachineFunction(MachineFunction &MF) override {
258 MF.verify(this, Banner);
258 MF.verify(this, Banner.c_str());
259259 return false;
260260 }
261261 };
266266 INITIALIZE_PASS(MachineVerifierPass, "machineverifier",
267267 "Verify generated machine code", false, false)
268268
269 FunctionPass *llvm::createMachineVerifierPass(const char *Banner) {
269 FunctionPass *llvm::createMachineVerifierPass(const std::string &Banner) {
270270 return new MachineVerifierPass(Banner);
271271 }
272272