about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-12-05 13:52:53 +0100
committerRalf Jung <post@ralfj.de>2022-12-05 13:52:53 +0100
commit7481ba7746fc5f5b82aaff0fe20cbf55c48d8fd9 (patch)
tree3463b86894affc4a8aee0f10ac9dcfbe0cdc4de1 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent16a9fdf66372a6aeeb86f6cd19e00bdfb0a13912 (diff)
parent203c8765ea33c65d888febe0e8219c4bb11b0d89 (diff)
downloadrust-7481ba7746fc5f5b82aaff0fe20cbf55c48d8fd9.tar.gz
rust-7481ba7746fc5f5b82aaff0fe20cbf55c48d8fd9.zip
Merge from rustc
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;
+}