diff options
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index a9d57ea8b8a..6c2a871e520 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -171,16 +171,17 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> { } pub fn print_version() { + let (major, minor, patch) = get_version(); + println!("LLVM version: {}.{}.{}", major, minor, patch); +} + +pub fn get_version() -> (u32, u32, u32) { // Can be called without initializing LLVM unsafe { - println!("LLVM version: {}.{}", llvm::LLVMRustVersionMajor(), llvm::LLVMRustVersionMinor()); + (llvm::LLVMRustVersionMajor(), llvm::LLVMRustVersionMinor(), llvm::LLVMRustVersionPatch()) } } -pub fn get_major_version() -> u32 { - unsafe { llvm::LLVMRustVersionMajor() } -} - pub fn print_passes() { // Can be called without initializing LLVM unsafe { |
