Mark pure asm as willreturn
This commit is contained in:
parent
41b81584e2
commit
bc96516a28
4 changed files with 5 additions and 0 deletions
|
@ -304,6 +304,7 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
|
||||||
} else if options.contains(InlineAsmOptions::READONLY) {
|
} else if options.contains(InlineAsmOptions::READONLY) {
|
||||||
llvm::Attribute::ReadOnly.apply_callsite(llvm::AttributePlace::Function, result);
|
llvm::Attribute::ReadOnly.apply_callsite(llvm::AttributePlace::Function, result);
|
||||||
}
|
}
|
||||||
|
llvm::Attribute::WillReturn.apply_callsite(llvm::AttributePlace::Function, result);
|
||||||
} else if options.contains(InlineAsmOptions::NOMEM) {
|
} else if options.contains(InlineAsmOptions::NOMEM) {
|
||||||
llvm::Attribute::InaccessibleMemOnly
|
llvm::Attribute::InaccessibleMemOnly
|
||||||
.apply_callsite(llvm::AttributePlace::Function, result);
|
.apply_callsite(llvm::AttributePlace::Function, result);
|
||||||
|
|
|
@ -132,6 +132,7 @@ pub enum Attribute {
|
||||||
ReadNone = 26,
|
ReadNone = 26,
|
||||||
InaccessibleMemOnly = 27,
|
InaccessibleMemOnly = 27,
|
||||||
SanitizeHWAddress = 28,
|
SanitizeHWAddress = 28,
|
||||||
|
WillReturn = 29,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// LLVMIntPredicate
|
/// LLVMIntPredicate
|
||||||
|
|
|
@ -86,6 +86,7 @@ enum LLVMRustAttribute {
|
||||||
ReadNone = 26,
|
ReadNone = 26,
|
||||||
InaccessibleMemOnly = 27,
|
InaccessibleMemOnly = 27,
|
||||||
SanitizeHWAddress = 28,
|
SanitizeHWAddress = 28,
|
||||||
|
WillReturn = 29,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct OpaqueRustString *RustStringRef;
|
typedef struct OpaqueRustString *RustStringRef;
|
||||||
|
|
|
@ -207,6 +207,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
||||||
return Attribute::InaccessibleMemOnly;
|
return Attribute::InaccessibleMemOnly;
|
||||||
case SanitizeHWAddress:
|
case SanitizeHWAddress:
|
||||||
return Attribute::SanitizeHWAddress;
|
return Attribute::SanitizeHWAddress;
|
||||||
|
case WillReturn:
|
||||||
|
return Attribute::WillReturn;
|
||||||
}
|
}
|
||||||
report_fatal_error("bad AttributeKind");
|
report_fatal_error("bad AttributeKind");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue