Index: lib/CodeGen/CFIInstrInserter.cpp =================================================================== --- lib/CodeGen/CFIInstrInserter.cpp +++ lib/CodeGen/CFIInstrInserter.cpp @@ -28,6 +28,11 @@ #include "llvm/Target/TargetMachine.h" using namespace llvm; +static cl::opt VerifyCFI("verify-cfiinstrs", + cl::desc("Verify Call Frame Information instructions"), + cl::init(false), + cl::Hidden); + namespace { class CFIInstrInserter : public MachineFunctionPass { public: @@ -49,11 +54,12 @@ MBBVector.resize(MF.getNumBlockIDs()); calculateCFAInfo(MF); -#ifndef NDEBUG - if (unsigned ErrorNum = verify(MF)) - report_fatal_error("Found " + Twine(ErrorNum) + - " in/out CFI information errors."); -#endif + + if (VerifyCFI) { + if (unsigned ErrorNum = verify(MF)) + report_fatal_error("Found " + Twine(ErrorNum) + + " in/out CFI information errors."); + } bool insertedCFI = insertCFIInstrs(MF); MBBVector.clear(); return insertedCFI;