aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stage1/codegen.cpp')
-rw-r--r--src/stage1/codegen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stage1/codegen.cpp b/src/stage1/codegen.cpp
index 08c7e72e97..38c537ae12 100644
--- a/src/stage1/codegen.cpp
+++ b/src/stage1/codegen.cpp
@@ -484,6 +484,12 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
addLLVMFnAttrInt(llvm_fn, "alignstack", fn->alignstack_value);
}
+ if (g->build_mode == BuildModeSmallRelease) {
+ // Optimize for small code size.
+ addLLVMFnAttr(llvm_fn, "minsize");
+ addLLVMFnAttr(llvm_fn, "optsize");
+ }
+
addLLVMFnAttr(llvm_fn, "nounwind");
add_uwtable_attr(g, llvm_fn);
addLLVMFnAttr(llvm_fn, "nobuiltin");