diff options
author | Petar Jovanovic <petar.jovanovic@mips.com> | 2018-05-07 14:09:33 +0000 |
---|---|---|
committer | Petar Jovanovic <petar.jovanovic@mips.com> | 2018-05-07 14:09:33 +0000 |
commit | cc4915701cbac39f8ae507d41857242a449dc842 (patch) | |
tree | 5fa2ef170203bce64688437fee5a80a467f68931 /llvm/lib | |
parent | 1c451dbef8a25432d0d9ab9b6c6b181edb700948 (diff) | |
download | bcm5719-llvm-cc4915701cbac39f8ae507d41857242a449dc842.tar.gz bcm5719-llvm-cc4915701cbac39f8ae507d41857242a449dc842.zip |
Add option -verify-cfiinstrs to run verifier in CFIInstrInserter
Instead of enabling it for non NDEBUG builds, use -verify-cfiinstrs to
run verifier in CFIInstrInserter. It defaults to false.
Differential Revision: https://reviews.llvm.org/D46444
llvm-svn: 331635
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/CFIInstrInserter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp index b021d960921..a7382692050 100644 --- a/llvm/lib/CodeGen/CFIInstrInserter.cpp +++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp @@ -29,6 +29,11 @@ #include "llvm/Target/TargetMachine.h" using namespace llvm; +static cl::opt<bool> VerifyCFI("verify-cfiinstrs", + cl::desc("Verify Call Frame Information instructions"), + cl::init(false), + cl::Hidden); + namespace { class CFIInstrInserter : public MachineFunctionPass { public: @@ -50,11 +55,12 @@ class CFIInstrInserter : public MachineFunctionPass { 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; |