[CodeGen] Let MachineVerifierPass own its banner string

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224041 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun 2014-12-11 19:41:51 +00:00
parent 01bc84d1fd
commit 9173c775e3
2 changed files with 6 additions and 6 deletions

View File

@ -560,7 +560,7 @@ namespace llvm {
/// createMachineVerifierPass - This pass verifies cenerated machine code
/// instructions for correctness.
///
FunctionPass *createMachineVerifierPass(const char *Banner = nullptr);
FunctionPass *createMachineVerifierPass(const std::string& Banner);
/// createDwarfEHPass - This pass mulches exception handling code into a form
/// adapted to code generation. Required if using dwarf exception handling.

View File

@ -243,10 +243,10 @@ namespace {
struct MachineVerifierPass : public MachineFunctionPass {
static char ID; // Pass ID, replacement for typeid
const char *const Banner;
const std::string Banner;
MachineVerifierPass(const char *b = nullptr)
: MachineFunctionPass(ID), Banner(b) {
MachineVerifierPass(const std::string &banner = nullptr)
: MachineFunctionPass(ID), Banner(banner) {
initializeMachineVerifierPassPass(*PassRegistry::getPassRegistry());
}
@ -256,7 +256,7 @@ namespace {
}
bool runOnMachineFunction(MachineFunction &MF) override {
MF.verify(this, Banner);
MF.verify(this, Banner.c_str());
return false;
}
};
@ -267,7 +267,7 @@ char MachineVerifierPass::ID = 0;
INITIALIZE_PASS(MachineVerifierPass, "machineverifier",
"Verify generated machine code", false, false)
FunctionPass *llvm::createMachineVerifierPass(const char *Banner) {
FunctionPass *llvm::createMachineVerifierPass(const std::string &Banner) {
return new MachineVerifierPass(Banner);
}