/// unless the body contains the code-completion point.
///
/// \returns true if the function body was skipped.
- bool MaybeSkipFunctionBodyForCodeCompletion();
+ bool trySkippingFunctionBodyForCodeCompletion();
bool ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
const ParsedTemplateInfo &TemplateInfo,
// specified Declarator for the method.
Actions.ActOnStartOfObjCMethodDef(getCurScope(), MDecl);
- if (MaybeSkipFunctionBodyForCodeCompletion())
- return Actions.ActOnFinishFunctionBody(MDecl, 0);
+ if (PP.isCodeCompletionEnabled())
+ if (trySkippingFunctionBodyForCodeCompletion())
+ return Actions.ActOnFinishFunctionBody(MDecl, 0);
StmtResult FnBody(ParseCompoundStatementBody());
assert(Tok.is(tok::l_brace));
SourceLocation LBraceLoc = Tok.getLocation();
- if (MaybeSkipFunctionBodyForCodeCompletion())
- return Actions.ActOnFinishFunctionBody(Decl, 0);
+ if (PP.isCodeCompletionEnabled())
+ if (trySkippingFunctionBodyForCodeCompletion())
+ return Actions.ActOnFinishFunctionBody(Decl, 0);
PrettyDeclStackTraceEntry CrashInfo(Actions, Decl, LBraceLoc,
"parsing function body");
if (Tok.is(tok::colon))
ParseConstructorInitializer(Decl);
- if (MaybeSkipFunctionBodyForCodeCompletion())
- return Actions.ActOnFinishFunctionBody(Decl, 0);
+ if (PP.isCodeCompletionEnabled())
+ if (trySkippingFunctionBodyForCodeCompletion())
+ return Actions.ActOnFinishFunctionBody(Decl, 0);
SourceLocation LBraceLoc = Tok.getLocation();
StmtResult FnBody(ParseCXXTryBlockCommon(TryLoc));
return Actions.ActOnFinishFunctionBody(Decl, FnBody.take());
}
-bool Parser::MaybeSkipFunctionBodyForCodeCompletion() {
+bool Parser::trySkippingFunctionBodyForCodeCompletion() {
assert(Tok.is(tok::l_brace));
-
- if (!PP.isCodeCompletionEnabled())
- return false;
+ assert(PP.isCodeCompletionEnabled() &&
+ "Should only be called when in code-completion mode");
// We're in code-completion mode. Skip parsing for all function bodies unless
// the body contains the code-completion point.