diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-10 18:27:15 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-10 18:27:15 +0000 |
commit | 0317ab0f54e7884b072ed359447e078d067fc9e9 (patch) | |
tree | 7b2cdfe2955607742577879ce80adf0da7be49cc /lib/CodeGen/CGDebugInfo.cpp | |
parent | ba551983016ee3eac5421255d2ebe6723e61befb (diff) |
Do not use DIGlobalVariable to emit debugging information for enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index a75ff10476..4e020f92ce 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1808,6 +1808,10 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, // Create the descriptor for the variable. llvm::DIFile Unit = getOrCreateFile(VD->getLocation()); llvm::StringRef Name = VD->getName(); + llvm::DIType Ty = getOrCreateType(VD->getType(), Unit); + // Do not use DIGlobalVariable for enums. + if (Ty.getTag() == llvm::dwarf::DW_TAG_enumeration_type) + return; DebugFactory.CreateGlobalVariable(Unit, Name, Name, Name, Unit, getLineNumber(VD->getLocation()), getOrCreateType(VD->getType(), Unit), |