diff options
Diffstat (limited to 'src/zig_llvm.cpp')
| -rw-r--r-- | src/zig_llvm.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index d6c32b01b2..c59a533a05 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -561,6 +561,14 @@ void ZigLLVMAddFunctionAttr(LLVMValueRef fn_ref, const char *attr_name, const ch func->setAttributes(new_attr_set); } +void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn_ref) { + Function *func = unwrap<Function>(fn_ref); + const AttributeSet attr_set = func->getAttributes(); + const AttributeSet new_attr_set = attr_set.addAttribute(func->getContext(), AttributeSet::FunctionIndex, + Attribute::Cold); + func->setAttributes(new_attr_set); +} + static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, ""); static_assert((Triple::VendorType)ZigLLVM_LastVendorType == Triple::LastVendorType, ""); |
