Skip to content

Commit 06f2982

Browse files
committed
[rebranch][lldb] Handle new requires OSSA option
swift f458d9b added checking for the dependencies of any module compiled with `-enable-ossa-modules` to also be compiled with `-enable-ossa-modules`.
1 parent a0d730e commit 06f2982

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,13 @@ static const char *getImportFailureString(swift::serialization::Status status) {
12681268
case swift::serialization::Status::TargetTooNew:
12691269
return "The module file was built for a target newer than the current "
12701270
"target.";
1271+
case swift::serialization::Status::RevisionIncompatible:
1272+
return "The module file was built for a different version of the compiler.";
1273+
case swift::serialization::Status::NotInOSSA:
1274+
return "The module file was not compiled with -enable-ossa-modules when it "
1275+
"was required to do so.";
1276+
case swift::serialization::Status::SDKMismatch:
1277+
return "The module file was built with a different SDK version.";
12711278
}
12721279
}
12731280

@@ -1355,7 +1362,7 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13551362
for (; !buf.empty(); buf = buf.substr(info.bytes)) {
13561363
swift::serialization::ExtendedValidationInfo extended_validation_info;
13571364
info = swift::serialization::validateSerializedAST(
1358-
buf, &extended_validation_info);
1365+
buf, /*requiresOSSAModules=*/false, &extended_validation_info);
13591366
bool invalid_ast = info.status != swift::serialization::Status::Valid;
13601367
bool invalid_size = (info.bytes == 0) || (info.bytes > buf.size());
13611368
bool invalid_name = info.name.empty();
@@ -3347,9 +3354,9 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
33473354

33483355
LLDB_SCOPED_TIMER();
33493356
m_ast_context_ap.reset(swift::ASTContext::get(
3350-
GetLanguageOptions(), GetTypeCheckerOptions(), GetSearchPathOptions(),
3351-
GetClangImporterOptions(), GetSymbolGraphOptions(),
3352-
GetSourceManager(), GetDiagnosticEngine()));
3357+
GetLanguageOptions(), GetTypeCheckerOptions(), GetSILOptions(),
3358+
GetSearchPathOptions(), GetClangImporterOptions(),
3359+
GetSymbolGraphOptions(), GetSourceManager(), GetDiagnosticEngine()));
33533360
m_diagnostic_consumer_ap.reset(new StoringDiagnosticConsumer(*this));
33543361

33553362
if (getenv("LLDB_SWIFT_DUMP_DIAGS")) {

0 commit comments

Comments
 (0)