Skip to content

Commit c9f0de1

Browse files
committed
[Dependency Scanning] Remove references to per-triple PCM variant compilation
1 parent 41e4712 commit c9f0de1

23 files changed

+69
-318
lines changed

include/swift-c/DependencyScan/DependencyScan.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ SWIFTSCAN_PUBLIC swiftscan_string_set_t *
194194
swiftscan_swift_textual_detail_get_bridging_pch_command_line(
195195
swiftscan_module_details_t details);
196196

197-
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
198-
swiftscan_swift_textual_detail_get_extra_pcm_args(
199-
swiftscan_module_details_t details);
200-
201197
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
202198
swiftscan_swift_textual_detail_get_context_hash(
203199
swiftscan_module_details_t details);
@@ -283,9 +279,6 @@ swiftscan_clang_detail_get_context_hash(swiftscan_module_details_t details);
283279
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
284280
swiftscan_clang_detail_get_command_line(swiftscan_module_details_t details);
285281

286-
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
287-
swiftscan_clang_detail_get_captured_pcm_args(swiftscan_module_details_t details);
288-
289282
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
290283
swiftscan_clang_detail_get_cas_fs_root_id(swiftscan_module_details_t details);
291284

include/swift/AST/ModuleDependencies.h

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,13 @@ class ModuleDependencyInfoStorageBase {
229229

230230
struct CommonSwiftTextualModuleDependencyDetails {
231231
CommonSwiftTextualModuleDependencyDetails(
232-
ArrayRef<StringRef> extraPCMArgs, ArrayRef<StringRef> buildCommandLine,
232+
ArrayRef<StringRef> buildCommandLine,
233233
StringRef CASFileSystemRootID)
234-
: extraPCMArgs(extraPCMArgs.begin(), extraPCMArgs.end()),
235-
bridgingHeaderFile(std::nullopt),
234+
: bridgingHeaderFile(std::nullopt),
236235
bridgingSourceFiles(), bridgingModuleDependencies(),
237236
buildCommandLine(buildCommandLine.begin(), buildCommandLine.end()),
238237
CASFileSystemRootID(CASFileSystemRootID) {}
239238

240-
/// To build a PCM to be used by this Swift module, we need to append these
241-
/// arguments to the generic PCM build arguments reported from the dependency
242-
/// graph.
243-
const std::vector<std::string> extraPCMArgs;
244-
245239
/// Bridging header file, if there is one.
246240
std::optional<std::string> bridgingHeaderFile;
247241

@@ -299,7 +293,7 @@ class SwiftInterfaceModuleDependenciesStorage
299293
ArrayRef<ScannerImportStatementInfo> moduleImports,
300294
ArrayRef<ScannerImportStatementInfo> optionalModuleImports,
301295
ArrayRef<StringRef> buildCommandLine, ArrayRef<LinkLibrary> linkLibraries,
302-
ArrayRef<StringRef> extraPCMArgs, StringRef contextHash, bool isFramework,
296+
StringRef contextHash, bool isFramework,
303297
bool isStatic, StringRef RootID, StringRef moduleCacheKey,
304298
StringRef userModuleVersion)
305299
: ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftInterface,
@@ -310,7 +304,7 @@ class SwiftInterfaceModuleDependenciesStorage
310304
compiledModuleCandidates(compiledModuleCandidates.begin(),
311305
compiledModuleCandidates.end()),
312306
contextHash(contextHash), isFramework(isFramework), isStatic(isStatic),
313-
textualModuleDetails(extraPCMArgs, buildCommandLine, RootID),
307+
textualModuleDetails(buildCommandLine, RootID),
314308
userModuleVersion(userModuleVersion) {}
315309

316310
ModuleDependencyInfoStorageBase *clone() const override {
@@ -348,11 +342,10 @@ class SwiftSourceModuleDependenciesStorage
348342
StringRef RootID, ArrayRef<StringRef> buildCommandLine,
349343
ArrayRef<ScannerImportStatementInfo> moduleImports,
350344
ArrayRef<ScannerImportStatementInfo> optionalModuleImports,
351-
ArrayRef<StringRef> bridgingHeaderBuildCommandLine,
352-
ArrayRef<StringRef> extraPCMArgs)
345+
ArrayRef<StringRef> bridgingHeaderBuildCommandLine)
353346
: ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftSource,
354347
moduleImports, optionalModuleImports, {}),
355-
textualModuleDetails(extraPCMArgs, buildCommandLine, RootID),
348+
textualModuleDetails(buildCommandLine, RootID),
356349
testableImports(llvm::StringSet<>()),
357350
bridgingHeaderBuildCommandLine(bridgingHeaderBuildCommandLine.begin(),
358351
bridgingHeaderBuildCommandLine.end()) {}
@@ -476,10 +469,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
476469
/// The file dependencies
477470
const std::vector<std::string> fileDependencies;
478471

