[CodeComplete] More efficient skipping for completions in if/switch exprs

Skip type-checking multi-statement branches if the
completion is in a single-expression branch, and
skip type-checking the expression as a whole if
the completion is in a multi-statement branch.
This commit is contained in:
Hamish Knight
2023-08-01 15:21:29 +01:00
parent d8d8db987b
commit 1dd86fccdb
6 changed files with 313 additions and 18 deletions

View File

@@ -310,6 +310,10 @@ public:
/// SingleValueStmtExpr.
bool isForSingleValueStmtConjunction() const;
/// Whether this locator identifies a conjunction for the branches of a
/// SingleValueStmtExpr, or a conjunction for one of the BraceStmts itself.
bool isForSingleValueStmtConjunctionOrBrace() const;
/// Whether this locator identifies a conversion for a SingleValueStmtExpr
/// branch, and if so, the kind of branch.
llvm::Optional<SingleValueStmtBranchKind> isForSingleValueStmtBranch() const;