Skip to content

Commit 6a3ffb0

Browse files
committed
Make sure EvaluateIfConditionRequest isn't using Swift code in C++-only mode
1 parent af826bb commit 6a3ffb0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/TypeChecker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ std::pair<bool, bool> EvaluateIfConditionRequest::evaluate(
755755
Evaluator &evaluator, SourceFile *sourceFile, SourceRange conditionRange,
756756
bool shouldEvaluate
757757
) const {
758+
#if SWIFT_BUILD_SWIFT_SYNTAX
758759
// FIXME: When we migrate to SwiftParser, use the parsed syntax tree.
759760
ASTContext &ctx = sourceFile->getASTContext();
760761
auto &sourceMgr = ctx.SourceMgr;
@@ -775,4 +776,7 @@ std::pair<bool, bool> EvaluateIfConditionRequest::evaluate(
775776
bool isActive = (evalResult & 0x01) != 0;
776777
bool allowSyntaxErrors = (evalResult & 0x02) != 0;
777778
return std::pair(isActive, allowSyntaxErrors);
779+
#else
780+
llvm_unreachable("Must not be used in C++-only build");
781+
#endif
778782
}

0 commit comments

Comments
 (0)