[PATCH] D96212: [Verifier] Allow DW_TAG_class_type/DW_TAG_union_type to have no filename

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 6 13:37:25 PST 2021


MaskRay created this revision.
MaskRay added reviewers: debug-info, aprantl, dblaikie, jdoerfert, protze.joachim.
Herald added subscribers: dexonsmith, hiraditya.
MaskRay requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

`clang/lib/CodeGen/CGOpenMPRuntime.cpp` synthesized union
(`distinct !DICompositeType(tag: DW_TAG_union_type, name: "kmp_cmplrdata_t", size: 64, elements: <0x62b690>)`)
does not have meaningful filename/line number.

D94735 <https://reviews.llvm.org/D94735> dropped the previously arbitrary and untested filename/line from the
union and caused a verifier error here.

This fixes `check-libarcher` failures.

Intended for main & release/12.x


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96212

Files:
  llvm/lib/IR/Verifier.cpp


Index: llvm/lib/IR/Verifier.cpp
===================================================================
--- llvm/lib/IR/Verifier.cpp
+++ llvm/lib/IR/Verifier.cpp
@@ -1070,12 +1070,6 @@
   if (auto *Params = N.getRawTemplateParams())
     visitTemplateParams(N, *Params);
 
-  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());
-  }
-
   if (auto *D = N.getRawDiscriminator()) {
     AssertDI(isa<DIDerivedType>(D) && N.getTag() == dwarf::DW_TAG_variant_part,
              "discriminator can only appear on variant part");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96212.321962.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210206/ad4e47be/attachment.bin>


More information about the llvm-commits mailing list