Set NumRegisterParameters LLVM module flag to N when -Zregparm=N is
set * Enforce the `-Zregparm=N` flag by setting the NumRegisterParameters LLVM module flag * Add assembly tests verifying that the parameters are passed in registers for reparm values 1, 2, and 3, for both LLVM intrinsics and non-builtin functions * Add c_void type to minicore
This commit is contained in:
@@ -372,6 +372,15 @@ pub(crate) unsafe fn create_module<'ll>(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(regparm_count) = sess.opts.unstable_opts.regparm {
|
||||
llvm::add_module_flag_u32(
|
||||
llmod,
|
||||
llvm::ModuleFlagMergeBehavior::Error,
|
||||
"NumRegisterParameters",
|
||||
regparm_count,
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(BranchProtection { bti, pac_ret }) = sess.opts.unstable_opts.branch_protection {
|
||||
if sess.target.arch == "aarch64" {
|
||||
llvm::add_module_flag_u32(
|
||||
|
||||
Reference in New Issue
Block a user