зеркало из https://github.com/microsoft/clang-1.git
Fix enum size and align. Tested by setvar.exp in gdb testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2fb11ebc36
Коммит
ffc52e78a2
|
@ -1240,13 +1240,15 @@ llvm::DIType CGDebugInfo::CreateEnumType(const EnumDecl *ED, llvm::DIFile Unit){
|
|||
llvm::DIFile DefUnit = getOrCreateFile(ED->getLocation());
|
||||
unsigned Line = getLineNumber(ED->getLocation());
|
||||
uint64_t Size = 0;
|
||||
if (!ED->getTypeForDecl()->isIncompleteType())
|
||||
CGM.getContext().getTypeSize(ED->getTypeForDecl());
|
||||
|
||||
uint64_t Align = 0;
|
||||
if (!ED->getTypeForDecl()->isIncompleteType()) {
|
||||
Size = CGM.getContext().getTypeSize(ED->getTypeForDecl());
|
||||
Align = CGM.getContext().getTypeAlign(ED->getTypeForDecl());
|
||||
}
|
||||
llvm::DIType DbgTy =
|
||||
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
|
||||
Unit, ED->getName(), DefUnit, Line,
|
||||
Size, 0, 0, 0,
|
||||
Size, Align, 0, 0,
|
||||
llvm::DIType(), EltArray);
|
||||
return DbgTy;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче