aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-04 01:49:36 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-04 01:49:36 +0000
commitb88acb018a0d5e897ce291da2664edfd7bd58f5c (patch)
tree3de442adc3d7f58cbb60f34b3e0fddac8e57a2d0 /lib/Serialization/ASTReaderDecl.cpp
parent2e9a44d333e9bbfc1f83222a6cd27415457bfada (diff)
[PCH] Really, pinky swear, fix for PR12689
rdar://11353109 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 15aa90b351..dc315f095c 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -25,6 +25,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
+#include "llvm/Support/SaveAndRestore.h"
using namespace clang;
using namespace clang::serialization;
@@ -629,8 +630,10 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
if (Record[Idx++]) {
// In practice, this won't be executed (since method definitions
// don't occur in header files).
- // Switch case IDs are per method body.
- Reader.ClearSwitchCaseIDs();
+ // Switch case IDs for this method body.
+ std::map<unsigned, SwitchCase *> SwitchCaseStmtsForObjCMethod;
+ SaveAndRestore<std::map<unsigned, SwitchCase *> *>
+ SCFOM(Reader.CurrSwitchCaseStmts, &SwitchCaseStmtsForObjCMethod);
MD->setBody(Reader.ReadStmt(F));
MD->setSelfDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));
MD->setCmdDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));