@@ -39,10 +39,9 @@ using llvm::BCVBR;
39
39
40
40
// / Every .moddepcache file begins with these 4 bytes, for easy identification.
41
41
const unsigned char MODULE_DEPENDENCY_CACHE_FORMAT_SIGNATURE[] = {' I' , ' M' , ' D' ,' C' };
42
- const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR =
43
- 7 ; // isSystem
42
+ const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MAJOR = 8 ;
44
43
// / Increment this on every change.
45
- const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 1 ;
44
+ const unsigned MODULE_DEPENDENCY_CACHE_FORMAT_VERSION_MINOR = 0 ;
46
45
47
46
// / Various identifiers in this format will rely on having their strings mapped
48
47
// / using this ID.
@@ -57,6 +56,14 @@ using IsFrameworkField = BCFixed<1>;
57
56
using IsSystemField = BCFixed<1 >;
58
57
// / A bit that indicates whether or not a module is that of a static archive
59
58
using IsStaticField = BCFixed<1 >;
59
+ // / A bit taht indicates whether or not a link library is a force-load one
60
+ using IsForceLoadField = BCFixed<1 >;
61
+ // / A bit taht indicates whether or not an import statement is optional
62
+ using IsOptionalImport = BCFixed<1 >;
63
+
64
+ // / Source location fields
65
+ using LineNumberField = BCFixed<32 >;
66
+ using ColumnNumberField = BCFixed<32 >;
60
67
61
68
// / Arrays of various identifiers, distinguished for readability
62
69
using IdentifierIDArryField = llvm::BCArray<IdentifierIDField>;
@@ -65,9 +72,14 @@ using ModuleIDArryField = llvm::BCArray<IdentifierIDField>;
65
72
// / Identifiers used to refer to the above arrays
66
73
using FileIDArrayIDField = IdentifierIDField;
67
74
using ContextHashIDField = IdentifierIDField;
75
+ using ModuleCacheKeyIDField = IdentifierIDField;
68
76
using ImportArrayIDField = IdentifierIDField;
77
+ using LinkLibrariesArrayIDField = IdentifierIDField;
78
+ using MacroDependenciesArrayIDField = IdentifierIDField;
69
79
using FlagIDArrayIDField = IdentifierIDField;
70
80
using DependencyIDArrayIDField = IdentifierIDField;
81
+ using AuxiliaryFilesArrayIDField = IdentifierIDField;
82
+ using SourceLocationIDArrayIDField = IdentifierIDField;
71
83
72
84
// / The ID of the top-level block containing the dependency graph
73
85
const unsigned GRAPH_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID;
@@ -76,11 +88,20 @@ const unsigned GRAPH_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID;
76
88
// / zero or more IDENTIFIER records that contain various strings seen in the graph
77
89
// / (e.g. file names or compiler flags), followed by zero or more IDENTIFIER_ARRAY records
78
90
// / which are arrays of identifiers seen in the graph (e.g. list of source files or list of compile flags),
91
+ // / followed by zero or more LINK_LIBRARY_NODE records along with associated
92
+ // /
79
93
// / followed by zero or more MODULE_NODE, *_DETAILS_NODE pairs of records.
80
94
namespace graph_block {
81
95
enum {
82
96
METADATA = 1 ,
83
97
MODULE_NODE,
98
+ LINK_LIBRARY_NODE,
99
+ LINK_LIBRARY_ARRAY_NODE,
100
+ MACRO_DEPENDENCY_NODE,
101
+ MACRO_DEPENDENCY_ARRAY_NODE,
102
+ IMPORT_STATEMENT_NODE,
103
+ IMPORT_STATEMENT_ARRAY_NODE,
104
+ OPTIONAL_IMPORT_STATEMENT_ARRAY_NODE,
84
105
SWIFT_INTERFACE_MODULE_DETAILS_NODE,
85
106
SWIFT_SOURCE_MODULE_DETAILS_NODE,
86
107
SWIFT_PLACEHOLDER_MODULE_DETAILS_NODE,
@@ -95,7 +116,7 @@ using MetadataLayout = BCRecordLayout<
95
116
METADATA, // ID
96
117
BCFixed<16 >, // Inter-Module Dependency graph format major version
97
118
BCFixed<16 >, // Inter-Module Dependency graph format minor version
98
- BCBlob // Compiler version string
119
+ BCBlob // Scanner Invocation Context Hash
99
120
>;
100
121
101
122
// After the metadata record, we have zero or more identifier records,
@@ -117,6 +138,43 @@ using IdentifierNodeLayout = BCRecordLayout<IDENTIFIER_NODE, BCBlob>;
117
138
using IdentifierArrayLayout =
118
139
BCRecordLayout<IDENTIFIER_ARRAY_NODE, IdentifierIDArryField>;
119
140
141
+ // ACTODO: Comment
142
+ using LinkLibraryLayout =
143
+ BCRecordLayout<LINK_LIBRARY_NODE, // ID
144
+ IdentifierIDField, // libraryName
145
+ IsFrameworkField, // isFramework
146
+ IsForceLoadField // forceLoad
147
+ >;
148
+ // ACTODO: Comment
149
+ using LinkLibraryArrayLayout =
150
+ BCRecordLayout<LINK_LIBRARY_ARRAY_NODE, IdentifierIDArryField>;
151
+
152
+ // ACTODO: Comment
153
+ using MacroDependencyLayout =
154
+ BCRecordLayout<MACRO_DEPENDENCY_NODE, // ID
155
+ IdentifierIDField, // macroModuleName
156
+ IdentifierIDField, // libraryPath
157
+ IdentifierIDField // executablePath
158
+ >;
159
+ // ACTODO: Comment
160
+ using MacroDependencyArrayLayout =
161
+ BCRecordLayout<MACRO_DEPENDENCY_ARRAY_NODE, IdentifierIDArryField>;
162
+
163
+ // ACTODO: Comment
164
+ using ImportStatementLayout =
165
+ BCRecordLayout<IMPORT_STATEMENT_NODE, // ID
166
+ IdentifierIDField, // importIdentifier
167
+ IdentifierIDField, // bufferIdentifier
168
+ LineNumberField, // lineNumber
169
+ ColumnNumberField, // columnNumber
170
+ IsOptionalImport // isOptional
171
+ >;
172
+ // ACTODO: Comment
173
+ using ImportStatementArrayLayout =
174
+ BCRecordLayout<IMPORT_STATEMENT_ARRAY_NODE, IdentifierIDArryField>;
175
+ using OptionalImportStatementArrayLayout =
176
+ BCRecordLayout<OPTIONAL_IMPORT_STATEMENT_ARRAY_NODE, IdentifierIDArryField>;
177
+
120
178
// After the array records, we have a sequence of Module info
121
179
// records, each of which is followed by one of:
122
180
// - SwiftInterfaceModuleDetails
@@ -125,12 +183,18 @@ using IdentifierArrayLayout =
125
183
// - SwiftPlaceholderModuleDetails
126
184
// - ClangModuleDetails
127
185
using ModuleInfoLayout =
128
- BCRecordLayout<MODULE_NODE, // ID
129
- IdentifierIDField, // moduleName
130
- ContextHashIDField, // contextHash
131
- ImportArrayIDField, // moduleImports
132
- ImportArrayIDField, // optionalModuleImports
133
- DependencyIDArrayIDField // resolvedDirectModuleDependencies
186
+ BCRecordLayout<MODULE_NODE, // ID
187
+ IdentifierIDField, // moduleName
188
+ ImportArrayIDField, // imports
189
+ ImportArrayIDField, // optionalImports
190
+ LinkLibrariesArrayIDField, // linkLibraries
191
+ MacroDependenciesArrayIDField, // macroDependencies
192
+ DependencyIDArrayIDField, // importedSwiftModules
193
+ DependencyIDArrayIDField, // importedClangModules
194
+ DependencyIDArrayIDField, // crossImportOverlayModules
195
+ DependencyIDArrayIDField, // swiftOverlayDependencies
196
+ ModuleCacheKeyIDField, // moduleCacheKey
197
+ AuxiliaryFilesArrayIDField // auxiliaryFiles
134
198
>;
135
199
136
200
using SwiftInterfaceModuleDetailsLayout =
@@ -147,7 +211,6 @@ using SwiftInterfaceModuleDetailsLayout =
147
211
FileIDArrayIDField, // sourceFiles
148
212
FileIDArrayIDField, // bridgingSourceFiles
149
213
IdentifierIDField, // bridgingModuleDependencies
150
- DependencyIDArrayIDField, // swiftOverlayDependencies
151
214
IdentifierIDField, // CASFileSystemRootID
152
215
IdentifierIDField, // bridgingHeaderIncludeTree
153
216
IdentifierIDField, // moduleCacheKey
@@ -161,7 +224,6 @@ using SwiftSourceModuleDetailsLayout =
161
224
FileIDArrayIDField, // sourceFiles
162
225
FileIDArrayIDField, // bridgingSourceFiles
163
226
FileIDArrayIDField, // bridgingModuleDependencies
164
- DependencyIDArrayIDField, // swiftOverlayDependencies
165
227
IdentifierIDField, // CASFileSystemRootID
166
228
IdentifierIDField, // bridgingHeaderIncludeTree
167
229
FlagIDArrayIDField, // buildCommandLine
@@ -173,8 +235,8 @@ using SwiftBinaryModuleDetailsLayout =
173
235
FileIDField, // compiledModulePath
174
236
FileIDField, // moduleDocPath
175
237
FileIDField, // moduleSourceInfoPath
176
- DependencyIDArrayIDField, // swiftOverlayDependencies
177
238
FileIDField, // headerImport
239
+ FileIDField, // definingInterfacePath
178
240
IdentifierIDField, // headerModuleDependencies
179
241
FileIDArrayIDField, // headerSourceFiles
180
242
IsFrameworkField, // isFramework
@@ -220,7 +282,7 @@ bool readInterModuleDependenciesCache(llvm::StringRef path,
220
282
// / Returns true if there was an error.
221
283
bool writeInterModuleDependenciesCache (DiagnosticEngine &diags,
222
284
llvm::vfs::OutputBackend &backend,
223
- llvm::StringRef path ,
285
+ llvm::StringRef outputPath ,
224
286
const ModuleDependenciesCache &cache);
225
287
226
288
// / Tries to write out the given dependency cache with the given
0 commit comments