Add LLVM module flags required for the VFE opt
To apply the optimization the `Virtual Function Elim` module flag has to be set. To apply this optimization post-link the `LTOPostLink` module flag has to be set.
This commit is contained in:
parent
def3fd8e92
commit
20f597ffcd
4 changed files with 28 additions and 1 deletions
|
@ -326,6 +326,15 @@ pub unsafe fn create_module<'ll>(
|
|||
)
|
||||
}
|
||||
|
||||
if sess.opts.debugging_opts.virtual_function_elimination {
|
||||
llvm::LLVMRustAddModuleFlag(
|
||||
llmod,
|
||||
llvm::LLVMModFlagBehavior::Error,
|
||||
"Virtual Function Elim\0".as_ptr().cast(),
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
llmod
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue