Skip to content

Commit

Permalink
Support LLVM 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Aug 11, 2017
1 parent 3a0a361 commit 6d6f212
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/llvm/ext/llvm_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ using namespace llvm;
#define LLVM_VERSION_LE(major, minor) \
(LLVM_VERSION_MAJOR < (major) || LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR <= (minor))

#if LLVM_VERSION_LE(4, 0)
typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DIBuilder, LLVMDIBuilderRef)

Expand All @@ -26,6 +27,7 @@ DEFINE_ISA_CONVERSION_FUNCTIONS(Metadata, LLVMMetadataRef)
inline Metadata **unwrap(LLVMMetadataRef *Vals) {
return reinterpret_cast<Metadata **>(Vals);
}
#endif

typedef DIBuilder *DIBuilderRef;
#define DIArray DINodeArray
Expand Down Expand Up @@ -283,7 +285,11 @@ LLVMMetadataRef LLVMDIBuilderCreatePointerType(DIBuilderRef Dref,
uint64_t AlignInBits,
const char *Name) {
DIDerivedType *T = Dref->createPointerType(unwrapDI<DIType>(PointeeType),
SizeInBits, AlignInBits, Name);
SizeInBits, AlignInBits,
#if LLVM_VERSION_GE(5, 0)
None,
#endif
Name);
return wrap(T);
}

Expand Down

0 comments on commit 6d6f212

Please sign in to comment.