summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugLine.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
committerDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
commit5b5cf503b53ff103c9c0ecb735479366d79a47bf (patch)
tree59bf9ac85d7945b610df04f2c8049dde58b792c4 /llvm/lib/DebugInfo/DWARFDebugLine.cpp
parent4cdaa7d778e6b61df85a4b870b3b959cd40a5911 (diff)
downloadbcm5719-llvm-5b5cf503b53ff103c9c0ecb735479366d79a47bf.tar.gz
bcm5719-llvm-5b5cf503b53ff103c9c0ecb735479366d79a47bf.zip
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 llvm-svn: 201427
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugLine.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugLine.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARFDebugLine.cpp
index 13d09dd298b..b2c8502d57f 100644
--- a/llvm/lib/DebugInfo/DWARFDebugLine.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugLine.cpp
@@ -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
OpenPOWER on IntegriCloud