diff options
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index f09873a0707..6497b787725 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -3284,6 +3284,9 @@ Decl *ASTReader::GetDecl(DeclID ID) { /// source each time it is called, and is meant to be used via a /// LazyOffsetPtr (which is used by Decls for the body of functions, etc). Stmt *ASTReader::GetExternalDeclStmt(uint64_t Offset) { + // Switch case IDs are per Decl. + ClearSwitchCaseIDs(); + // Offset here is a global offset across the entire chain. for (unsigned I = 0, N = Chain.size(); I != N; ++I) { PerFileData &F = *Chain[N - I - 1]; @@ -4252,6 +4255,10 @@ SwitchCase *ASTReader::getSwitchCaseWithID(unsigned ID) { return SwitchCaseStmts[ID]; } +void ASTReader::ClearSwitchCaseIDs() { + SwitchCaseStmts.clear(); +} + /// \brief Record that the given label statement has been /// deserialized and has the given ID. void ASTReader::RecordLabelStmt(LabelStmt *S, unsigned ID) { |

