[llvm-branch-commits] [cfe-branch] r156675 - in /cfe/branches/release_31: ./ include/clang/Parse/Parser.h test/Parser/recursion-limits.cpp test/SemaCXX/warn-unreachable.cpp
Bill Wendling
isanbard at gmail.com
Fri May 11 17:23:38 PDT 2012
Author: void
Date: Fri May 11 19:23:38 2012
New Revision: 156675
URL: http://llvm.org/viewvc/llvm-project?rev=156675&view=rev
Log:
Merging r155823:
------------------------------------------------------------------------
r155823 | dgregor | 2012-04-30 09:20:27 -0700 (Mon, 30 Apr 2012) | 4 lines
Restore paren, bracket and brace counts in parser when
TentativeParsingAction is reverted, from Pasi Parviainen! Fixes
PR12480 / <rdar://problem/11341251>.
------------------------------------------------------------------------
Added:
cfe/branches/release_31/test/Parser/recursion-limits.cpp
- copied unchanged from r155823, cfe/trunk/test/Parser/recursion-limits.cpp
Modified:
cfe/branches/release_31/ (props changed)
cfe/branches/release_31/include/clang/Parse/Parser.h
cfe/branches/release_31/test/SemaCXX/warn-unreachable.cpp (props changed)
Propchange: cfe/branches/release_31/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 11 19:23:38 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:155076,155278-155279,155342,155534-155535,155576,155670,155728,155803,155860,155910,155975,156047,156322
+/cfe/trunk:155076,155278-155279,155342,155534-155535,155576,155670,155728,155803,155823,155860,155910,155975,156047,156322
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_31/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_31/include/clang/Parse/Parser.h?rev=156675&r1=156674&r2=156675&view=diff
==============================================================================
--- cfe/branches/release_31/include/clang/Parse/Parser.h (original)
+++ cfe/branches/release_31/include/clang/Parse/Parser.h Fri May 11 19:23:38 2012
@@ -584,11 +584,15 @@
class TentativeParsingAction {
Parser &P;
Token PrevTok;
+ unsigned short PrevParenCount, PrevBracketCount, PrevBraceCount;
bool isActive;
public:
explicit TentativeParsingAction(Parser& p) : P(p) {
PrevTok = P.Tok;
+ PrevParenCount = P.ParenCount;
+ PrevBracketCount = P.BracketCount;
+ PrevBraceCount = P.BraceCount;
P.PP.EnableBacktrackAtThisPos();
isActive = true;
}
@@ -601,6 +605,9 @@
assert(isActive && "Parsing action was finished!");
P.PP.Backtrack();
P.Tok = PrevTok;
+ P.ParenCount = PrevParenCount;
+ P.BracketCount = PrevBracketCount;
+ P.BraceCount = PrevBraceCount;
isActive = false;
}
~TentativeParsingAction() {
Propchange: cfe/branches/release_31/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 11 19:23:38 2012
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,155076,155278-155279,155342,155534-155535,155576,155670,155728,155803,155860,155910,155975,156047
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,155076,155278-155279,155342,155534-155535,155576,155670,155728,155803,155823,155860,155910,155975,156047
More information about the llvm-branch-commits
mailing list