about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-16 03:10:52 +0000
committerbors <bors@rust-lang.org>2021-01-16 03:10:52 +0000
commit635ccfe01c0be19d9fb0a99facbd9e06290f0ab1 (patch)
tree278f5200156f523b626bea00183518235a0b9074 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent6c869d34ae2d87d21db9892d4dc088639bcbe041 (diff)
parentcd2580722375671fa2967661f65b7b33570547ec (diff)
downloadrust-635ccfe01c0be19d9fb0a99facbd9e06290f0ab1.tar.gz
rust-635ccfe01c0be19d9fb0a99facbd9e06290f0ab1.zip
Auto merge of #77885 - erikdesjardins:probeasm, r=cuviper
Use probe-stack=inline-asm in LLVM 11+

Fixes (?) #74405, related to #43241

r? `@cuviper`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs11
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 {