Support DWARF discriminators in object streamer.

Summary:
This adds support for emitting DWARF path discriminator values in
the object streamer. It also changes the DWARF dumper to show
discriminator values in the line table output.

Reviewers: echristo

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2794

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Diego Novillo
2014-02-14 19:27:53 +00:00
parent fba2a769a1
commit 837c54fa7b
8 changed files with 96 additions and 16 deletions

View File

@@ -62,6 +62,7 @@ void DWARFDebugLine::Row::reset(bool default_is_stmt) {
Column = 0;
File = 1;
Isa = 0;
Discriminator = 0;
IsStmt = default_is_stmt;
BasicBlock = false;
EndSequence = false;
@@ -71,7 +72,7 @@ void DWARFDebugLine::Row::reset(bool default_is_stmt) {
void DWARFDebugLine::Row::dump(raw_ostream &OS) const {
OS << format("0x%16.16" PRIx64 " %6u %6u", Address, Line, Column)
<< format(" %6u %3u ", File, Isa)
<< format(" %6u %3u %13u ", File, Isa, Discriminator)
<< (IsStmt ? " is_stmt" : "")
<< (BasicBlock ? " basic_block" : "")
<< (PrologueEnd ? " prologue_end" : "")
@@ -85,8 +86,9 @@ void DWARFDebugLine::LineTable::dump(raw_ostream &OS) const {
OS << '\n';
if (!Rows.empty()) {
OS << "Address Line Column File ISA Flags\n"
<< "------------------ ------ ------ ------ --- -------------\n";
OS << "Address Line Column File ISA Discriminator Flags\n"
<< "------------------ ------ ------ ------ --- ------------- "
"-------------\n";
for (std::vector<Row>::const_iterator pos = Rows.begin(),
end = Rows.end(); pos != end; ++pos)
pos->dump(OS);
@@ -311,6 +313,10 @@ DWARFDebugLine::parseStatementTable(DataExtractor debug_line_data,
}
break;
case DW_LNE_set_discriminator:
state.Discriminator = debug_line_data.getULEB128(offset_ptr);
break;
default:
// Length doesn't include the zero opcode byte or the length itself, but
// it does include the sub_opcode, so we have to adjust for that below