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

Luke Drummond via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 08:19:04 PDT 2021


ldrumm added a comment.

> Why would code handling llvm.dbg.cu need to add an if statement? I'd expect it to walk through whatever's in llvm.dbg.cu and if there's nothing it'd be fine with that?

Because 3 lines later we have `  auto *NMD = NewModule->getOrInsertNamedMetadata("llvm.dbg.cu");`
In the case that the source module has no `llvm.dbu.cu` the target module ends up with on without operands. This is both illegal and a pain to deal with in user code.


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

https://reviews.llvm.org/D99334



More information about the llvm-commits mailing list