From 76e3b5354100a459fdd3cb5997f1a36c0c40ea81 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 10 Aug 2010 18:27:15 +0000 Subject: Do not use DIGlobalVariable to emit debugging information for enums. llvm-svn: 110697 --- clang/lib/CodeGen/CGDebugInfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index a75ff104767..4e020f92cea 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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), -- cgit v1.2.3