mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/main' into manually-merge-main-to-rebranch
Conflicts:
- `test/IRGen/has_symbol.swift` test updates in rebranch. The new test
will fail, will fix in the next commit.
This commit is contained in:
@@ -100,6 +100,7 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
|
||||
assert(Importer && "No clang module loader!");
|
||||
auto &ClangContext = Importer->getClangASTContext();
|
||||
|
||||
auto &CGTI = Importer->getTargetInfo();
|
||||
auto &CGO = Importer->getCodeGenOpts();
|
||||
CGO.OptimizationLevel = Opts.shouldOptimize() ? 3 : 0;
|
||||
|
||||
@@ -154,7 +155,7 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
|
||||
auto *ClangCodeGen = clang::CreateLLVMCodeGen(ClangContext.getDiagnostics(),
|
||||
ModuleName, &VFS, HSI, PPO, CGO,
|
||||
LLVMContext);
|
||||
ClangCodeGen->Initialize(ClangContext);
|
||||
ClangCodeGen->Initialize(ClangContext, CGTI);
|
||||
return ClangCodeGen;
|
||||
}
|
||||
|
||||
@@ -1002,6 +1003,14 @@ namespace RuntimeConstants {
|
||||
return RuntimeAvailability::AlwaysAvailable;
|
||||
}
|
||||
|
||||
RuntimeAvailability ValueGenericTypeAvailability(ASTContext &Context) {
|
||||
auto featureAvailability = Context.getValueGenericTypeAvailability();
|
||||
if (!isDeploymentAvailabilityContainedIn(Context, featureAvailability)) {
|
||||
return RuntimeAvailability::ConditionallyAvailable;
|
||||
}
|
||||
return RuntimeAvailability::AlwaysAvailable;
|
||||
}
|
||||
|
||||
} // namespace RuntimeConstants
|
||||
|
||||
// We don't use enough attributes to justify generalizing the
|
||||
|
||||
Reference in New Issue
Block a user