[PATCH] D62214: Remove extra if case.

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 08:46:21 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL361400: Combine two if cases because the second one is never reached. (authored by akhuang, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D62214?vs=200558&id=200765#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D62214

Files:
  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp


Index: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
@@ -4352,16 +4352,14 @@
   llvm::DIFile *Unit = getOrCreateFile(VD->getLocation());
   StringRef Name = VD->getName();
   llvm::DIType *Ty = getOrCreateType(VD->getType(), Unit);
+
+  // Do not use global variables for enums.
   if (const auto *ECD = dyn_cast<EnumConstantDecl>(VD)) {
     const auto *ED = cast<EnumDecl>(ECD->getDeclContext());
     assert(isa<EnumType>(ED->getTypeForDecl()) && "Enum without EnumType?");
-    Ty = getOrCreateType(QualType(ED->getTypeForDecl(), 0), Unit);
-  }
-  // Do not use global variables for enums.
-  //
-  // FIXME: why not?
-  if (Ty->getTag() == llvm::dwarf::DW_TAG_enumeration_type)
     return;
+  }
+
   // Do not emit separate definitions for function local const/statics.
   if (isa<FunctionDecl>(VD->getDeclContext()))
     return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62214.200765.patch
Type: text/x-patch
Size: 982 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190522/444840d2/attachment.bin>


More information about the llvm-commits mailing list