This is the matching change for the data structure name changes for the

functional change in r147860 to use DW_TAG_label's instead TAG_subprogram's.
This only changes names and updates comments.  No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147877 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin Enderby 2012-01-10 21:12:34 +00:00
parent f1f16c832f
commit 11c2defa91
4 changed files with 33 additions and 35 deletions

View File

@ -111,9 +111,9 @@ namespace llvm {
/// Symbols created for the start and end of this section. /// Symbols created for the start and end of this section.
MCSymbol *GenDwarfSectionStartSym, *GenDwarfSectionEndSym; MCSymbol *GenDwarfSectionStartSym, *GenDwarfSectionEndSym;
/// The information gathered from labels that will have dwarf subprogram /// The information gathered from labels that will have dwarf label
/// entries when generating dwarf assembly source files. /// entries when generating dwarf assembly source files.
std::vector<const MCGenDwarfSubprogramEntry *> MCGenDwarfSubprogramEntries; std::vector<const MCGenDwarfLabelEntry *> MCGenDwarfLabelEntries;
/// The string to embed in the debug information for the compile unit, if /// The string to embed in the debug information for the compile unit, if
/// non-empty. /// non-empty.
@ -287,12 +287,12 @@ namespace llvm {
void setGenDwarfSectionEndSym(MCSymbol *Sym) { void setGenDwarfSectionEndSym(MCSymbol *Sym) {
GenDwarfSectionEndSym = Sym; GenDwarfSectionEndSym = Sym;
} }
const std::vector<const MCGenDwarfSubprogramEntry *> const std::vector<const MCGenDwarfLabelEntry *>
&getMCGenDwarfSubprogramEntries() const { &getMCGenDwarfLabelEntries() const {
return MCGenDwarfSubprogramEntries; return MCGenDwarfLabelEntries;
} }
void addMCGenDwarfSubprogramEntry(const MCGenDwarfSubprogramEntry *E) { void addMCGenDwarfLabelEntry(const MCGenDwarfLabelEntry *E) {
MCGenDwarfSubprogramEntries.push_back(E); MCGenDwarfLabelEntries.push_back(E);
} }
void setDwarfDebugFlags(StringRef S) { DwarfDebugFlags = S; } void setDwarfDebugFlags(StringRef S) { DwarfDebugFlags = S; }

View File

@ -239,8 +239,8 @@ namespace llvm {
}; };
// When generating dwarf for assembly source files this is the info that is // When generating dwarf for assembly source files this is the info that is
// needed to be gathered for each symbol that will have a dwarf2_subprogram. // needed to be gathered for each symbol that will have a dwarf label.
class MCGenDwarfSubprogramEntry { class MCGenDwarfLabelEntry {
private: private:
// Name of the symbol without a leading underbar, if any. // Name of the symbol without a leading underbar, if any.
StringRef Name; StringRef Name;
@ -248,14 +248,12 @@ namespace llvm {
unsigned FileNumber; unsigned FileNumber;
// The line number this symbol is at. // The line number this symbol is at.
unsigned LineNumber; unsigned LineNumber;
// The low_pc for the dwarf2_subprogram is taken from this symbol. The // The low_pc for the dwarf label is taken from this symbol.
// high_pc is taken from the next symbol's value or the end of the section
// for the last symbol
MCSymbol *Label; MCSymbol *Label;
public: public:
MCGenDwarfSubprogramEntry(StringRef name, unsigned fileNumber, MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber,
unsigned lineNumber, MCSymbol *label) : unsigned lineNumber, MCSymbol *label) :
Name(name), FileNumber(fileNumber), LineNumber(lineNumber), Label(label){} Name(name), FileNumber(fileNumber), LineNumber(lineNumber), Label(label){}
StringRef getName() const { return Name; } StringRef getName() const { return Name; }

View File

@ -631,13 +631,13 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS) {
// Third part: the list of label DIEs. // Third part: the list of label DIEs.
// Loop on saved info for dwarf subprograms and create the DIEs for them. // Loop on saved info for dwarf labels and create the DIEs for them.
const std::vector<const MCGenDwarfSubprogramEntry *> &Entries = const std::vector<const MCGenDwarfLabelEntry *> &Entries =
MCOS->getContext().getMCGenDwarfSubprogramEntries(); MCOS->getContext().getMCGenDwarfLabelEntries();
for (std::vector<const MCGenDwarfSubprogramEntry *>::const_iterator it = for (std::vector<const MCGenDwarfLabelEntry *>::const_iterator it =
Entries.begin(), ie = Entries.end(); it != ie; Entries.begin(), ie = Entries.end(); it != ie;
++it) { ++it) {
const MCGenDwarfSubprogramEntry *Entry = *it; const MCGenDwarfLabelEntry *Entry = *it;
// The DW_TAG_label DIE abbrev (2). // The DW_TAG_label DIE abbrev (2).
MCOS->EmitULEB128IntValue(2); MCOS->EmitULEB128IntValue(2);
@ -666,12 +666,12 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS) {
// Add the NULL DIE terminating the DW_TAG_unspecified_parameters DIE's. // Add the NULL DIE terminating the DW_TAG_unspecified_parameters DIE's.
MCOS->EmitIntValue(0, 1); MCOS->EmitIntValue(0, 1);
} }
// Deallocate the MCGenDwarfSubprogramEntry classes that saved away the info // Deallocate the MCGenDwarfLabelEntry classes that saved away the info
// for the dwarf subprograms. // for the dwarf labels.
for (std::vector<const MCGenDwarfSubprogramEntry *>::const_iterator it = for (std::vector<const MCGenDwarfLabelEntry *>::const_iterator it =
Entries.begin(), ie = Entries.end(); it != ie; Entries.begin(), ie = Entries.end(); it != ie;
++it) { ++it) {
const MCGenDwarfSubprogramEntry *Entry = *it; const MCGenDwarfLabelEntry *Entry = *it;
delete Entry; delete Entry;
} }
@ -711,11 +711,11 @@ void MCGenDwarfInfo::Emit(MCStreamer *MCOS) {
// When generating dwarf for assembly source files this is called when symbol // When generating dwarf for assembly source files this is called when symbol
// for a label is created. If this symbol is not a temporary and is in the // for a label is created. If this symbol is not a temporary and is in the
// section that dwarf is being generated for, save the needed info to create // section that dwarf is being generated for, save the needed info to create
// a dwarf subprogram. // a dwarf label.
// //
void MCGenDwarfSubprogramEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
SourceMgr &SrcMgr, SMLoc &Loc) { SourceMgr &SrcMgr, SMLoc &Loc) {
// We won't create dwarf subprogram's for temporary symbols or symbols not in // We won't create dwarf label's for temporary symbols or symbols not in
// the default text. // the default text.
if (Symbol->isTemporary()) if (Symbol->isTemporary())
return; return;
@ -723,17 +723,17 @@ void MCGenDwarfSubprogramEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
if (context.getGenDwarfSection() != MCOS->getCurrentSection()) if (context.getGenDwarfSection() != MCOS->getCurrentSection())
return; return;
// The dwarf subprogram's name does not have the symbol name's leading // The dwarf label's name does not have the symbol name's leading
// underbar if any. // underbar if any.
StringRef Name = Symbol->getName(); StringRef Name = Symbol->getName();
if (Name.startswith("_")) if (Name.startswith("_"))
Name = Name.substr(1, Name.size()-1); Name = Name.substr(1, Name.size()-1);
// Get the dwarf file number to be used for the dwarf subprogram. // Get the dwarf file number to be used for the dwarf label.
unsigned FileNumber = context.getGenDwarfFileNumber(); unsigned FileNumber = context.getGenDwarfFileNumber();
// Finding the line number is the expensive part which is why we just don't // Finding the line number is the expensive part which is why we just don't
// pass it in as for some symbols we won't create a dwarf subprogram. // pass it in as for some symbols we won't create a dwarf label.
int CurBuffer = SrcMgr.FindBufferContainingLoc(Loc); int CurBuffer = SrcMgr.FindBufferContainingLoc(Loc);
unsigned LineNumber = SrcMgr.FindLineNumber(Loc, CurBuffer); unsigned LineNumber = SrcMgr.FindLineNumber(Loc, CurBuffer);
@ -745,9 +745,9 @@ void MCGenDwarfSubprogramEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
MCOS->EmitLabel(Label); MCOS->EmitLabel(Label);
// Create and entry for the info and add it to the other entries. // Create and entry for the info and add it to the other entries.
MCGenDwarfSubprogramEntry *Entry = MCGenDwarfLabelEntry *Entry =
new MCGenDwarfSubprogramEntry(Name, FileNumber, LineNumber, Label); new MCGenDwarfLabelEntry(Name, FileNumber, LineNumber, Label);
MCOS->getContext().addMCGenDwarfSubprogramEntry(Entry); MCOS->getContext().addMCGenDwarfLabelEntry(Entry);
} }
static int getDataAlignmentFactor(MCStreamer &streamer) { static int getDataAlignmentFactor(MCStreamer &streamer) {

View File

@ -1076,10 +1076,10 @@ bool AsmParser::ParseStatement() {
Out.EmitLabel(Sym); Out.EmitLabel(Sym);
// If we are generating dwarf for assembly source files then gather the // If we are generating dwarf for assembly source files then gather the
// info to make a dwarf subprogram entry for this label if needed. // info to make a dwarf label entry for this label if needed.
if (getContext().getGenDwarfForAssembly()) if (getContext().getGenDwarfForAssembly())
MCGenDwarfSubprogramEntry::Make(Sym, &getStreamer(), getSourceManager(), MCGenDwarfLabelEntry::Make(Sym, &getStreamer(), getSourceManager(),
IDLoc); IDLoc);
// Consume any end of statement token, if present, to avoid spurious // Consume any end of statement token, if present, to avoid spurious
// AddBlankLine calls(). // AddBlankLine calls().