Skip to content

Commit fe575c6

Browse files
committed
Manually merge remote-tracking branch 'origin/main' into rebranch
Conflicts: lib/AST/RequirementMachine/RequirementLowering.cpp
2 parents 179daf3 + f2ef2d3 commit fe575c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+779
-672
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ defaulted_option(SwiftCore_ENABLE_OBJC_INTEROP "Enable runtime ObjC interop")
104104
defaulted_option(SwiftCore_ENABLE_TYPE_PRINTING "Enable printing type names")
105105
defaulted_option(SwiftCore_ENABLE_VECTOR_TYPES "Enable vector support")
106106
defaulted_option(SwiftCore_ENABLE_REFLECTION "Enable runtime support for mirrors and reflection support")
107-
defaulted_option(SwiftCore_ENABLE_COMMANDLINE_SUPPORT "Enable command line argument support")
108107
defaulted_option(SwiftCore_ENABLE_RUNTIME_FUNCTION_COUNTERS "Enable runtime function counter support")
109108
defaulted_option(SwiftCore_ENABLE_STDIN "Enable functions that use stdin support")
110109
defaulted_option(SwiftCore_ENABLE_ENVIRONMENT "Enable environment variable support")
@@ -116,6 +115,7 @@ defaulted_option(SwiftCore_ENABLE_BACKDEPLOYMENT_SUPPORT "Add symbols for runtim
116115
defaulted_option(SwiftCore_ENABLE_STDLIB_TRACING "Enable tracing in the runtime. Assumes the presence of os_log(3) and the os_signpost(3) API.")
117116
defaulted_option(SwiftCore_ENABLE_CONCURRENCY "Enable Concurrency runtime support")
118117
defaulted_set(SwiftCore_CONCURRENCY_GLOBAL_EXECUTOR STRING "Default Concurrency global executor implementation")
118+
option(SwiftCore_ENABLE_COMMANDLINE_SUPPORT "Enable command line argument support" ON)
119119
option(SwiftCore_ENABLE_UNICODE_DATA "Include unicode data in Swift runtimes" ON)
120120
option(SwiftCore_ENABLE_SHORT_MANGLING_LOOKUPS "Build with fast-path context descriptor lookups based on well-known short manglings." ON)
121121
option(SwiftCore_ENABLE_FILESYSTEM_SUPPORT "Build for systems that have a filesystem" ON)

Runtimes/Core/CommandLineSupport/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ if(SwiftCore_ENABLE_COMMANDLINE_SUPPORT)
55
"${PROJECT_BINARY_DIR}/include")
66
target_compile_definitions(swiftCommandLineSupport PUBLIC
77
-DSWIFT_STDLIB_HAS_COMMANDLINE)
8+
target_compile_definitions(swiftCommandLineSupport PRIVATE
9+
$<$<BOOL:${BUILD_SHARED_LIBS}>:-DswiftCore_EXPORTS>)
810

911
target_link_libraries(swiftCommandLineSupport PRIVATE
1012
swiftShims)

Runtimes/Core/cmake/modules/DefaultSettings.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# the variable with `-DSwiftCore_*` on the commandline.
77

88
set(SwiftCore_ENABLE_BACKTRACING_default OFF) # TODO: enable this by default
9-
set(SwiftCore_ENABLE_COMMANDLINE_SUPPORT_default OFF) # TODO: enable this by default
109

1110
set(SwiftCore_ENABLE_STDIN_default ON)
1211
set(SwiftCore_ENABLE_TYPE_PRINTING_default ON)
@@ -62,12 +61,19 @@ elseif(LINUX OR ANDROID OR BSD)
6261
set(SwiftCore_CONCURRENCY_GLOBAL_EXECUTOR_default "dispatch")
6362
elseif(WIN32)
6463
set(SwiftCore_OBJECT_FORMAT_default "coff")
64+
65+
set(SwiftCore_ENABLE_LIBRARY_EVOLUTION_default ${BUILD_SHARED_LIBS})
6566
set(SwiftCore_ENABLE_REFLECTION_default ON)
6667
set(SwiftCore_ENABLE_FATALERROR_BACKTRACE_default ON)
68+
set(SwiftCore_ENABLE_OVERRIDABLE_RETAIN_RELEASE_default ON)
6769
set(SwiftCore_ENABLE_CONCURRENCY_default NO)
6870
set(SwiftCore_THREADING_PACKAGE_default "WIN32")
6971
set(SwiftCore_ENABLE_PRESPECIALIZATION_default ON)
7072
set(SwiftCore_CONCURRENCY_GLOBAL_EXECUTOR_default "dispatch")
73+
74+
set(SwiftCore_ENABLE_VECTOR_TYPES_default ON)
75+
set(SwiftCore_ENABLE_FILESYSTEM_SUPPORT_default ON)
76+
set(SwiftCore_INSTALL_NESTED_SUBDIR_default ON)
7177
endif()
7278

7379
include("${SwiftCore_VENDOR_MODULE_DIR}/DefaultSettings.cmake" OPTIONAL)

include/swift/AST/Decl.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,9 +2523,7 @@ class PatternBindingDecl final : public Decl,
25232523
Pattern *Pat, Expr *E,
25242524
DeclContext *Parent);
25252525

2526-
SourceLoc getStartLoc() const {
2527-
return StaticLoc.isValid() ? StaticLoc : VarLoc;
2528-
}
2526+
SourceLoc getStartLoc() const;
25292527
SourceRange getSourceRange() const;
25302528

25312529
unsigned getNumPatternEntries() const {
@@ -6997,6 +6995,10 @@ class ParamDecl : public VarDecl {
69976995
/// Create a an identical copy of this ParamDecl.
69986996
static ParamDecl *clone(const ASTContext &Ctx, ParamDecl *PD);
69996997

6998+
static ParamDecl *cloneAccessor(const ASTContext &Ctx,
6999+
ParamDecl const *subscriptParam,
7000+
DeclContext *Parent);
7001+
70007002
static ParamDecl *
70017003
createImplicit(ASTContext &Context, SourceLoc specifierLoc,
70027004
SourceLoc argumentNameLoc, Identifier argumentName,
@@ -8413,9 +8415,8 @@ class FuncDecl : public AbstractFunctionDecl {
84138415
SourceLoc getStaticLoc() const { return StaticLoc; }
84148416
SourceLoc getFuncLoc() const { return FuncLoc; }
84158417

8416-
SourceLoc getStartLoc() const {
8417-
return StaticLoc.isValid() ? StaticLoc : FuncLoc;
8418-
}
8418+
SourceLoc getStartLoc() const;
8419+
SourceLoc getEndLoc() const;
84198420
SourceRange getSourceRange() const;
84208421

84218422
TypeRepr *getResultTypeRepr() const { return FnRetType.getTypeRepr(); }

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ REMARK(matching_output_produced,none,
520520

521521
// Caching related diagnostics
522522
ERROR(error_caching_no_cas_fs, none,
523-
"caching is enabled without -cas-fs option, input is not immutable", ())
523+
"caching is enabled without CAS file-system options, input is not immutable", ())
524524
ERROR(error_prefix_mapping, none, "cannot create scanner prefix mapping: '%0'", (StringRef))
525525

526526
REMARK(replay_output, none, "replay output file '%0': key '%1'", (StringRef, StringRef))

include/swift/AST/ModuleDependencies.h

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ using ModuleDependenciesKindMap =
10001000
/// Track swift dependency
10011001
class SwiftDependencyTracker {
10021002
public:
1003-
SwiftDependencyTracker(llvm::cas::CachingOnDiskFileSystem &FS,
1003+
SwiftDependencyTracker(std::shared_ptr<llvm::cas::ObjectStore> CAS,
10041004
llvm::PrefixMapper *Mapper,
10051005
const CompilerInvocation &CI);
10061006

@@ -1009,7 +1009,8 @@ class SwiftDependencyTracker {
10091009
llvm::Expected<llvm::cas::ObjectProxy> createTreeFromDependencies();
10101010

10111011
private:
1012-
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> FS;
1012+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
1013+
std::shared_ptr<llvm::cas::ObjectStore> CAS;
10131014
llvm::PrefixMapper *Mapper;
10141015

10151016
struct FileEntry {
@@ -1035,10 +1036,7 @@ class SwiftDependencyScanningService {
10351036
ClangScanningService;
10361037

10371038
/// CachingOnDiskFileSystem for dependency tracking.
1038-
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> CacheFS;
1039-
1040-
/// If use clang include tree.
1041-
bool UseClangIncludeTree = false;
1039+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> CacheFS;
10421040

10431041
/// CAS Instance.
10441042
std::shared_ptr<llvm::cas::ObjectStore> CAS;
@@ -1076,8 +1074,8 @@ class SwiftDependencyScanningService {
10761074
return *SharedFilesystemCache;
10771075
}
10781076

1079-
llvm::cas::CachingOnDiskFileSystem &getSharedCachingFS() const {
1080-
assert(CacheFS && "Expect CachingOnDiskFileSystem");
1077+
llvm::vfs::FileSystem &getSharedCachingFS() const {
1078+
assert(CacheFS && "Expect a CASFileSystem");
10811079
return *CacheFS;
10821080
}
10831081

@@ -1088,20 +1086,17 @@ class SwiftDependencyScanningService {
10881086

10891087
std::optional<SwiftDependencyTracker>
10901088
createSwiftDependencyTracker(const CompilerInvocation &CI) {
1091-
if (!CacheFS)
1089+
if (!CAS)
10921090
return std::nullopt;
10931091

1094-
return SwiftDependencyTracker(*CacheFS, Mapper.get(), CI);
1092+
return SwiftDependencyTracker(CAS, Mapper.get(), CI);
10951093
}
10961094

10971095
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> getClangScanningFS() const {
1098-
if (UseClangIncludeTree)
1096+
if (CAS)
10991097
return llvm::cas::createCASProvidingFileSystem(
11001098
CAS, llvm::vfs::createPhysicalFileSystem());
11011099

1102-
if (CacheFS)
1103-
return CacheFS->createProxyFS();
1104-
11051100
return llvm::vfs::createPhysicalFileSystem();
11061101
}
11071102

include/swift/Basic/CASOptions.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class CASOptions final {
3737
/// CASOptions
3838
clang::CASOptions CASOpts;
3939

40-
/// CASFS Root.
41-
std::vector<std::string> CASFSRootIDs;
42-
4340
/// Clang Include Trees.
4441
std::string ClangIncludeTree;
4542

@@ -62,9 +59,8 @@ class CASOptions final {
6259
/// Check to see if a CASFileSystem is required.
6360
bool requireCASFS() const {
6461
return EnableCaching &&
65-
(!CASFSRootIDs.empty() || !ClangIncludeTree.empty() ||
66-
!ClangIncludeTreeFileList.empty() || !InputFileKey.empty() ||
67-
!BridgingHeaderPCHCacheKey.empty());
62+
(!ClangIncludeTree.empty() || !ClangIncludeTreeFileList.empty() ||
63+
!InputFileKey.empty() || !BridgingHeaderPCHCacheKey.empty());
6864
}
6965

7066
/// Return a hash code of any components from these options that should

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,6 @@ namespace swift {
10941094
/// built and provided to the compiler invocation.
10951095
bool DisableImplicitClangModules = false;
10961096

1097-
/// Enable ClangIncludeTree for explicit module builds scanning.
1098-
bool UseClangIncludeTree = false;
1099-
1100-
/// Using ClangIncludeTreeRoot for compilation.
1101-
bool HasClangIncludeTreeRoot = false;
1102-
11031097
/// Whether the dependency scanner should construct all swift-frontend
11041098
/// invocations directly from clang cc1 args.
11051099
bool ClangImporterDirectCC1Scan = false;

include/swift/ClangImporter/ClangImporter.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,6 @@ class ClangImporter final : public ClangModuleLoader {
474474
/// Reads the original source file name from PCH.
475475
std::string getOriginalSourceFile(StringRef PCHFilename);
476476

477-
/// Add clang dependency file names.
478-
///
479-
/// \param files The list of file to append dependencies to.
480-
void addClangInvovcationDependencies(std::vector<std::string> &files);
481-
482477
/// Makes a temporary replica of the ClangImporter's CompilerInstance, reads a
483478
/// module map into the replica and emits a PCM file for one of the modules it
484479
/// declares. Delegates to clang for everything except construction of the

include/swift/Frontend/CachingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ std::unique_ptr<llvm::MemoryBuffer> loadCachedCompileResultFromCacheKey(
7070
llvm::StringRef Filename = "");
7171

7272
llvm::Expected<llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>>
73-
createCASFileSystem(llvm::cas::ObjectStore &CAS, ArrayRef<std::string> FSRoots,
73+
createCASFileSystem(llvm::cas::ObjectStore &CAS,
7474
const std::string &IncludeTreeRoot,
7575
const std::string &IncludeTreeFileList);
7676

0 commit comments

Comments
 (0)