forked from OSchip/llvm-project
Fix context info for enums.
Radar 8595129 llvm-svn: 117507
This commit is contained in:
parent
cbdf7e874a
commit
1bee63f325
|
@ -1376,10 +1376,12 @@ llvm::DIType CGDebugInfo::CreateEnumType(const EnumDecl *ED, llvm::DIFile Unit){
|
||||||
Size = CGM.getContext().getTypeSize(ED->getTypeForDecl());
|
Size = CGM.getContext().getTypeSize(ED->getTypeForDecl());
|
||||||
Align = CGM.getContext().getTypeAlign(ED->getTypeForDecl());
|
Align = CGM.getContext().getTypeAlign(ED->getTypeForDecl());
|
||||||
}
|
}
|
||||||
|
llvm::DIDescriptor EnumContext =
|
||||||
|
getContextDescriptor(dyn_cast<Decl>(ED->getDeclContext()), Unit);
|
||||||
llvm::DIType DbgTy =
|
llvm::DIType DbgTy =
|
||||||
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
|
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
|
||||||
Unit, ED->getName(), DefUnit, Line,
|
EnumContext, ED->getName(),
|
||||||
Size, Align, 0, 0,
|
DefUnit, Line, Size, Align, 0, 0,
|
||||||
llvm::DIType(), EltArray);
|
llvm::DIType(), EltArray);
|
||||||
return DbgTy;
|
return DbgTy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue