Skip to content

Commit

Permalink
Fix: compile llvm_ext.cc with LLVM 3.5
Browse files Browse the repository at this point in the history
ysbaddaden authored and Ary Borenszweig committed Oct 26, 2016

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent 9186fde commit 8b7283b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/llvm/ext/llvm_ext.cc
Original file line number Diff line number Diff line change
@@ -240,16 +240,23 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(DIBuilderRef Dref,
LLVMMetadataRef Expr,
LLVMValueRef DL,
LLVMBasicBlockRef Block) {
#if LLVM_VERSION_LE(3, 6)
#if LLVM_VERSION_EQ(3, 5)
DIBuilder *D = unwrap(Dref);
Instruction *Instr =
D->insertDeclare(unwrap(Storage), unwrapDI<DIVariable>(VarInfo),
# if !LLVM_VERSION_EQ(3, 5)
unwrapDI<DIExpression>(Expr),
# endif
unwrap(Block));
Instr->setDebugLoc(DebugLoc::getFromDILocation(cast<MDNode>(DL)));
#endif

#if LLVM_VERSION_EQ(3, 6)
DIBuilder *D = unwrap(Dref);
Instruction *Instr =
D->insertDeclare(unwrap(Storage), unwrapDI<DIVariable>(VarInfo),
unwrapDI<DIExpression>(Expr), unwrap(Block));
Instr->setDebugLoc(DebugLoc::getFromDILocation(cast<MDNode>(unwrap<MetadataAsValue>(DL)->getMetadata())));
#else /* LLVM > 3.6 */
#endif

#if LLVM_VERSION_GE(3, 7)
Instruction *Instr =
Dref->insertDeclare(unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
unwrapDI<DIExpression>(Expr),

0 comments on commit 8b7283b

Please sign in to comment.