Skip to content

Commit 6487ee3

Browse files
committed
Fix return value of LLVMRustMetadataAsValue
`LLVMRustMetadataAsValue` would previously return `void`, despite the corresponding Rust function expecting to return a `ValueRef`.
1 parent 3ece2d9 commit 6487ee3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rustllvm/RustWrapper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M, const char *Name,
566566
unwrap(M)->addModuleFlag(Module::Warning, Name, Value);
567567
}
568568

569-
extern "C" void LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) {
570-
wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
569+
extern "C" LLVMValueRef LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) {
570+
return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
571571
}
572572

573573
extern "C" LLVMRustDIBuilderRef LLVMRustDIBuilderCreate(LLVMModuleRef M) {

0 commit comments

Comments
 (0)