[PATCH] D86044: [llvm-dwarfdump][test] Add a --statistics test for a DW_AT_artificial variable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 11:35:38 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/statistics.ll:26-29
+; struct T {
+;   void *address();
+; };
+; void *T::address() { return this; }
----------------
dblaikie wrote:
> Does this function need a return value or would a void-returning member function suffice?
`void T::address() { (void)this; }` works as well.

`void T::address() { this; }` (-Wunused-variable) does not generate `this`

It is also interesting that the !dbg metadata on `ret void, !dbg !17` is important. Dropping the metadata will cause the absence of `this` as a DW_TAG_formal_parameter (I think it has something to do with `DW_AT_location (DW_OP_fbreg -8)`)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86044



More information about the llvm-commits mailing list