Skip to content

Commit 73f8ead

Browse files
authored
Merge pull request #20026 from JuliaLang/yyc/tests/llvm
Fix compilation on LLVM svn
2 parents 496ca31 + ddb41c6 commit 73f8ead

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/codegen.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,14 +4420,17 @@ static std::unique_ptr<Module> emit_function(
44204420

44214421
if (ctx.debug_enabled) {
44224422
// TODO: Fix when moving to new LLVM version
4423-
#if JL_LLVM_VERSION < 30400
4423+
#if JL_LLVM_VERSION < 30400
44244424
dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
4425-
#elif JL_LLVM_VERSION >= 30700
4425+
#elif JL_LLVM_VERSION >= 40000
4426+
DIFile *difile = dbuilder.createFile(filename, ".");
4427+
DICompileUnit *CU = dbuilder.createCompileUnit(0x01, difile, "julia", true, "", 0);
4428+
#elif JL_LLVM_VERSION >= 30700
44264429
DICompileUnit *CU = dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
4427-
#else
4430+
#else
44284431
DICompileUnit CU = dbuilder.createCompileUnit(0x01, filename, ".", "julia", true, "", 0);
44294432
assert(CU.Verify());
4430-
#endif
4433+
#endif
44314434

44324435
#if JL_LLVM_VERSION >= 30700
44334436
DISubroutineType *subrty;

src/intrinsics.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ static Value *uint_cnvt(Type *to, Value *x)
154154
return builder.CreateZExt(x, to);
155155
}
156156

157+
#if JL_LLVM_VERSION >= 40000
158+
#define LLVM_FP(a,b) APFloat(a(),b)
159+
#else
157160
#define LLVM_FP(a,b) APFloat(a,b)
161+
#endif
158162
static Constant *julia_const_to_llvm(void *ptr, jl_value_t *bt)
159163
{
160164
// assume `jl_isbits(bt)`.

0 commit comments

Comments
 (0)