@@ -95,6 +95,7 @@ namespace graph_block {
9595enum {
9696 METADATA = 1 ,
9797 MODULE_NODE,
98+ TIME_NODE,
9899 LINK_LIBRARY_NODE,
99100 LINK_LIBRARY_ARRAY_NODE,
100101 MACRO_DEPENDENCY_NODE,
@@ -113,13 +114,19 @@ enum {
113114
114115// Always the first record in the file.
115116using MetadataLayout = BCRecordLayout<
116- METADATA, // ID
117- BCFixed<16 >, // Inter-Module Dependency graph format major version
118- BCFixed<16 >, // Inter-Module Dependency graph format minor version
119- BCBlob // Scanner Invocation Context Hash
117+ METADATA, // ID
118+ BCFixed<16 >, // Inter-Module Dependency graph format major version
119+ BCFixed<16 >, // Inter-Module Dependency graph format minor version
120+ BCBlob // Scanner Invocation Context Hash
120121 >;
121122
122- // After the metadata record, we have zero or more identifier records,
123+ // After the metadata record, emit serialization time-stamp.
124+ using TimeLayout = BCRecordLayout<
125+ TIME_NODE, // ID
126+ BCBlob // Nanoseconds since epoch as a string
127+ >;
128+
129+ // After the time stamp record, we have zero or more identifier records,
123130// for each unique string that is referenced in the graph.
124131//
125132// Identifiers are referenced by their sequence number, starting from 1.
@@ -138,29 +145,31 @@ using IdentifierNodeLayout = BCRecordLayout<IDENTIFIER_NODE, BCBlob>;
138145using IdentifierArrayLayout =
139146 BCRecordLayout<IDENTIFIER_ARRAY_NODE, IdentifierIDArryField>;
140147
141- // ACTODO: Comment
148+ // A record for a given link library node containing information
149+ // required for the build system client to capture a requirement
150+ // to link a given dependency library.
142151using LinkLibraryLayout =
143152 BCRecordLayout<LINK_LIBRARY_NODE, // ID
144153 IdentifierIDField, // libraryName
145154 IsFrameworkField, // isFramework
146155 IsForceLoadField // forceLoad
147156 >;
148- // ACTODO: Comment
149157using LinkLibraryArrayLayout =
150158 BCRecordLayout<LINK_LIBRARY_ARRAY_NODE, IdentifierIDArryField>;
151159
152- // ACTODO: Comment
160+ // A record for a Macro module dependency of a given dependency
161+ // node.
153162using MacroDependencyLayout =
154163 BCRecordLayout<MACRO_DEPENDENCY_NODE, // ID
155164 IdentifierIDField, // macroModuleName
156165 IdentifierIDField, // libraryPath
157166 IdentifierIDField // executablePath
158167 >;
159- // ACTODO: Comment
160168using MacroDependencyArrayLayout =
161169 BCRecordLayout<MACRO_DEPENDENCY_ARRAY_NODE, IdentifierIDArryField>;
162170
163- // ACTODO: Comment
171+ // A record capturing information about a given 'import' statement
172+ // captured in a dependency node, including its source location.
164173using ImportStatementLayout =
165174 BCRecordLayout<IMPORT_STATEMENT_NODE, // ID
166175 IdentifierIDField, // importIdentifier
@@ -169,7 +178,6 @@ using ImportStatementLayout =
169178 ColumnNumberField, // columnNumber
170179 IsOptionalImport // isOptional
171180 >;
172- // ACTODO: Comment
173181using ImportStatementArrayLayout =
174182 BCRecordLayout<IMPORT_STATEMENT_ARRAY_NODE, IdentifierIDArryField>;
175183using OptionalImportStatementArrayLayout =
@@ -268,12 +276,14 @@ using ClangModuleDetailsLayout =
268276// / Tries to read the dependency graph from the given buffer.
269277// / Returns \c true if there was an error.
270278bool readInterModuleDependenciesCache (llvm::MemoryBuffer &buffer,
271- ModuleDependenciesCache &cache);
279+ ModuleDependenciesCache &cache,
280+ llvm::sys::TimePoint<> &serializedCacheTimeStamp);
272281
273282// / Tries to read the dependency graph from the given path name.
274283// / Returns true if there was an error.
275284bool readInterModuleDependenciesCache (llvm::StringRef path,
276- ModuleDependenciesCache &cache);
285+ ModuleDependenciesCache &cache,
286+ llvm::sys::TimePoint<> &serializedCacheTimeStamp);
277287
278288// / Tries to write the dependency graph to the given path name.
279289// / Returns true if there was an error.
0 commit comments