зеркало из https://github.com/microsoft/clang-1.git
fix some more cases where we'd emit a file with a line of 0 for implicit
types. In this case, it was objc_selector and objc_class. This fixes rdar://6852754 - clang sometimes generates incorrect/unknown file/line info for DW_TAG__structure_type dies git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
9e55b8a8b3
Коммит
d37d9b5bf9
|
@ -275,9 +275,13 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
|
||||||
// Get overall information about the record type for the debug info.
|
// Get overall information about the record type for the debug info.
|
||||||
std::string Name = Decl->getNameAsString();
|
std::string Name = Decl->getNameAsString();
|
||||||
|
|
||||||
llvm::DICompileUnit DefUnit = getOrCreateCompileUnit(Decl->getLocation());
|
|
||||||
PresumedLoc PLoc = SM.getPresumedLoc(Decl->getLocation());
|
PresumedLoc PLoc = SM.getPresumedLoc(Decl->getLocation());
|
||||||
unsigned Line = PLoc.isInvalid() ? 0 : PLoc.getLine();
|
llvm::DICompileUnit DefUnit;
|
||||||
|
unsigned Line = 0;
|
||||||
|
if (!PLoc.isInvalid()) {
|
||||||
|
DefUnit = getOrCreateCompileUnit(Decl->getLocation());
|
||||||
|
Line = PLoc.getLine();
|
||||||
|
}
|
||||||
|
|
||||||
// Records and classes and unions can all be recursive. To handle them, we
|
// Records and classes and unions can all be recursive. To handle them, we
|
||||||
// first generate a debug descriptor for the struct as a forward declaration.
|
// first generate a debug descriptor for the struct as a forward declaration.
|
||||||
|
@ -317,10 +321,14 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
|
||||||
|
|
||||||
// Get the location for the field.
|
// Get the location for the field.
|
||||||
SourceLocation FieldDefLoc = Field->getLocation();
|
SourceLocation FieldDefLoc = Field->getLocation();
|
||||||
llvm::DICompileUnit FieldDefUnit = getOrCreateCompileUnit(FieldDefLoc);
|
|
||||||
PresumedLoc PLoc = SM.getPresumedLoc(FieldDefLoc);
|
PresumedLoc PLoc = SM.getPresumedLoc(FieldDefLoc);
|
||||||
unsigned FieldLine = PLoc.isInvalid() ? 0 : PLoc.getLine();
|
llvm::DICompileUnit FieldDefUnit;
|
||||||
|
unsigned FieldLine = 0;
|
||||||
|
|
||||||
|
if (!PLoc.isInvalid()) {
|
||||||
|
FieldDefUnit = getOrCreateCompileUnit(FieldDefLoc);
|
||||||
|
FieldLine = PLoc.getLine();
|
||||||
|
}
|
||||||
|
|
||||||
QualType FType = Field->getType();
|
QualType FType = Field->getType();
|
||||||
uint64_t FieldSize = 0;
|
uint64_t FieldSize = 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче