aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-30 08:36:53 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-30 08:36:53 +0000
commitd2d8be6a27d0ef73d46039604682f7890e1cc3e0 (patch)
treec39aa9177631105b874776a18053213296b42a07 /lib/Parse/ParseStmt.cpp
parente42447021239015db97202fb04c304d82e84135f (diff)
Add code completion to produce "else" blocks after an "if"
statement. Fixes <rdar://problem/9229438>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r--lib/Parse/ParseStmt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index b34e4f8277..d57e527990 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -953,6 +953,9 @@ StmtResult Parser::ParseIfStatement(ParsedAttributes &attrs) {
// Pop the 'else' scope if needed.
InnerScope.Exit();
+ } else if (Tok.is(tok::code_completion)) {
+ Actions.CodeCompleteAfterIf(getCurScope());
+ ConsumeCodeCompletionToken();
}
IfScope.Exit();