diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index c3eb27b946287..f1e595cde54e3 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -918,6 +918,13 @@ class LLVM_ABI MachineFunction { bool verify(Pass *p = nullptr, const char *Banner = nullptr, raw_ostream *OS = nullptr, bool AbortOnError = true) const; + /// For New Pass Manager: Run the current MachineFunction through the machine + /// code verifier, useful for debugger use. + /// \returns true if no problems were found. + bool verify(MachineFunctionAnalysisManager &MFAM, + const char *Banner = nullptr, raw_ostream *OS = nullptr, + bool AbortOnError = true) const; + /// Run the current MachineFunction through the machine code verifier, useful /// for debugger use. /// \returns true if no problems were found. diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 8509369fe09c8..05afcbee701a8 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -431,6 +431,12 @@ bool MachineFunction::verify(Pass *p, const char *Banner, raw_ostream *OS, return MachineVerifier(p, Banner, OS, AbortOnError).verify(*this); } +bool MachineFunction::verify(MachineFunctionAnalysisManager &MFAM, + const char *Banner, raw_ostream *OS, + bool AbortOnError) const { + return MachineVerifier(MFAM, Banner, OS, AbortOnError).verify(*this); +} + bool MachineFunction::verify(LiveIntervals *LiveInts, SlotIndexes *Indexes, const char *Banner, raw_ostream *OS, bool AbortOnError) const {