[PATCH] D43803: [RFC] Handle qualified unnamed types in CodeView printer

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 10:49:01 PST 2018


smeenai added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1817-1818
   }
   // An unnamed member must represent a nested struct or union. Add all the
   // indirect fields to the current record.
   assert((DDTy->getOffsetInBits() % 8) == 0 && "Unnamed bitfield member!");
----------------
rnk wrote:
> This seems like a flawed assumption. Other frontends might want to emit unnamed fields that aren't nested structs. I'd rather rewrite this logic so that it's a pattern match of an unnamed DICompositeType that is possibly wrapped in qualifier types. Basically, I'd just make the DICompositeType cast below a dyn_cast, and if it fails, drop the unnamed member. I have a feeling that VS and windbg will not cope with unnamed members.
Thanks. Is there a better way to do that pattern match than what I have here? (In particular, should I be concerned about preserving the qualifiers in the nested types, as opposed to just dropping them, which I'm doing right now?)


Repository:
  rL LLVM

https://reviews.llvm.org/D43803





More information about the llvm-commits mailing list