[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 17 00:39:22 PST 2021


shchenz added a comment.

> Oh, I see, that comment was about using an out parameter for "Lo"?

Yeah, that is for `Lo` parameter.

> What if the function created and returned Hi rather than taking it as an argument?

Good idea, then we have a unified behaviour for `Hi` and `Lo` label. I will update patch D96409 <https://reviews.llvm.org/D96409> later.



================
Comment at: llvm/lib/MC/MCDwarf.cpp:500-503
+  emitAbsValue(
+      *MCOS,
+      makeEndMinusStartExpr(context, *SymWithoutUnitLength, *ProEndSym, 0),
+      OffsetSize);
----------------
ikudrin wrote:
> What about using just `emitAbsoluteSymbolDiff()` here?
Yeah, good idea. When I updated the patch, I found the case in D95518 has a strange label defination `(L..tmp5-L..debug_line_1)-0`. `-0` is meaningless. But I found there are many places in `MCDwarf.cpp` using `makeEndMinusStartExpr(, , , 0)`, so I was lazy to use the same way:) and thinking we can make an improvement patch later.

I will fix this place in next update.


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