Skip to content

Commit 757a9ce

Browse files
committed
[LLVM 4.0] Support new DIFlags enum
1 parent dbdd60e commit 757a9ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/rustllvm/RustWrapper.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,13 @@ inline LLVMRustDIFlags visibility(LLVMRustDIFlags f) {
397397
return static_cast<LLVMRustDIFlags>(static_cast<uint32_t>(f) & 0x3);
398398
}
399399

400+
#if LLVM_VERSION_GE(4, 0)
401+
static DINode::DIFlags from_rust(LLVMRustDIFlags flags) {
402+
DINode::DIFlags result = DINode::DIFlags::FlagZero;
403+
#else
400404
static unsigned from_rust(LLVMRustDIFlags flags) {
401405
unsigned result = 0;
406+
#endif
402407

403408
switch (visibility(flags)) {
404409
case LLVMRustDIFlags::FlagPrivate:

0 commit comments

Comments
 (0)