Skip to content

Commit

Permalink
Fix two bugs causing missing backtraces on recent LLVM 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jul 12, 2014
1 parent e9d92c8 commit 1a41588
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3428,21 +3428,28 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
assert(CU.Verify());
#endif

DICompositeType subrty = dbuilder.createSubroutineType(fil,EltTypeArray);

fil = dbuilder.createFile(filename, ".");
#ifndef LLVM34
SP = dbuilder.createFunction((DIDescriptor)dbuilder.getCU(),
#else
SP = dbuilder.createFunction(CU,
#endif
dbgFuncName, f->getName(),
fil,
0,
dbuilder.createSubroutineType(fil,EltTypeArray),
false, true,
0, true, f);
dbgFuncName, // Name
f->getName(), // LinkageName
fil, // File
0, // LineNo
subrty, // Ty
false, // isLocalToUnit
true, // isDefinition
0, // ScopeLine
0, // Flags
true, // isOptimized
f); // Fn
// set initial line number
builder.SetCurrentDebugLocation(DebugLoc::get(lno, 0, (MDNode*)SP, NULL));
assert(SP.Verify() && SP.describes(f));
assert(SP.Verify() && SP.describes(f) && SP.getFunction() == f);
}

Value *fArg=NULL, *argArray=NULL, *argCount=NULL;
Expand Down Expand Up @@ -4463,6 +4470,9 @@ extern "C" void jl_init_codegen(void)
MAttrs);
assert(jl_TargetMachine);
jl_ExecutionEngine = eb.create(jl_TargetMachine);
#ifdef LLVM35
jl_ExecutionEngine->setProcessAllSections(true);
#endif
#endif // LLVM VERSION
jl_ExecutionEngine->DisableLazyCompilation();
mbuilder = new MDBuilder(getGlobalContext());
Expand Down

0 comments on commit 1a41588

Please sign in to comment.