Skip to content

Commit

Permalink
Adds an example of pass to debug LLVM IR in gdb (requires MCJIT)
Browse files Browse the repository at this point in the history
Issue: #59
  • Loading branch information
kpp committed Mar 7, 2015
1 parent 95076fb commit 11bcc90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm_stub/cxx_eh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
#include <llvm/Analysis/Verifier.h>
#include "llvm/Transforms/Instrumentation.h"

#include <typeinfo>

Expand Down Expand Up @@ -153,6 +154,11 @@ int main() {

builder.CreateRet( result ); // << z.y

ModulePass *DebugIRPass = createDebugIRPass(
/*HideDebugIntrinsics*/ false, /*HideDebugMetadata*/ false,
/*Directory*/ "./", /*Filename*/ "llst_cxx_eh");
DebugIRPass->runOnModule(*M);

TargetOptions Opts;
ExecutionEngine* EE = EngineBuilder(M)
.setEngineKind(EngineKind::JIT)
Expand Down

0 comments on commit 11bcc90

Please sign in to comment.