Skip to content

Commit 00f11a4

Browse files
committed
[DWARFLinker] Use different invalid addresses to distinguish reasons why DW_AT_LLVM_stmt_sequence is invalid.
1 parent 9320d1d commit 00f11a4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include "llvm/DebugInfo/DWARF/DWARFDebugMacro.h"
2424
#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
2525
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
26+
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
2627
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
2728
#include "llvm/DebugInfo/DWARF/DWARFSection.h"
2829
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
29-
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
3030
#include "llvm/MC/MCDwarf.h"
3131
#include "llvm/Support/DataExtractor.h"
3232
#include "llvm/Support/Error.h"
@@ -43,6 +43,12 @@ namespace llvm {
4343
using namespace dwarf_linker;
4444
using namespace dwarf_linker::classic;
4545

46+
enum InvalidStmtSeqOffset {
47+
MaxStmtSeqOffset = UINT64_MAX,
48+
OrigOffsetMissing = MaxStmtSeqOffset - 1,
49+
NewOffsetMissing = MaxStmtSeqOffset - 2,
50+
};
51+
4652
/// Hold the input and output of the debug info size in bytes.
4753
struct DebugInfoSize {
4854
uint64_t Input;
@@ -2315,7 +2321,7 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
23152321
// Some sequences are discarded by the DWARFLinker if they are invalid
23162322
// (empty).
23172323
if (OrigRowIter == SeqOffToOrigRow.end()) {
2318-
StmtSeq.set(UINT64_MAX);
2324+
StmtSeq.set(OrigOffsetMissing);
23192325
continue;
23202326
}
23212327
size_t OrigRowIndex = OrigRowIter->second;
@@ -2325,7 +2331,7 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
23252331
if (NewRowIter == OrigRowToNewRow.end()) {
23262332
// If the original row index is not found in the map, update the
23272333
// stmt_sequence attribute to the 'invalid offset' magic value.
2328-
StmtSeq.set(UINT64_MAX);
2334+
StmtSeq.set(NewOffsetMissing);
23292335
continue;
23302336
}
23312337

0 commit comments

Comments
 (0)