setGlobalSection and setGlobalAlign work for functions

This commit is contained in:
Andrew Kelley
2017-02-05 12:50:19 -05:00
parent d2f1f57fa4
commit 6f316d8ebd
4 changed files with 65 additions and 24 deletions

View File

@@ -275,6 +275,12 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, FnTableEntry *fn_table_entry) {
ZigLLVMAddFunctionAttr(fn_table_entry->llvm_value, "no-frame-pointer-elim", "true");
ZigLLVMAddFunctionAttr(fn_table_entry->llvm_value, "no-frame-pointer-elim-non-leaf", nullptr);
}
if (fn_table_entry->section_name) {
LLVMSetSection(fn_table_entry->llvm_value, buf_ptr(fn_table_entry->section_name));
}
if (fn_table_entry->alignment) {
LLVMSetAlignment(fn_table_entry->llvm_value, fn_table_entry->alignment);
}
return fn_table_entry->llvm_value;
}