summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2016-12-14 00:27:35 +0000
committerPaul Robinson <paul.robinson@sony.com>2016-12-14 00:27:35 +0000
commit8fec3da00ce186f06dbbf08ff4f38cd90f079308 (patch)
treec35f19da6c8e92727dc2182e93ac9d17d3ad992a /llvm/lib/CodeGen
parentf6b069c7db5f86e73d997b212da8dfa5c32b822f (diff)
downloadbcm5719-llvm-8fec3da00ce186f06dbbf08ff4f38cd90f079308.tar.gz
bcm5719-llvm-8fec3da00ce186f06dbbf08ff4f38cd90f079308.zip
[DWARF] Preserve column number when emitting 'line 0' record
Follow-up to r289256, address a FIXME to avoid resetting the column number. This reduced .debug_line by 2.6% in a RelWithDebInfo self-build of clang. llvm-svn: 289620
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 4ebc54555cc..3b67aa024f0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1048,11 +1048,16 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
// location from the physically previous (maybe unrelated) block.
if (UnknownLocations == Enable || PrevLabel ||
(PrevInstBB && PrevInstBB != MI->getParent())) {
- // Preserve the file number, if we can, to save space in the line table.
+ // Preserve the file and column numbers, if we can, to save space in
+ // the encoded line table.
// Do not update PrevInstLoc, it remembers the last non-0 line.
- // FIXME: Also preserve the column number, to save more space?
- const MDNode *Scope = PrevInstLoc ? PrevInstLoc.getScope() : nullptr;
- recordSourceLine(0, 0, Scope, 0);
+ const MDNode *Scope = nullptr;
+ unsigned Column = 0;
+ if (PrevInstLoc) {
+ Scope = PrevInstLoc.getScope();
+ Column = PrevInstLoc.getCol();
+ }
+ recordSourceLine(/*Line=*/0, Column, Scope, /*Flags=*/0);
}
return;
}
OpenPOWER on IntegriCloud