[PATCH] D94735: CGDebugInfo CreatedLimitedType: Drop file/line for RecordType with invalid location

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 6 13:29:55 PST 2021


MaskRay added a subscriber: ABataev.
MaskRay added a comment.

Perhaps we should just drop `llvm/IR/Verifier.cpp:1075` (which is not tested):

  if (N.getTag() == dwarf::DW_TAG_class_type ||
      N.getTag() == dwarf::DW_TAG_union_type) {
    AssertDI(N.getFile() && !N.getFile()->getFilename().empty(),
             "class/union requires a filename", &N, N.getFile());
  }

This patch is about a clang synthesized `struct`. `clang/lib/CodeGen/CGOpenMPRuntime.cpp:3463` has a synthesized `union` (`distinct !DICompositeType(tag: DW_TAG_union_type, name: "kmp_cmplrdata_t", size: 64, elements: <0x62b690>)`, which has no filename/line with this patch). It does not make sense to attach the current filename/line (which can be entirely irrelevant) to the synthesized `union`. @ABataev @jdoerfert ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94735



More information about the cfe-commits mailing list