diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2019-11-05 09:49:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-05 09:49:50 +0100 |
| commit | 7976d5720a5393274b16b2318375075d4f8d9da8 (patch) | |
| tree | 41859a64450c74f482ef8d9ee5a6dde7a61cba8f /src/librustc_codegen_llvm/llvm/ffi.rs | |
| parent | 5831e0643e1f3772950075e55b62e3a4d0de297a (diff) | |
| parent | 567962d22090bbd23c1c3dc0e04229ac8c681ea8 (diff) | |
| download | rust-7976d5720a5393274b16b2318375075d4f8d9da8.tar.gz rust-7976d5720a5393274b16b2318375075d4f8d9da8.zip | |
Rollup merge of #65720 - icefoxen:LLVMgetInstructionCount, r=rkruppe
Add FFI bindings for LLVM's Module::getInstructionCount() Just to make it usable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm/ffi.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index c69942ef3f2..72b0a7d640a 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1729,6 +1729,7 @@ extern "C" { ) -> LLVMRustResult; pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char); pub fn LLVMRustPrintPasses(); + pub fn LLVMRustGetInstructionCount(M: &Module) -> u32; pub fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char); pub fn LLVMRustAddAlwaysInlinePass(P: &PassManagerBuilder, AddLifetimes: bool); pub fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t); |
