about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2022-05-28 10:43:51 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-11-26 19:35:32 +0000
commitbe6708428fdf6693188e2c2f10f05d1b1aaa5750 (patch)
treed4a02ed59895692fe4ade067fceb1c92575e3bb3 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentc3a1c023c0784ffbcf4dd57cf4618d208bccae69 (diff)
downloadrust-be6708428fdf6693188e2c2f10f05d1b1aaa5750.tar.gz
rust-be6708428fdf6693188e2c2f10f05d1b1aaa5750.zip
Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
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;
+}