[llvm-commits] [llvm] r118914 - /llvm/trunk/lib/MC/MCDwarf.cpp
Rafael Espindola
rafael.espindola at gmail.com
Fri Nov 12 10:41:26 PST 2010
Author: rafael
Date: Fri Nov 12 12:41:26 2010
New Revision: 118914
URL: http://llvm.org/viewvc/llvm-project?rev=118914&view=rev
Log:
Remove what looks like dead code in the production of debug lines.
We only produce debug line information if we have seen a line directive, so
this code is dead. Also, if we want to be bug by bug compatible with
gas and sometimes produce "empty" .debug_line sections, this will
match the content produced by gas.
Modified:
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=118914&r1=118913&r2=118914&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Fri Nov 12 12:41:26 2010
@@ -135,7 +135,7 @@
// This emits the Dwarf line table for the specified section from the entries
// in the LineSection.
//
-static inline bool EmitDwarfLineTable(MCObjectStreamer *MCOS,
+static inline void EmitDwarfLineTable(MCObjectStreamer *MCOS,
const MCSection *Section,
MCLineSection *LineSection,
const MCSection *DwarfLineSection) {
@@ -144,7 +144,6 @@
unsigned Column = 0;
unsigned Flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0;
unsigned Isa = 0;
- bool EmittedLineTable = false;
MCSymbol *LastLabel = NULL;
MCSectionData &DLS =
MCOS->getAssembler().getOrCreateSectionData(*DwarfLineSection);
@@ -202,7 +201,6 @@
LastLine = it->getLine();
LastLabel = Label;
- EmittedLineTable = true;
}
// Emit a DW_LNE_end_sequence for the end of the section.
@@ -226,8 +224,6 @@
0);
// Create a Dwarf Line fragment for the LineDelta and AddrDelta.
new MCDwarfLineAddrFragment(INT64_MAX, *AddrDelta, &DLS);
-
- return EmittedLineTable;
}
//
@@ -315,56 +311,17 @@
MCOS->EmitLabel(ProEndSym);
// Put out the line tables.
- bool EmittedLineTable = false;
DenseMap<const MCSection *, MCLineSection *> &MCLineSections =
MCOS->getContext().getMCLineSections();
for (DenseMap<const MCSection *, MCLineSection *>::iterator it =
MCLineSections.begin(), ie = MCLineSections.end(); it != ie; ++it) {
- EmittedLineTable = EmitDwarfLineTable(MCOS, it->first, it->second,
- DwarfLineSection);
+ EmitDwarfLineTable(MCOS, it->first, it->second, DwarfLineSection);
// Now delete the MCLineSections that were created in MCLineEntry::Make()
// and used to emit the line table.
delete it->second;
}
- // If there are no line tables emited then we emit:
- // The following DW_LNE_set_address sequence to set the address to zero and
- // the DW_LNE_end_sequence.
- if (EmittedLineTable == false) {
- if (MCOS->getAssembler().getBackend().getPointerSize() == 8) {
- // This is the DW_LNE_set_address sequence for 64-bit code.
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(9, 1);
- MCOS->EmitIntValue(2, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- }
- else {
- // This is the DW_LNE_set_address sequence for 32-bit code.
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(5, 1);
- MCOS->EmitIntValue(2, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- MCOS->EmitIntValue(0, 1);
- }
-
- // Lastly emit the DW_LNE_end_sequence which consists of 3 bytes '00 01 01'
- // (00 is the code for extended opcodes, followed by a ULEB128 length of the
- // extended opcode (01), and the DW_LNE_end_sequence (01).
- MCOS->EmitIntValue(0, 1); // DW_LNS_extended_op
- MCOS->EmitIntValue(1, 1); // ULEB128 length of the extended opcode
- MCOS->EmitIntValue(1, 1); // DW_LNE_end_sequence
- }
-
// This is the end of the section, so set the value of the symbol at the end
// of this section (that was used in a previous expression).
MCOS->EmitLabel(LineEndSym);
More information about the llvm-commits
mailing list