about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-09-09 13:01:02 -0700
committerbors <bors@rust-lang.org>2013-09-09 13:01:02 -0700
commit54ae2800ffb30513f89ce13d27ac3c8d095d98ac (patch)
tree1b7bc33acd05a16a9d1336379e206007c3965069 /src/rustllvm/RustWrapper.cpp
parent60a0dbc095d83964ba668c89e25261ead3df55f4 (diff)
parent889e1b9731615a6b03b0e46662edb70c6ca7e7ad (diff)
downloadrust-54ae2800ffb30513f89ce13d27ac3c8d095d98ac.tar.gz
rust-54ae2800ffb30513f89ce13d27ac3c8d095d98ac.zip
auto merge of #9071 : thestinger/rust/noalias, r=alexcrichton
This also removes a FIXME I added referring to a now closed issue.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 376adf24e25..226a7c34304 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -350,6 +350,21 @@ extern "C" void LLVMAddFunctionAttrString(LLVMValueRef fn, const char *Name) {
   unwrap<Function>(fn)->addFnAttr(Name);
 }
 
+
+extern "C" void LLVMAddReturnAttribute(LLVMValueRef Fn, LLVMAttribute PA) {
+  Function *A = unwrap<Function>(Fn);
+  AttrBuilder B(PA);
+  A->addAttributes(AttributeSet::ReturnIndex,
+                   AttributeSet::get(A->getContext(), AttributeSet::ReturnIndex,  B));
+}
+
+extern "C" void LLVMRemoveReturnAttribute(LLVMValueRef Fn, LLVMAttribute PA) {
+  Function *A = unwrap<Function>(Fn);
+  AttrBuilder B(PA);
+  A->removeAttributes(AttributeSet::ReturnIndex,
+                      AttributeSet::get(A->getContext(), AttributeSet::ReturnIndex,  B));
+}
+
 extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B,
                                             LLVMValueRef source,
                                             const char* Name,