File tree 2 files changed +21
-0
lines changed
rustc_codegen_llvm/src/llvm 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,6 +1022,13 @@ extern "C" {
1022
1022
// EraseFromParent doesn't exist :(
1023
1023
//pub fn LLVMEraseFromParent(BB: &BasicBlock) -> &Value;
1024
1024
// Enzyme
1025
+ pub fn LLVMRustAddFncParamAttr < ' a > (
1026
+ Instr : & ' a Value ,
1027
+ index : c_uint ,
1028
+ Attr : & ' a Attribute
1029
+ ) ;
1030
+
1031
+ pub fn LLVMRustAddRetAttr ( V : & Value , attr : AttributeKind ) ;
1025
1032
pub fn LLVMRustRemoveFncAttr ( V : & Value , attr : AttributeKind ) ;
1026
1033
pub fn LLVMRustHasDbgMetadata ( I : & Value ) -> bool ;
1027
1034
pub fn LLVMRustHasMetadata ( I : & Value , KindID : c_uint ) -> bool ;
Original file line number Diff line number Diff line change @@ -857,6 +857,20 @@ extern "C" void LLVMRustRemoveFncAttr(LLVMValueRef F,
857
857
}
858
858
}
859
859
860
+ extern " C" void LLVMRustAddFncParamAttr (LLVMValueRef F, unsigned i,
861
+ LLVMAttributeRef RustAttr) {
862
+ if (auto *Fn = dyn_cast<Function>(unwrap<Value>(F))) {
863
+ Fn->addParamAttr (i, unwrap (RustAttr));
864
+ }
865
+ }
866
+
867
+ extern " C" void LLVMRustAddRetFncAttr (LLVMValueRef F,
868
+ LLVMRustAttribute RustAttr) {
869
+ if (auto *Fn = dyn_cast<Function>(unwrap<Value>(F))) {
870
+ Fn->addRetAttr (fromRust (RustAttr));
871
+ }
872
+ }
873
+
860
874
extern " C" LLVMMetadataRef LLVMRustDIGetInstMetadata (LLVMValueRef x) {
861
875
if (auto *I = dyn_cast<Instruction>(unwrap<Value>(x))) {
862
876
// auto *MD = I->getMetadata(LLVMContext::MD_dbg);
You can’t perform that action at this time.
0 commit comments