Changeset 5444 for icGREP/icgrep-devel


Ignore:
Timestamp:
May 12, 2017, 6:36:10 AM (2 years ago)
Author:
cameron
Message:

VerifyIR option

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5440 r5444  
    3030#include <thread>
    3131#include <boost/lockfree/queue.hpp>
    32 #ifndef NDEBUG
    3332#include <llvm/IR/Verifier.h>
    34 #endif
    3533
    3634using namespace llvm;
     
    4341static cl::bits<DebugFlags>
    4442DebugOptions(cl::values(clEnumVal(ShowIR, "Print generated LLVM IR."),
     43                        clEnumVal(VerifyIR, "Run the IR verification pass."),
    4544#ifndef USE_LLVM_3_6
    4645                        clEnumVal(ShowASM, "Print assembly code."),
     
    261260
    262261        legacy::PassManager PM;
    263         #ifndef NDEBUG
     262#ifndef NDEBUG
    264263        PM.add(createVerifierPass());
    265         #endif
     264#else
     265        if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::VerifyIR))) {
     266            PM.add(createVerifierPass());
     267        }
     268#endif
    266269        PM.add(createPromoteMemoryToRegisterPass()); //Force the use of mem2reg to promote stack variables.
    267270        PM.add(createReassociatePass());             //Reassociate expressions.
     
    319322    } catch (...) {
    320323        module->dump();
    321         throw;
     324        report_fatal_error("LLVM error: link or finalize.");
    322325    }
    323326}
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5436 r5444  
    3030enum DebugFlags {
    3131    ShowIR,
     32    VerifyIR,
    3233#ifndef USE_LLVM_3_6
    3334    ShowASM,
Note: See TracChangeset for help on using the changeset viewer.