[cfe-commits] r167142 - /cfe/trunk/lib/Parse/ParseStmt.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Oct 31 10:29:28 PDT 2012
Author: akirtzidis
Date: Wed Oct 31 12:29:28 2012
New Revision: 167142
URL: http://llvm.org/viewvc/llvm-project?rev=167142&view=rev
Log:
If skipping bodies is enabled outside code-completion, just skip the body directly
without using tentative parsing.
Modified:
cfe/trunk/lib/Parse/ParseStmt.cpp
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=167142&r1=167141&r2=167142&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Wed Oct 31 12:29:28 2012
@@ -2028,12 +2028,18 @@
assert(SkipFunctionBodies &&
"Should only be called when SkipFunctionBodies is enabled");
+ if (!PP.isCodeCompletionEnabled()) {
+ ConsumeBrace();
+ SkipUntil(tok::r_brace, /*StopAtSemi=*/false, /*DontConsume=*/false);
+ return true;
+ }
+
// We're in code-completion mode. Skip parsing for all function bodies unless
// the body contains the code-completion point.
TentativeParsingAction PA(*this);
ConsumeBrace();
if (SkipUntil(tok::r_brace, /*StopAtSemi=*/false, /*DontConsume=*/false,
- /*StopAtCodeCompletion=*/PP.isCodeCompletionEnabled())) {
+ /*StopAtCodeCompletion=*/true)) {
PA.Commit();
return true;
}
More information about the cfe-commits
mailing list