Skip to content

Commit 2992720

Browse files
committed
Declare all Rust functions as unnamed_addr. Closes #8957
1 parent 6789a77 commit 2992720

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc/middle/trans/base.rs

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ pub fn decl_fn(llmod: ModuleRef, name: &str, cc: lib::llvm::CallConv, ty: Type)
182182
};
183183

184184
lib::llvm::SetFunctionCallConv(llfn, cc);
185+
// Function addresses in Rust are never significant, allowing functions to be merged.
186+
lib::llvm::SetUnnamedAddr(llfn, true);
185187
return llfn;
186188
}
187189

0 commit comments

Comments
 (0)