another patch.
This lets us parse a bit more of the gcc 4.5 output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975
91177308-0d34-0410-b5e6-
96231b3b80d8
/// is assembled an entry in the line number table with this information and
/// the address of the instruction will be created.
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column,
/// is assembled an entry in the line number table with this information and
/// the address of the instruction will be created.
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column,
- unsigned Flags, unsigned Isa) {
+ unsigned Flags, unsigned Isa,
+ unsigned Discriminator) {
CurrentDwarfLoc.setFileNum(FileNum);
CurrentDwarfLoc.setLine(Line);
CurrentDwarfLoc.setColumn(Column);
CurrentDwarfLoc.setFlags(Flags);
CurrentDwarfLoc.setIsa(Isa);
CurrentDwarfLoc.setFileNum(FileNum);
CurrentDwarfLoc.setLine(Line);
CurrentDwarfLoc.setColumn(Column);
CurrentDwarfLoc.setFlags(Flags);
CurrentDwarfLoc.setIsa(Isa);
+ CurrentDwarfLoc.setDiscriminator(Discriminator);
DwarfLocSeen = true;
}
void ClearDwarfLocSeen() { DwarfLocSeen = false; }
DwarfLocSeen = true;
}
void ClearDwarfLocSeen() { DwarfLocSeen = false; }
unsigned Flags;
// Isa
unsigned Isa;
unsigned Flags;
// Isa
unsigned Isa;
+ // Discriminator
+ unsigned Discriminator;
// Flag that indicates the initial value of the is_stmt_start flag.
#define DWARF2_LINE_DEFAULT_IS_STMT 1
// Flag that indicates the initial value of the is_stmt_start flag.
#define DWARF2_LINE_DEFAULT_IS_STMT 1
friend class MCContext;
friend class MCLineEntry;
MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags,
friend class MCContext;
friend class MCLineEntry;
MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags,
- unsigned isa)
- : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa) {}
+ unsigned isa, unsigned discriminator)
+ : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa),
+ Discriminator(discriminator) {}
// Allow the default copy constructor and assignment operator to be used
// for an MCDwarfLoc object.
// Allow the default copy constructor and assignment operator to be used
// for an MCDwarfLoc object.
/// getIsa - Get the Isa of this MCDwarfLoc.
unsigned getIsa() { return Isa; }
/// getIsa - Get the Isa of this MCDwarfLoc.
unsigned getIsa() { return Isa; }
+ /// getDiscriminator - Get the Discriminator of this MCDwarfLoc.
+ unsigned getDiscriminator() { return Discriminator; }
+
/// setFileNum - Set the FileNum of this MCDwarfLoc.
void setFileNum(unsigned fileNum) { FileNum = fileNum; }
/// setFileNum - Set the FileNum of this MCDwarfLoc.
void setFileNum(unsigned fileNum) { FileNum = fileNum; }
/// setIsa - Set the Isa of this MCDwarfLoc.
void setIsa(unsigned isa) { Isa = isa; }
/// setIsa - Set the Isa of this MCDwarfLoc.
void setIsa(unsigned isa) { Isa = isa; }
+
+ /// setDiscriminator - Set the Discriminator of this MCDwarfLoc.
+ void setDiscriminator(unsigned discriminator) {
+ Discriminator = discriminator;
+ }
};
/// MCLineEntry - Instances of this class represent the line information for
};
/// MCLineEntry - Instances of this class represent the line information for
MCContext::MCContext(const MCAsmInfo &mai) : MAI(mai), NextUniqueID(0),
MCContext::MCContext(const MCAsmInfo &mai) : MAI(mai), NextUniqueID(0),
- CurrentDwarfLoc(0,0,0,0,0) {
+ CurrentDwarfLoc(0,0,0,0,0,0) {
MachOUniquingMap = 0;
ELFUniquingMap = 0;
COFFUniquingMap = 0;
MachOUniquingMap = 0;
ELFUniquingMap = 0;
COFFUniquingMap = 0;
unsigned Flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0;
unsigned Isa = 0;
unsigned Flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0;
unsigned Isa = 0;
+ int64_t Discriminator = 0;
if (getLexer().isNot(AsmToken::EndOfStatement)) {
for (;;) {
if (getLexer().is(AsmToken::EndOfStatement))
if (getLexer().isNot(AsmToken::EndOfStatement)) {
for (;;) {
if (getLexer().is(AsmToken::EndOfStatement))
return Error(Loc, "isa number not a constant value");
}
}
return Error(Loc, "isa number not a constant value");
}
}
+ else if (Name == "discriminator") {
+ if (getParser().ParseAbsoluteExpression(Discriminator))
+ return true;
+ }
else {
return Error(Loc, "unknown sub-directive in '.loc' directive");
}
else {
return Error(Loc, "unknown sub-directive in '.loc' directive");
}
- getContext().setCurrentDwarfLoc(FileNumber, LineNumber, ColumnPos, Flags,Isa);
+ getContext().setCurrentDwarfLoc(FileNumber, LineNumber, ColumnPos, Flags,
+ Isa, Discriminator);
.loc 1
.loc 1 2
.loc 1 2 3
.loc 1
.loc 1 2
.loc 1 2 3
+ .loc 1 2 discriminator 1