[PATCH] D87021: [DebugInfo] Fix emitting DWARF64 type units (10/19).

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 09:12:57 PDT 2020


dblaikie added a comment.

In D87021#2267680 <https://reviews.llvm.org/D87021#2267680>, @ikudrin wrote:

> In D87021#2267059 <https://reviews.llvm.org/D87021#2267059>, @dblaikie wrote:
>
>>> The test sources were based on some simple code, but then they were cleared as much as I could.
>>
>> You mean the IR was modified after compilation? Or that the original C source was simplified as much as possible?
>
> I removed/adjusted some attributes here and there to make the tests smaller and to express mostly what I wanted to test in each particular case. In some cases, like the test for `.debug_macro`, the source was created fully manually, based on existing tests.
>
>> Usually we don't simplify the IR - not worth it/doesn't make things especially more maintainable & more likely to introduce something that makes the IR quirky/not representative of the normal Clang generated IR.
>
> I'll see if I can update the tests in the series so that the IR is fully generated by clang.

Cool cool - use your best judgment, if the only pure Clang IR you can get is way more complicated than the hand-crafted/tweaked version (and the latter is simple enough in absolute, not just relative, terms to be fairly legible by itself) - the hand-crafted/tweaked version might be the better call. I imagine for macros this may be the case. Though I /thought/ I made it so a compile unit couldn't be emitted if it had no code/data in it - if that's the case, I'm not sure there's much simplification available in a macro test case compared to what clang would generate (& I'd use the simplest thing I can imagine to keep the CU live: "extern int i; int i;") - but if it can be done even without that, great!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87021



More information about the llvm-commits mailing list