diff options
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index cdb55b179a3..f570e808f56 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -402,6 +402,38 @@ pub enum CodeGenOptLevel { Aggressive, } +/// LLVMRustPassBuilderOptLevel +#[repr(C)] +pub enum PassBuilderOptLevel { + O0, + O1, + O2, + O3, + Os, + Oz, +} + +/// LLVMRustOptStage +#[derive(PartialEq)] +#[repr(C)] +pub enum OptStage { + PreLinkNoLTO, + PreLinkThinLTO, + PreLinkFatLTO, + ThinLTO, + FatLTO, +} + +/// LLVMRustSanitizerOptions +#[repr(C)] +pub struct SanitizerOptions { + pub sanitize_memory: bool, + pub sanitize_thread: bool, + pub sanitize_address: bool, + pub sanitize_recover: bool, + pub sanitize_memory_track_origins: c_int, +} + /// LLVMRelocMode #[derive(Copy, Clone, PartialEq)] #[repr(C)] @@ -1896,6 +1928,23 @@ extern "C" { Output: *const c_char, FileType: FileType, ) -> LLVMRustResult; + pub fn LLVMRustOptimizeWithNewPassManager( + M: &'a Module, + TM: &'a TargetMachine, + OptLevel: PassBuilderOptLevel, + OptStage: OptStage, + NoPrepopulatePasses: bool, + VerifyIR: bool, + UseThinLTOBuffers: bool, + MergeFunctions: bool, + UnrollLoops: bool, + SLPVectorize: bool, + LoopVectorize: bool, + DisableSimplifyLibCalls: bool, + SanitizerOptions: Option<&SanitizerOptions>, + PGOGenPath: *const c_char, + PGOUsePath: *const c_char, + ); pub fn LLVMRustPrintModule( M: &'a Module, Output: *const c_char, |
