Skip to content

Commit

Permalink
Fix compilation on LLVM svn
Browse files Browse the repository at this point in the history
Ref llvm-mirror/llvm@20a600c: `IEEEhalf/single/double/quad` changed from static member to getter functions.
Ref llvm-mirror/llvm@faaafe5: `DIBuilder::createCompileUnit` take `DIFile`.
  • Loading branch information
yuyichao committed Jan 14, 2017
1 parent 71b207a commit ddb41c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4420,14 +4420,17 @@ static std::unique_ptr<Module> emit_function(

if (ctx.debug_enabled) {
// TODO: Fix when moving to new LLVM version
#if JL_LLVM_VERSION < 30400
#if JL_LLVM_VERSION < 30400
dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
#elif JL_LLVM_VERSION >= 30700
#elif JL_LLVM_VERSION >= 40000
DIFile *difile = dbuilder.createFile(filename, ".");
DICompileUnit *CU = dbuilder.createCompileUnit(0x01, difile, "julia", true, "", 0);
#elif JL_LLVM_VERSION >= 30700
DICompileUnit *CU = dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
#else
#else
DICompileUnit CU = dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
assert(CU.Verify());
#endif
#endif

#if JL_LLVM_VERSION >= 30700
DISubroutineType *subrty;
Expand Down
4 changes: 4 additions & 0 deletions src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ static Value *uint_cnvt(Type *to, Value *x)
return builder.CreateZExt(x, to);
}

#if JL_LLVM_VERSION >= 40000
#define LLVM_FP(a,b) APFloat(a(),b)
#else
#define LLVM_FP(a,b) APFloat(a,b)
#endif
static Constant *julia_const_to_llvm(void *ptr, jl_value_t *bt)
{
// assume `jl_isbits(bt)`.
Expand Down

0 comments on commit ddb41c6

Please sign in to comment.