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>2024-04-10 02:43:17 +0000
committerbors <bors@rust-lang.org>2024-04-10 02:43:17 +0000
commit1c77f7378e1894c3580046ba01791f2ed5a88ee3 (patch)
treeaeeddc1dc0c6cec37c21d4891ee03f8c5af20209 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent93c131eba0fdcccc98d2fa52248765511cab93c5 (diff)
parentdf068dba0a3f2bf332079fbfa5b94d0249d40fec (diff)
downloadrust-1c77f7378e1894c3580046ba01791f2ed5a88ee3.tar.gz
rust-1c77f7378e1894c3580046ba01791f2ed5a88ee3.zip
Auto merge of #123708 - matthiaskrgr:rollup-uf9w1e9, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #121884 (Port exit-code run-make test to use rust)
 - #122200 (Unconditionally show update nightly hint on ICE)
 - #123568 (Clean up tests/ui by removing `does-nothing.rs`)
 - #123609 (Don't use bytepos offsets when computing semicolon span for removal)
 - #123612 (Set target-abi module flag for RISC-V targets)
 - #123633 (Store all args in the unsupported Command implementation)
 - #123668 (async closure coroutine by move body MirPass refactoring)

Failed merges:

 - #123701 (Only assert for child/parent projection compatibility AFTER checking that theyre coming from the same place)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index a6894a7e089..37c2da4c23a 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -817,7 +817,7 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }
 
 extern "C" uint32_t LLVMRustVersionMajor() { return LLVM_VERSION_MAJOR; }
 
-extern "C" void LLVMRustAddModuleFlag(
+extern "C" void LLVMRustAddModuleFlagU32(
     LLVMModuleRef M,
     Module::ModFlagBehavior MergeBehavior,
     const char *Name,
@@ -825,6 +825,16 @@ extern "C" void LLVMRustAddModuleFlag(
   unwrap(M)->addModuleFlag(MergeBehavior, Name, Value);
 }
 
+extern "C" void LLVMRustAddModuleFlagString(
+    LLVMModuleRef M,
+    Module::ModFlagBehavior MergeBehavior,
+    const char *Name,
+    const char *Value,
+    size_t ValueLen) {
+  unwrap(M)->addModuleFlag(MergeBehavior, Name,
+    MDString::get(unwrap(M)->getContext(), StringRef(Value, ValueLen)));
+}
+
 extern "C" bool LLVMRustHasModuleFlag(LLVMModuleRef M, const char *Name,
                                       size_t Len) {
   return unwrap(M)->getModuleFlag(StringRef(Name, Len)) != nullptr;