Skip to content

Commit 07d42da

Browse files
committed
Explain why the remaining LLVMRustDIBuilder* wrappers exist
1 parent b961a94 commit 07d42da

File tree

1 file changed

+19
-0
lines changed
  • compiler/rustc_codegen_llvm/src/llvm

1 file changed

+19
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+19
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,9 @@ unsafe extern "C" {
20632063
ValueLen: size_t,
20642064
);
20652065

2066+
/// As of LLVM 18/19, the corresponding LLVM-C function is hard-coded to
2067+
/// assume `DebugNameTableKind = Default`, but we sometimes want to pass
2068+
/// `None`.
20662069
pub fn LLVMRustDIBuilderCreateCompileUnit<'a>(
20672070
Builder: &DIBuilder<'a>,
20682071
Lang: c_uint,
@@ -2080,6 +2083,8 @@ unsafe extern "C" {
20802083
DebugNameTableKind: DebugNameTableKind,
20812084
) -> &'a DIDescriptor;
20822085

2086+
/// As of LLVM 18/19, the corresponding LLVM-C function is hard-coded to
2087+
/// assume that there is no optional checksum or optional source text.
20832088
pub fn LLVMRustDIBuilderCreateFile<'a>(
20842089
Builder: &DIBuilder<'a>,
20852090
Filename: *const c_char,
@@ -2093,6 +2098,8 @@ unsafe extern "C" {
20932098
SourceLen: size_t,
20942099
) -> &'a DIFile;
20952100

2101+
/// As of LLVM 18/19, the corresponding LLVM-C function only supports a
2102+
/// subset of `DISPFlags`.
20962103
pub fn LLVMRustDIBuilderCreateFunction<'a>(
20972104
Builder: &DIBuilder<'a>,
20982105
Scope: &'a DIDescriptor,
@@ -2111,6 +2118,7 @@ unsafe extern "C" {
21112118
Decl: Option<&'a DIDescriptor>,
21122119
) -> &'a DISubprogram;
21132120

2121+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
21142122
pub fn LLVMRustDIBuilderCreateMethod<'a>(
21152123
Builder: &DIBuilder<'a>,
21162124
Scope: &'a DIDescriptor,
@@ -2126,6 +2134,7 @@ unsafe extern "C" {
21262134
TParam: &'a DIArray,
21272135
) -> &'a DISubprogram;
21282136

2137+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
21292138
pub fn LLVMRustDIBuilderCreateVariantMemberType<'a>(
21302139
Builder: &DIBuilder<'a>,
21312140
Scope: &'a DIScope,
@@ -2141,6 +2150,7 @@ unsafe extern "C" {
21412150
Ty: &'a DIType,
21422151
) -> &'a DIType;
21432152

2153+
/// FIXME(#134001): This doesn't map cleanly to any single LLVM-C function.
21442154
pub fn LLVMRustDIBuilderCreateStaticVariable<'a>(
21452155
Builder: &DIBuilder<'a>,
21462156
Context: Option<&'a DIScope>,
@@ -2157,6 +2167,7 @@ unsafe extern "C" {
21572167
AlignInBits: u32,
21582168
) -> &'a DIGlobalVariableExpression;
21592169

2170+
/// FIXME(#134001): This doesn't map cleanly to any single LLVM-C function.
21602171
pub fn LLVMRustDIBuilderCreateVariable<'a>(
21612172
Builder: &DIBuilder<'a>,
21622173
Tag: c_uint,
@@ -2183,6 +2194,8 @@ unsafe extern "C" {
21832194
Block: &'ll BasicBlock,
21842195
);
21852196

2197+
/// As of LLVM 18/19, the corresponding LLVM-C function is hard-coded to
2198+
/// assume a 64-bit value.
21862199
pub fn LLVMRustDIBuilderCreateEnumerator<'a>(
21872200
Builder: &DIBuilder<'a>,
21882201
Name: *const c_char,
@@ -2192,6 +2205,8 @@ unsafe extern "C" {
21922205
IsUnsigned: bool,
21932206
) -> &'a DIEnumerator;
21942207

2208+
/// As of LLVM 18/19, the corresponding LLVM-C function is hard-coded to
2209+
/// assume `IsScoped = false`, but we want to pass `true`.
21952210
pub fn LLVMRustDIBuilderCreateEnumerationType<'a>(
21962211
Builder: &DIBuilder<'a>,
21972212
Scope: &'a DIScope,
@@ -2206,6 +2221,7 @@ unsafe extern "C" {
22062221
IsScoped: bool,
22072222
) -> &'a DIType;
22082223

2224+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
22092225
pub fn LLVMRustDIBuilderCreateVariantPart<'a>(
22102226
Builder: &DIBuilder<'a>,
22112227
Scope: &'a DIScope,
@@ -2222,6 +2238,7 @@ unsafe extern "C" {
22222238
UniqueIdLen: size_t,
22232239
) -> &'a DIDerivedType;
22242240

2241+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
22252242
pub fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>(
22262243
Builder: &DIBuilder<'a>,
22272244
Scope: Option<&'a DIScope>,
@@ -2230,13 +2247,15 @@ unsafe extern "C" {
22302247
Ty: &'a DIType,
22312248
) -> &'a DITemplateTypeParameter;
22322249

2250+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
22332251
pub fn LLVMRustDICompositeTypeReplaceArrays<'a>(
22342252
Builder: &DIBuilder<'a>,
22352253
CompositeType: &'a DIType,
22362254
Elements: Option<&'a DIArray>,
22372255
Params: Option<&'a DIArray>,
22382256
);
22392257

2258+
/// As of LLVM 18/19, there is no corresponding LLVM-C function.
22402259
pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
22412260
Location: &'a DILocation,
22422261
BD: c_uint,

0 commit comments

Comments
 (0)