Skip to content

Commit 9b6c780

Browse files
committed
Explain why the DW_TAG_* constants remain as-is for now
1 parent 7bd31e2 commit 9b6c780

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ mod utils;
4848
use self::create_scope_map::compute_mir_scopes;
4949
pub(crate) use self::metadata::build_global_var_di_node;
5050

51+
// FIXME(Zalathar): These `DW_TAG_*` constants are fake values that were
52+
// removed from LLVM in 2015, and are only used by our own `RustWrapper.cpp`
53+
// to decide which C++ API to call. Instead, we should just have two separate
54+
// FFI functions and choose the correct one on the Rust side.
5155
#[allow(non_upper_case_globals)]
5256
const DW_TAG_auto_variable: c_uint = 0x100;
5357
#[allow(non_upper_case_globals)]

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ using namespace llvm::object;
5656

5757
// This opcode is an LLVM detail that could hypothetically change, so verify
5858
// that the hard-coded value in `dwarf_const.rs` still agrees with LLVM.
59-
static_assert(
60-
dwarf::DW_OP_LLVM_fragment == 0x1000,
61-
"DW_OP_LLVM_fragment has changed from the value used by Rust-side code");
59+
static_assert(dwarf::DW_OP_LLVM_fragment == 0x1000);
6260

6361
// LLVMAtomicOrdering is already an enum - don't create another
6462
// one.

0 commit comments

Comments
 (0)