about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-05 12:55:36 +0000
committerbors <bors@rust-lang.org>2022-12-05 12:55:36 +0000
commit552b63c1619498f1a17fd482f4bb87815d8fdc48 (patch)
tree3463b86894affc4a8aee0f10ac9dcfbe0cdc4de1 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentfaec28970f86f52ca37e0e8cec0a447ba2f1393b (diff)
parent7481ba7746fc5f5b82aaff0fe20cbf55c48d8fd9 (diff)
downloadrust-552b63c1619498f1a17fd482f4bb87815d8fdc48.tar.gz
rust-552b63c1619498f1a17fd482f4bb87815d8fdc48.zip
Auto merge of #2715 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index 216c35d6da0..792d921c6a4 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -1967,3 +1967,7 @@ extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
 #endif
     return -1;
 }
+
+extern "C" bool LLVMRustIsBitcode(char *ptr, size_t len) {
+  return identify_magic(StringRef(ptr, len)) == file_magic::bitcode;
+}