llvm-project/llvm/lib/CodeGen/AsmPrinter
Bjorn Pettersson 5ffb1c0ff0 [DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.

The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.

Example (using ARM as target):
Instead of

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @ DW_OP_piece
  .byte 147                     @ 8
  .byte 8                       @ sub-register DW_OP_regx
  .byte 144                     @ 257
  .byte 129                     @ DW_OP_piece
  .byte 2                       @ 8
  .byte 147                     @
  .byte 8                       @

we now get

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8
  .byte 144                     @ sub-register DW_OP_regx
  .byte 129                     @ 257
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8

Reviewers: JDevlieghere, rnk, aprantl

Reviewed By: aprantl

Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere

Differential Revision: https://reviews.llvm.org/D41763

llvm-svn: 321907
2018-01-05 22:20:30 +00:00
..
ARMException.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
AddressPool.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
AddressPool.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
AsmPrinter.cpp Silence a bunch of implicit fallthrough warnings 2017-12-19 22:05:25 +00:00
AsmPrinterDwarf.cpp Remove redundant includes from lib/CodeGen. 2017-12-13 21:30:47 +00:00
AsmPrinterHandler.h
AsmPrinterInlineAsm.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
ByteStreamer.h [DebugInfo] Align comments in debug_loc section 2018-01-05 22:20:30 +00:00
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
CodeViewDebug.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
CodeViewDebug.h [CodeView] Teach clang to emit the .debug$H COFF section. 2017-12-13 22:33:58 +00:00
DIE.cpp Recommit "[DWARFv5] Dump an MD5 checksum in the line-table header." 2017-12-18 19:08:35 +00:00
DIEHash.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DIEHash.h DebugInfo: Include .dwo file name when hashing multiple CUs in a single file 2017-05-29 06:32:34 +00:00
DIEHashAttributes.def Fix DIEHash refactoring that dropped the DW_AT_name from the hash 2017-05-23 18:36:07 +00:00
DbgValueHistoryCalculator.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
DbgValueHistoryCalculator.h Add a few missing headers for modularization/IWYU/etc 2017-10-27 22:12:46 +00:00
DebugHandlerBase.cpp Revert "Fix faulty assertion in debug info" 2017-12-19 23:34:37 +00:00
DebugHandlerBase.h [codeview] Generalize DIExpression parsing to handle load chains 2017-08-31 15:56:49 +00:00
DebugLocEntry.h Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
DebugLocStream.cpp
DebugLocStream.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DwarfAccelTable.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfAccelTable.h llvm-dwarfdump: implement --find for .apple_names 2017-09-28 18:10:52 +00:00
DwarfCFIException.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
DwarfCompileUnit.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
DwarfCompileUnit.h IR: Represent -ggnu-pubnames with a flag on the DICompileUnit. 2017-09-12 21:50:41 +00:00
DwarfDebug.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
DwarfDebug.h [DebugInfo] Fix potential CU mismatch for SubprogramScopeDIEs. 2017-11-15 10:57:05 +00:00
DwarfException.h Emit .cfi_sections before the first .cfi_startproc 2017-01-02 18:05:27 +00:00
DwarfExpression.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
DwarfExpression.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfFile.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfFile.h Modularize: Include some required headers 2017-11-03 20:24:19 +00:00
DwarfStringPool.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfStringPool.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfUnit.cpp Debug Info: Support DW_AT_calling_convention on composite types. 2018-01-05 01:13:37 +00:00
DwarfUnit.h [DWARF] Move a couple of member functions to the DWARFUnit baseclass. NFC. 2017-06-30 00:27:45 +00:00
EHStreamer.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
EHStreamer.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-10 22:33:29 +00:00
ErlangGCPrinter.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
LLVMBuild.txt Update libdeps to add BinaryFormat, introduced in r304864. 2017-06-07 04:48:49 +00:00
OcamlGCPrinter.cpp Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
WinException.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
WinException.h [WinEH] Don't assume endFunction is called while in .text 2016-12-28 19:05:12 +00:00