479-
/// The swift-specific PCM arguments captured by this dependencies object
480-
/// as found by the scanning action that discovered it
481-
const std::vector<std::string> capturedPCMArgs;
482-
483472
/// CASID for the Root of CASFS. Empty if CAS is not used.
484473
std::string CASFileSystemRootID;
485474

@@ -493,7 +482,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
493482
StringRef moduleMapFile, StringRef contextHash,
494483
ArrayRef<std::string> buildCommandLine,
495484
ArrayRef<std::string> fileDependencies,
496-
ArrayRef<std::string> capturedPCMArgs,
497485
ArrayRef<LinkLibrary> linkLibraries,
498486
StringRef CASFileSystemRootID,
499487
StringRef clangIncludeTreeRoot,
@@ -504,7 +492,6 @@ class ClangModuleDependencyStorage : public ModuleDependencyInfoStorageBase {
504492
pcmOutputPath(pcmOutputPath), mappedPCMPath(mappedPCMPath),
505493
moduleMapFile(moduleMapFile), contextHash(contextHash),
506494
buildCommandLine(buildCommandLine), fileDependencies(fileDependencies),
507-
capturedPCMArgs(capturedPCMArgs),
508495
CASFileSystemRootID(CASFileSystemRootID),
509496
CASClangIncludeTreeRootID(clangIncludeTreeRoot), IsSystem(IsSystem) {}
510497

@@ -588,15 +575,15 @@ class ModuleDependencyInfo {
588575
ArrayRef<StringRef> compiledCandidates, ArrayRef<StringRef> buildCommands,
589576
ArrayRef<ScannerImportStatementInfo> moduleImports,
590577
ArrayRef<ScannerImportStatementInfo> optionalModuleImports,
591-
ArrayRef<LinkLibrary> linkLibraries, ArrayRef<StringRef> extraPCMArgs,
578+
ArrayRef<LinkLibrary> linkLibraries,
592579
StringRef contextHash, bool isFramework, bool isStatic,
593580
StringRef CASFileSystemRootID, StringRef moduleCacheKey,
594581
StringRef userModuleVersion) {
595582
return ModuleDependencyInfo(
596583
std::make_unique<SwiftInterfaceModuleDependenciesStorage>(
597584
moduleOutputPath, swiftInterfaceFile, compiledCandidates,
598585
moduleImports, optionalModuleImports,
599-
buildCommands, linkLibraries, extraPCMArgs, contextHash,
586+
buildCommands, linkLibraries, contextHash,
600587
isFramework, isStatic, CASFileSystemRootID, moduleCacheKey,
601588
userModuleVersion));
602589
}
@@ -624,13 +611,11 @@ class ModuleDependencyInfo {
624611
ArrayRef<StringRef> buildCommands,
625612
ArrayRef<ScannerImportStatementInfo> moduleImports,
626613
ArrayRef<ScannerImportStatementInfo> optionalModuleImports,
627-
ArrayRef<StringRef> bridgingHeaderBuildCommands,
628-
ArrayRef<StringRef> extraPCMArgs) {
614+
ArrayRef<StringRef> bridgingHeaderBuildCommands) {
629615
return ModuleDependencyInfo(
630616
std::make_unique<SwiftSourceModuleDependenciesStorage>(
631617
CASFileSystemRootID, buildCommands, moduleImports,
632-
optionalModuleImports, bridgingHeaderBuildCommands,
633-
extraPCMArgs));
618+
optionalModuleImports, bridgingHeaderBuildCommands));
634619
}
635620

636621
static ModuleDependencyInfo
@@ -640,7 +625,6 @@ class ModuleDependencyInfo {
640625
StringRef(), ArrayRef<StringRef>(),
641626
ArrayRef<ScannerImportStatementInfo>(),
642627
ArrayRef<ScannerImportStatementInfo>(),
643-
ArrayRef<StringRef>(),
644628
ArrayRef<StringRef>()));
645629
}
646630

@@ -650,12 +634,11 @@ class ModuleDependencyInfo {
650634
StringRef pcmOutputPath, StringRef mappedPCMPath, StringRef moduleMapFile,
651635
StringRef contextHash, ArrayRef<std::string> nonPathCommandLine,
652636
ArrayRef<std::string> fileDependencies,
653-
ArrayRef<std::string> capturedPCMArgs,
654637
ArrayRef<LinkLibrary> linkLibraries, StringRef CASFileSystemRootID,
655638
StringRef clangIncludeTreeRoot, StringRef moduleCacheKey, bool IsSystem) {
656639
return ModuleDependencyInfo(std::make_unique<ClangModuleDependencyStorage>(
657640
pcmOutputPath, mappedPCMPath, moduleMapFile, contextHash,
658-
nonPathCommandLine, fileDependencies, capturedPCMArgs, linkLibraries,
641+
nonPathCommandLine, fileDependencies, linkLibraries,
659642
CASFileSystemRootID, clangIncludeTreeRoot, moduleCacheKey, IsSystem));
660643
}
661644

