rnk added inline comments.

================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4441-4462
+  // Use global variables for enums in CodeView, use DW_TAG_enumeration_type 
for
+  // enums for non-CodeView.
   if (const auto *ECD = dyn_cast<EnumConstantDecl>(VD)) {
     const auto *ED = cast<EnumDecl>(ECD->getDeclContext());
     assert(isa<EnumType>(ED->getTypeForDecl()) && "Enum without EnumType?");
-    (void)ED;
+
+    // If not CodeView, emit DW_TAG_enumeration_type if necessary.
----------------
Please simplify the logic and make these comments more coherent and 
understandable. This return is redundant with the later return, for example.

Basically, rC361400 removed an otherwise unused call to getOrCreateType. 
getOrCreateType happens to have the side effect of recording all enum types on 
the side in DIBuilder::AllEnumTypes, which are eventually referred to by the 
compile unit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67141



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to