Skip to content

Commit 5f9e432

Browse files
committed
rustllvm: adjust usage of createPointerType
1 parent 2c9c8dc commit 5f9e432

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
#include "llvm/IR/CallSite.h"
2020

21+
#if LLVM_VERSION_GE(5, 0)
22+
#include "llvm/ADT/Optional.h"
23+
#endif
24+
2125
//===----------------------------------------------------------------------===
2226
//
2327
// This file defines alternate interfaces to core functions that are more
@@ -557,7 +561,11 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreatePointerType(
557561
LLVMRustDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
558562
uint64_t SizeInBits, uint32_t AlignInBits, const char *Name) {
559563
return wrap(Builder->createPointerType(unwrapDI<DIType>(PointeeTy),
560-
SizeInBits, AlignInBits, Name));
564+
SizeInBits, AlignInBits,
565+
#if LLVM_VERSION_GE(5, 0)
566+
/* DWARFAddressSpace */ None,
567+
#endif
568+
Name));
561569
}
562570

563571
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStructType(

0 commit comments

Comments
 (0)