diff options
author | Reid Kleckner <rnk@google.com> | 2017-07-13 20:12:23 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-07-13 20:12:23 +0000 |
commit | 6597c28d769c951720d6aef4851babd38f5c3f06 (patch) | |
tree | 49fbd05a5899f58c975dfc7e0a9e510aa307b84b /llvm/lib/DebugInfo/CodeView | |
parent | f0c652a52e705a8dc43e350d4990f4acbffc1781 (diff) | |
download | bcm5719-llvm-6597c28d769c951720d6aef4851babd38f5c3f06.tar.gz bcm5719-llvm-6597c28d769c951720d6aef4851babd38f5c3f06.zip |
[PDB] Fix type server handling for archives
Summary:
This fixes type indices for SDK or CRT static archives. Previously we'd
try to look next to the archive object file path, which would not exist
on the local machine.
Also error out if we can't resolve a type server record. Hypothetically
we can recover from this error by discarding debug info for this object,
but that is not yet implemented.
Reviewers: ruiu, amccarth
Subscribers: aprantl, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D35369
llvm-svn: 307946
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp index 71a0966df03..b21ea5975b5 100644 --- a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp +++ b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp @@ -273,16 +273,13 @@ Error TypeStreamMerger::mergeIdRecords(TypeTableBuilder &Dest, Error TypeStreamMerger::mergeTypesAndIds(TypeTableBuilder &DestIds, TypeTableBuilder &DestTypes, - const CVTypeArray &IdsAndTypes) { + const CVTypeArray &IdsAndTypes) { DestIdStream = &DestIds; DestTypeStream = &DestTypes; - return doit(IdsAndTypes); } Error TypeStreamMerger::doit(const CVTypeArray &Types) { - LastError = Error::success(); - // We don't want to deserialize records. I guess this flag is poorly named, // but it really means "Don't deserialize records before switching on the // concrete type. @@ -301,7 +298,7 @@ Error TypeStreamMerger::doit(const CVTypeArray &Types) { // topologically sorted. The standard library contains MASM-produced objects, // so this is important to handle correctly, but we don't have to be too // efficient. MASM type streams are usually very small. - while (!*LastError && NumBadIndices > 0) { + while (!LastError && NumBadIndices > 0) { unsigned BadIndicesRemaining = NumBadIndices; IsSecondPass = true; NumBadIndices = 0; @@ -313,15 +310,15 @@ Error TypeStreamMerger::doit(const CVTypeArray &Types) { assert(NumBadIndices <= BadIndicesRemaining && "second pass found more bad indices"); - if (!*LastError && NumBadIndices == BadIndicesRemaining) { + if (!LastError && NumBadIndices == BadIndicesRemaining) { return llvm::make_error<CodeViewError>( cv_error_code::corrupt_record, "input type graph contains cycles"); } } - Error Ret = std::move(*LastError); - LastError.reset(); - return Ret; + if (LastError) + return std::move(*LastError); + return Error::success(); } Error llvm::codeview::mergeTypeRecords(TypeTableBuilder &Dest, @@ -343,8 +340,7 @@ Error llvm::codeview::mergeIdRecords(TypeTableBuilder &Dest, Error llvm::codeview::mergeTypeAndIdRecords( TypeTableBuilder &DestIds, TypeTableBuilder &DestTypes, SmallVectorImpl<TypeIndex> &SourceToDest, TypeServerHandler *Handler, - const CVTypeArray &IdsAndTypes) { - + const CVTypeArray &IdsAndTypes) { TypeStreamMerger M(SourceToDest, Handler); return M.mergeTypesAndIds(DestIds, DestTypes, IdsAndTypes); } |