about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo/metadata
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-01-05 18:35:04 -0500
committerGitHub <noreply@github.com>2025-01-05 18:35:04 -0500
commitb9f971a52cad750f5b2a554bf4b3f25bcf64cbdb (patch)
tree5952d7809b4bdf733b7895bf0309f1623fdc3c95 /compiler/rustc_codegen_llvm/src/debuginfo/metadata
parentb3b368a1833a26f5d48f51c45159f46e6cd01711 (diff)
parentf50721ebadf8e2c2940bc9334926dc20f87ff22d (diff)
downloadrust-b9f971a52cad750f5b2a554bf4b3f25bcf64cbdb.tar.gz
rust-b9f971a52cad750f5b2a554bf4b3f25bcf64cbdb.zip
Rollup merge of #135115 - Zalathar:dwarf-const, r=workingjubilee
cg_llvm: Use constants for DWARF opcodes, instead of FFI calls

Split off from #134009 to incorporate feedback from https://github.com/rust-lang/rust/pull/134009#discussion_r1903133906.

Most of the constant values now come from gimli, which is already a compiler dependency.

I noticed that `DW_OP_LLVM_fragment` is an LLVM detail that is not defined by DWARF and could hypothetically change, so I added a static assertion on the C++ side to detect that if it ever happens.

r? workingjubilee
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/metadata')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs
index dd83714614d..a72e205c9b2 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs
@@ -12,12 +12,13 @@ use rustc_middle::ty::{self, AdtDef, CoroutineArgs, CoroutineArgsExt, Ty};
 use smallvec::smallvec;
 
 use crate::common::{AsCCharPtr, CodegenCx};
+use crate::debuginfo::dwarf_const::DW_TAG_const_type;
 use crate::debuginfo::metadata::enums::DiscrResult;
 use crate::debuginfo::metadata::type_map::{self, Stub, UniqueTypeId};
 use crate::debuginfo::metadata::{
-    DINodeCreationResult, DW_TAG_const_type, NO_GENERICS, NO_SCOPE_METADATA, SmallVec,
-    UNKNOWN_LINE_NUMBER, build_field_di_node, file_metadata, file_metadata_from_def_id,
-    size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags,
+    DINodeCreationResult, NO_GENERICS, NO_SCOPE_METADATA, SmallVec, UNKNOWN_LINE_NUMBER,
+    build_field_di_node, file_metadata, file_metadata_from_def_id, size_and_align_of, type_di_node,
+    unknown_file_metadata, visibility_di_flags,
 };
 use crate::debuginfo::utils::DIB;
 use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};