[PATCH] D96409: [debug-info] refactor emitDwarfUnitLength

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 02:25:46 PST 2021


ikudrin added a comment.

(Moving the thread, as it's more suitable here)

In D95998#2572951 <https://reviews.llvm.org/D95998#2572951>, @dblaikie wrote:

> In D95998#2568193 <https://reviews.llvm.org/D95998#2568193>, @ikudrin wrote:
>
>> In D95998#2567599 <https://reviews.llvm.org/D95998#2567599>, @dblaikie wrote:
>>
>>> What if the function created and returned Hi rather than taking it as an argument?
>>
>> Hmm, I can't say I'm a vivid fan of this change. All methods of `MCStremer` instruct it to do something, i.e. it roles as just a performer. With this change, it now requests a caller to do some action. It looks like inverting customer vs. performer roles for this particular case.
>
> In the sense that it now requests the user emit the end label at some point?

More in the sense that it limits the flexibility of calling code without any real profit. For example, the caller now cannot create the label in advance. For instance, `Dwarf5AccelTableWriter::ContributionEnd` was initialized when the object of that class was created. Simple and solid. Now the initialization is postponed until a method of another class, `Dwarf5AccelTableWriter::Header` is called. The tracking is a bit more challenging now.

> It seems pretty tidy to me, and I'm pretty sure we follow this pattern elsewhere in the CodeGen/AsmPrinter code.

Could you get an example? I can't remember anything similar.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96409



More information about the llvm-commits mailing list