about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-26 10:25:03 -0700
committerbors <bors@rust-lang.org>2016-03-26 10:25:03 -0700
commit65bc9d77308e55321f36f7c8381a98ed10f93f6a (patch)
tree025ef8ae260c53286dbae300d284b8bf90e51717 /src/rustllvm/RustWrapper.cpp
parent8f34053f762f708430971a36fc4c6e665528ebe2 (diff)
parent1eacb4a6c3e5d4d45cd69c0b32c7de89d2d26e89 (diff)
downloadrust-65bc9d77308e55321f36f7c8381a98ed10f93f6a.tar.gz
rust-65bc9d77308e55321f36f7c8381a98ed10f93f6a.zip
Auto merge of #32503 - dotdash:llvm_attrs, r=eddyb
Fix building on ARM
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 33174c1e9df..6ff90a8f53a 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -151,6 +151,16 @@ extern "C" void LLVMAddFunctionAttrStringValue(LLVMValueRef Fn, unsigned index,
   F->addAttributes(index, AttributeSet::get(F->getContext(), index, B));
 }
 
+extern "C" void LLVMRemoveFunctionAttributes(LLVMValueRef Fn, unsigned index, uint64_t Val) {
+  Function *A = unwrap<Function>(Fn);
+  const AttributeSet PAL = A->getAttributes();
+  AttrBuilder B(Val);
+  const AttributeSet PALnew =
+    PAL.removeAttributes(A->getContext(), index,
+                         AttributeSet::get(A->getContext(), index, B));
+  A->setAttributes(PALnew);
+}
+
 extern "C" void LLVMRemoveFunctionAttrString(LLVMValueRef fn, unsigned index, const char *Name) {
   Function *f = unwrap<Function>(fn);
   LLVMContext &C = f->getContext();