[PATCH] D99334: [TransformUtils] Don't generate invalid llvm.dbg.cu

Luke Drummond via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 04:08:10 PDT 2021


ldrumm added a comment.

In D99334#2659955 <https://reviews.llvm.org/D99334#2659955>, @dblaikie wrote:

> what was invalid about the metadata? The llvm.dbg.cu list was empty? I wonder if we should just say that's valid. It seems pretty benign/reasonable - makes it easier to write code like this, or code that, say, stripped a CU out wouldn't have to worry about removing a potentially zero-length cu list. @aprantl @JDevlieghere  ?

I don't think that's a good idea. It complexifies every piece of user code around handling "llvm.dbg.cu" if the user can't assume it actually contains what it's supposed to. Doing so is a tradeoff of one `if` statement in `CloneFunctionInto` becoming an extra `if` statement around every use of "llvm.dbg.cu". That's not a good tradeoff in terms of reliability or ergonomics.


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

https://reviews.llvm.org/D99334



More information about the llvm-commits mailing list