Fix context info for enums.

Radar 8595129

llvm-svn: 117507
This commit is contained in:
Devang Patel 2010-10-27 23:23:58 +00:00
parent cbdf7e874a
commit 1bee63f325
2 changed files with 16 additions and 2 deletions

View File

@ -1376,10 +1376,12 @@ llvm::DIType CGDebugInfo::CreateEnumType(const EnumDecl *ED, llvm::DIFile Unit){
Size = CGM.getContext().getTypeSize(ED->getTypeForDecl());
Align = CGM.getContext().getTypeAlign(ED->getTypeForDecl());
}
llvm::DIDescriptor EnumContext =
getContextDescriptor(dyn_cast<Decl>(ED->getDeclContext()), Unit);
llvm::DIType DbgTy =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
Unit, ED->getName(), DefUnit, Line,
Size, Align, 0, 0,
EnumContext, ED->getName(),
DefUnit, Line, Size, Align, 0, 0,
llvm::DIType(), EltArray);
return DbgTy;
}

View File

@ -0,0 +1,12 @@
// RUN: %clang -g -S %s -o - | FileCheck %s
// CHECK: TAG_namespace
namespace A {
enum numbers {
ZERO,
ONE
};
}
using namespace A;
numbers n;