Skip to content

Commit 7d6181e

Browse files
committed
add bunch of fixmes: currently there exist some functions that accept LLVMValueRef, some that accept LLVMMetadataRef, and replacing one with another not always possible without explicit convertion
1 parent 0b5f9ac commit 7d6181e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,13 @@ extern "C" {
10721072
pub fn LLVMGetPoison(Ty: &Type) -> &Value;
10731073

10741074
// Operations on metadata
1075+
// FIXME: deprecated, replace with LLVMMDStringInContext2
10751076
pub fn LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value;
1077+
1078+
// LLVMMDStringInContext but don't own string
1079+
pub fn LLVMMDStringInContext2(C: &Context, Str: *const c_char, SLen: size_t) -> &Metadata;
1080+
1081+
// FIXME: deprecated, replace with LLVMMDNodeInContext2
10761082
pub fn LLVMMDNodeInContext<'a>(
10771083
C: &'a Context,
10781084
Vals: *const &'a Value,
@@ -1111,6 +1117,8 @@ extern "C" {
11111117
Packed: Bool,
11121118
) -> &'a Value;
11131119

1120+
// FIXME: replace with LLVMConstArray2
1121+
// https://github.com/llvm/llvm-project/commit/35276f16e5a2cae0dfb49c0fbf874d4d2f177acc
11141122
pub fn LLVMConstArray<'a>(
11151123
ElementTy: &'a Type,
11161124
ConstantVals: *const &'a Value,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,8 @@ extern "C" void LLVMRustWriteValueToString(LLVMValueRef V,
11501150
}
11511151

11521152
// LLVMArrayType function does not support 64-bit ElementCount
1153+
// FIXME: replace with LLVMArrayType2
1154+
// https://github.com/llvm/llvm-project/commit/35276f16e5a2cae0dfb49c0fbf874d4d2f177acc
11531155
extern "C" LLVMTypeRef LLVMRustArrayType(LLVMTypeRef ElementTy,
11541156
uint64_t ElementCount) {
11551157
return wrap(ArrayType::get(unwrap(ElementTy), ElementCount));

0 commit comments

Comments
 (0)