include/swift/AST/ModuleLoader.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ struct SubCompilerInstanceInfo {
184184
CompilerInstance* Instance;
185185
StringRef Hash;
186186
ArrayRef<StringRef> BuildArguments;
187-
ArrayRef<StringRef> ExtraPCMArgs;
188187
};
189188

190189
/// Abstract interface for a checker of module interfaces and prebuilt modules.
@@ -213,7 +212,6 @@ struct InterfaceSubContextDelegate {
213212
StringRef outputPath,
214213
SourceLoc diagLoc,
215214
llvm::function_ref<std::error_code(ASTContext&, ModuleDecl*,
216-
ArrayRef<StringRef>,
217215
ArrayRef<StringRef>, StringRef,
218216
StringRef)> action) = 0;
219217
virtual std::error_code runInSubCompilerInstance(StringRef moduleName,

include/swift/DependencyScan/DependencyScanImpl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ typedef struct {
107107
/// Options to the compile command required to build bridging header.
108108
swiftscan_string_set_t *bridging_pch_command_line;
109109

110-
/// To build a PCM to be used by this Swift module, we need to append these
111-
/// arguments to the generic PCM build arguments reported from the dependency
112-
/// graph.
113-
swiftscan_string_set_t *extra_pcm_args;
114-
115110
/// The hash value that will be used for the generated module
116111
swiftscan_string_ref_t context_hash;
117112

@@ -201,9 +196,6 @@ typedef struct {
201196
/// Options to the compile command required to build this clang modulemap
202197
swiftscan_string_set_t *command_line;
203198

204-
/// The swift-specific PCM arguments captured by this dependencies object
205-
swiftscan_string_set_t *captured_pcm_args;
206-
207199
/// The CASID for CASFileSystemRoot
208200
swiftscan_string_ref_t cas_fs_root_id;
209201

include/swift/DependencyScan/SerializedModuleDependencyCacheFormat.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ using SwiftInterfaceModuleDetailsLayout =
203203
FileIDField, // swiftInterfaceFile
204204
FileIDArrayIDField, // compiledModuleCandidates
205205
FlagIDArrayIDField, // buildCommandLine
206-
FlagIDArrayIDField, // extraPCMArgs
207206
ContextHashIDField, // contextHash
208207
IsFrameworkField, // isFramework
209208
IsStaticField, // isStatic
@@ -219,7 +218,6 @@ using SwiftInterfaceModuleDetailsLayout =
219218

220219
using SwiftSourceModuleDetailsLayout =
221220
BCRecordLayout<SWIFT_SOURCE_MODULE_DETAILS_NODE, // ID
222-
FlagIDArrayIDField, // extraPCMArgs
223221
FileIDField, // bridgingHeaderFile
224222
FileIDArrayIDField, // sourceFiles
225223
FileIDArrayIDField, // bridgingSourceFiles
@@ -260,7 +258,6 @@ using ClangModuleDetailsLayout =
260258
ContextHashIDField, // contextHash
261259
FlagIDArrayIDField, // commandLine
262260
FileIDArrayIDField, // fileDependencies
263-
FlagIDArrayIDField, // capturedPCMArgs
264261
IdentifierIDField, // CASFileSystemRootID
265262
IdentifierIDField, // clangIncludeTreeRoot
266263
IdentifierIDField, // moduleCacheKey

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
690690
StringRef outputPath,
691691
SourceLoc diagLoc,
692692
llvm::function_ref<std::error_code(ASTContext&, ModuleDecl*,
693-
ArrayRef<StringRef>, ArrayRef<StringRef>,
693+
ArrayRef<StringRef>,
694694
StringRef, StringRef)> action) override;
695695
std::error_code runInSubCompilerInstance(StringRef moduleName,
696696
StringRef interfacePath,

lib/ClangImporter/ClangModuleDependencyScanner.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
147147
return path.str();
148148
};
149149

150-
// This scanner invocation's already-captured APINotes version
151-
std::vector<std::string>
152-
capturedPCMArgs = {
153-
"-Xcc",
154-
("-fapinotes-swift-version=" +
155-
ctx.LangOpts.EffectiveLanguageVersion.asAPINotesVersionString())};
156-
157150
for (auto &clangModuleDep : clangDependencies) {
158151
// File dependencies for this module.
159152
std::vector<std::string> fileDeps;
@@ -281,7 +274,7 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
281274
llvm::StringSet<> alreadyAddedModules;
282275
auto dependencies = ModuleDependencyInfo::forClangModule(
283276
pcmPath, mappedPCMPath, clangModuleDep.ClangModuleMapFile,
284-
clangModuleDep.ID.ContextHash, swiftArgs, fileDeps, capturedPCMArgs,
277+
clangModuleDep.ID.ContextHash, swiftArgs, fileDeps,
285278
LinkLibraries, RootID, IncludeTree, /*module-cache-key*/ "",
286279
clangModuleDep.IsSystem);
287280

0 commit comments

Comments
 (0)