diff options
| author | Amy Huang <akhuang@google.com> | 2019-05-22 15:48:59 +0000 |
|---|---|---|
| committer | Amy Huang <akhuang@google.com> | 2019-05-22 15:48:59 +0000 |
| commit | 63305c8fbba7b3b852f43fb2e05b9752097f13ba (patch) | |
| tree | ea53fe930417777708a3e077b29d5d41c42b1341 /clang/lib/CodeGen | |
| parent | be0e70dcde48808fda16b5b87d5b6d675e2b665e (diff) | |
| download | bcm5719-llvm-63305c8fbba7b3b852f43fb2e05b9752097f13ba.tar.gz bcm5719-llvm-63305c8fbba7b3b852f43fb2e05b9752097f13ba.zip | |
Combine two if cases because the second one is never reached.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62214
llvm-svn: 361400
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f436cab16c4..fec092ad221 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -4352,16 +4352,14 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) { 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; |

