mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
A fix for PR21176.
DW_OP_const <const> doesn't describe a constant value, but a value at a constant address. The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value. Added DW_OP_stack_value to the stack. Marked incorrect-variable-debugloc1.ll to xfail for PowerPC64, while the the failure (PR21881) is being investigated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1722,6 +1722,18 @@ void DwarfDebug::emitDebugLocValue(ByteStreamer &Streamer,
|
||||
Streamer.EmitInt8(dwarf::DW_OP_constu, "DW_OP_constu");
|
||||
Streamer.EmitULEB128(Value.getInt());
|
||||
}
|
||||
// The proper way to describe a constant value is
|
||||
// DW_OP_constu <const>, DW_OP_stack_value.
|
||||
// Unfortunately, DW_OP_stack_value was not available until DWARF-4,
|
||||
// so we will continue to generate DW_OP_constu <const> for DWARF-2
|
||||
// and DWARF-3. Technically, this is incorrect since DW_OP_const <const>
|
||||
// actually describes a value at a constant addess, not a constant value.
|
||||
// However, in the past there was no better way to describe a constant
|
||||
// value, so the producers and consumers started to rely on heuristics
|
||||
// to disambiguate the value vs. location status of the expression.
|
||||
// See PR21176 for more details.
|
||||
if (getDwarfVersion() >= 4)
|
||||
Streamer.EmitInt8(dwarf::DW_OP_stack_value, "DW_OP_stack_value");
|
||||
} else if (Value.isLocation()) {
|
||||
MachineLocation Loc = Value.getLoc();
|
||||
DIExpression Expr = Value.getExpression();
|
||||
|
Reference in New Issue
Block a user