add support for the cold function attribute

This allows a function to marked as infrequently called, resulting in
any branch calling it to be considered colder.
This commit is contained in:
Daniel Micay
2013-10-20 23:13:48 -04:00
parent d664ca2635
commit 541e5f84d7
6 changed files with 23 additions and 6 deletions

View File

@@ -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,