Teach rustc about DW_AT_noreturn and a few more DIFlags
This commit is contained in:
parent
15a1e2844d
commit
7188706c4f
4 changed files with 54 additions and 2 deletions
|
@ -457,9 +457,13 @@ enum class LLVMRustDIFlags : uint32_t {
|
|||
FlagStaticMember = (1 << 12),
|
||||
FlagLValueReference = (1 << 13),
|
||||
FlagRValueReference = (1 << 14),
|
||||
FlagMainSubprogram = (1 << 21),
|
||||
FlagExternalTypeRef = (1 << 15),
|
||||
FlagIntroducedVirtual = (1 << 18),
|
||||
FlagBitField = (1 << 19),
|
||||
FlagNoReturn = (1 << 20),
|
||||
FlagMainSubprogram = (1 << 21),
|
||||
// Do not add values that are not supported by the minimum LLVM
|
||||
// version we support!
|
||||
// version we support! see llvm/include/llvm/IR/DebugInfoFlags.def
|
||||
};
|
||||
|
||||
inline LLVMRustDIFlags operator&(LLVMRustDIFlags A, LLVMRustDIFlags B) {
|
||||
|
@ -545,6 +549,18 @@ static unsigned fromRust(LLVMRustDIFlags Flags) {
|
|||
Result |= DINode::DIFlags::FlagRValueReference;
|
||||
}
|
||||
#if LLVM_RUSTLLVM || LLVM_VERSION_GE(4, 0)
|
||||
if (isSet(Flags & LLVMRustDIFlags::FlagExternalTypeRef)) {
|
||||
Result |= DINode::DIFlags::FlagExternalTypeRef;
|
||||
}
|
||||
if (isSet(Flags & LLVMRustDIFlags::FlagIntroducedVirtual)) {
|
||||
Result |= DINode::DIFlags::FlagIntroducedVirtual;
|
||||
}
|
||||
if (isSet(Flags & LLVMRustDIFlags::FlagBitField)) {
|
||||
Result |= DINode::DIFlags::FlagBitField;
|
||||
}
|
||||
if (isSet(Flags & LLVMRustDIFlags::FlagNoReturn)) {
|
||||
Result |= DINode::DIFlags::FlagNoReturn;
|
||||
}
|
||||
if (isSet(Flags & LLVMRustDIFlags::FlagMainSubprogram)) {
|
||||
Result |= DINode::DIFlags::FlagMainSubprogram;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue