Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions lib/Sema/CSStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,21 +880,6 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
CS.Timer.emplace(element.getLocator(), CS);
}

assert(!ModifiedOptions.has_value() &&
"Previously modified options should have been restored in resume");
if (CS.isForCodeCompletion() &&
!element.mightContainCodeCompletionToken(CS) &&
!getLocator()->isForSingleValueStmtConjunctionOrBrace()) {
ModifiedOptions.emplace(CS.Options);
// If we know that this conjunction element doesn't contain the code
// completion token, type check it in normal mode without any special
// behavior that is intended for the code completion token.
// Avoid doing this for SingleValueStmtExprs, because we can more eagerly
// prune branches in that case, which requires us to detect the code
// completion option while solving the conjunction.
CS.Options -= ConstraintSystemFlags::ForCodeCompletion;
}

auto success = element.attempt(CS);

// If element attempt has failed, mark whole conjunction
Expand All @@ -906,9 +891,6 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
}

StepResult ConjunctionStep::resume(bool prevFailed) {
// Restore the old ConstraintSystemOptions if 'attempt' modified them.
ModifiedOptions.reset();

// Return from the follow-up splitter step that
// attempted to apply information gained from the
// isolated constraint to the outer context.
Expand Down
5 changes: 0 additions & 5 deletions lib/Sema/CSStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
/// in isolated mode.
SmallVector<Solution, 4> IsolatedSolutions;

/// If \c ConjunctionStep::attempt modified the constraint system options,
/// it will store the original options in this \c llvm::SaveAndRestore.
/// Upon \c resume, these values will be restored.
llvm::Optional<llvm::SaveAndRestore<ConstraintSystemOptions>> ModifiedOptions;

public:
ConjunctionStep(ConstraintSystem &cs, Constraint *conjunction,
SmallVectorImpl<Solution> &solutions)
Expand Down