[PATCH] D95998: [Debug-Info] [NFC] use emitDwarfUnitLength to handle debug line section unit length field

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 01:02:39 PST 2021


shchenz added a comment.

In D95998#2553412 <https://reviews.llvm.org/D95998#2553412>, @ikudrin wrote:

> The idea was to remove the `Lo` argument from `MCStreamer::emitDwarfUnitLength(Hi, Lo, Comment)` so that it becomes just `MCStreamer::emitDwarfUnitLength(Hi, Comment)`. A temporary symbol can be created and emitted inside the method. And that should be a separate NFC patch.

We need to differentiate the temp symbol names for different debug sections like debug info, debug pubnames, debug line to make a more readable assembly output. That's the first reason I put the temp symbol created outside.

Another reason is for the debug line section, we need the temp symbol to generate the debug line prologue length in the following logics of function `MCDwarfLineTableHeader::Emit`. so to avoid returning the temp symbol to its caller (it is only used for debug line, but not used by other callers of `emitDwarfUnitLength`), I use the way to create the temp symbol in the caller site and to emit the temp symbol in callee site.

@ikudrin what do you think?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95998/new/

https://reviews.llvm.org/D95998



More information about the llvm-commits mailing list