about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-28 22:51:51 -0700
committerbors <bors@rust-lang.org>2013-10-28 22:51:51 -0700
commit671ab42a3b86addf7b90ff126554a092579e589a (patch)
tree9be83bf730af3c4c600aec162208a6b3eb1c36d8 /src/rustllvm/RustWrapper.cpp
parentdba60700804119f7e953e6b2b72ce4875c9d60cb (diff)
parent541e5f84d7ccbf02f8fdab6da0ff92f7ffbf0866 (diff)
downloadrust-671ab42a3b86addf7b90ff126554a092579e589a.tar.gz
rust-671ab42a3b86addf7b90ff126554a092579e589a.zip
auto merge of #10127 : thestinger/rust/cold, r=pcwalton
This allows a function to marked as infrequently called, resulting in
any branch calling it to be considered colder.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index f8d56f4e892..0a148d334ab 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -365,6 +365,11 @@ extern "C" void LLVMRemoveReturnAttribute(LLVMValueRef Fn, LLVMAttribute PA) {
                       AttributeSet::get(A->getContext(), AttributeSet::ReturnIndex,  B));
 }
 
+extern "C" void LLVMAddColdAttribute(LLVMValueRef Fn) {
+  Function *A = unwrap<Function>(Fn);
+  A->addAttribute(AttributeSet::FunctionIndex, Attribute::Cold);
+}
+
 extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B,
                                             LLVMValueRef source,
                                             const char* Name,