about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-27 03:27:09 +0000
committerbors <bors@rust-lang.org>2020-03-27 03:27:09 +0000
commit6c19a10e24af157b96687ca8dc1b48ebac4b9489 (patch)
treeaf4246ff21626b91d238c82664ea09f49422c948 /src/libstd
parent7b73d14b0b35e7b4f79f2d71dc1bbbab31698288 (diff)
parent1cc521ef9d8a8a2eb48f0e11ddfc1e70734aff10 (diff)
downloadrust-6c19a10e24af157b96687ca8dc1b48ebac4b9489.tar.gz
rust-6c19a10e24af157b96687ca8dc1b48ebac4b9489.zip
Auto merge of #68404 - Amanieu:llvm-asm, r=estebank
Rename asm! to llvm_asm!

As per https://github.com/rust-lang/rfcs/pull/2843, this PR renames `asm!` to `llvm_asm!`. It also renames the compiler's internal `InlineAsm` data structures to `LlvmInlineAsm` in preparation for the new `asm!` functionality specified in https://github.com/rust-lang/rfcs/pull/2850.

This PR doesn't actually deprecate `asm!` yet, it just makes it redirect to `llvm_asm!`. This is necessary because we first need to update the submodules (in particular stdarch) to use `llvm_asm!`.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs27
-rw-r--r--src/libstd/prelude/v1.rs4
-rw-r--r--src/libstd/sys/sgx/abi/mem.rs2
-rw-r--r--src/libstd/sys/sgx/ext/arch.rs4
-rw-r--r--src/libstd/sys/windows/mod.rs2
5 files changed, 10 insertions, 29 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index d4110527054..09bc183cf20 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -274,6 +274,7 @@
 #![feature(libc)]
 #![feature(link_args)]
 #![feature(linkage)]
+#![feature(llvm_asm)]
 #![feature(log_syntax)]
 #![feature(maybe_uninit_ref)]
 #![feature(maybe_uninit_slice)]
@@ -533,29 +534,9 @@ pub use core::{
 // Re-export built-in macros defined through libcore.
 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
 pub use core::{
-    // Unstable
-    asm,
-    // Stable
-    assert,
-    cfg,
-    column,
-    compile_error,
-    concat,
-    concat_idents,
-    env,
-    file,
-    format_args,
-    format_args_nl,
-    global_asm,
-    include,
-    include_bytes,
-    include_str,
-    line,
-    log_syntax,
-    module_path,
-    option_env,
-    stringify,
-    trace_macros,
+    asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
+    format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm, log_syntax,
+    module_path, option_env, stringify, trace_macros,
 };
 
 #[stable(feature = "core_primitive", since = "1.43.0")]
diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs
index 6712f5ba580..03686d789d7 100644
--- a/src/libstd/prelude/v1.rs
+++ b/src/libstd/prelude/v1.rs
@@ -39,8 +39,8 @@ pub use crate::result::Result::{self, Err, Ok};
 #[doc(no_inline)]
 pub use core::prelude::v1::{
     asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
-    format_args_nl, global_asm, include, include_bytes, include_str, line, log_syntax, module_path,
-    option_env, stringify, trace_macros,
+    format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm, log_syntax,
+    module_path, option_env, stringify, trace_macros,
 };
 
 // FIXME: Attribute and derive macros are not documented because for them rustdoc generates
diff --git a/src/libstd/sys/sgx/abi/mem.rs b/src/libstd/sys/sgx/abi/mem.rs
index 500e62b1cb5..57fd7efdd49 100644
--- a/src/libstd/sys/sgx/abi/mem.rs
+++ b/src/libstd/sys/sgx/abi/mem.rs
@@ -22,7 +22,7 @@ extern "C" {
 #[unstable(feature = "sgx_platform", issue = "56975")]
 pub fn image_base() -> u64 {
     let base;
-    unsafe { asm!("lea IMAGE_BASE(%rip),$0":"=r"(base)) };
+    unsafe { llvm_asm!("lea IMAGE_BASE(%rip),$0":"=r"(base)) };
     base
 }
 
diff --git a/src/libstd/sys/sgx/ext/arch.rs b/src/libstd/sys/sgx/ext/arch.rs
index 5056e388112..0c97a87e2e4 100644
--- a/src/libstd/sys/sgx/ext/arch.rs
+++ b/src/libstd/sys/sgx/ext/arch.rs
@@ -31,7 +31,7 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
         let mut out = MaybeUninit::uninit();
         let error;
 
-        asm!(
+        llvm_asm!(
             "enclu"
             : "={eax}"(error)
             : "{eax}"(ENCLU_EGETKEY),
@@ -60,7 +60,7 @@ pub fn ereport(
     unsafe {
         let mut report = MaybeUninit::uninit();
 
-        asm!(
+        llvm_asm!(
             "enclu"
             : /* no output registers */
             : "{eax}"(ENCLU_EREPORT),
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index b004cd19020..74dd41fd501 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -267,7 +267,7 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
 pub unsafe fn abort_internal() -> ! {
     #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
     {
-        asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
+        llvm_asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
         crate::intrinsics::unreachable();
     }
     crate::intrinsics::abort();