File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,14 @@ StringRef getSwiftRevision();
167
167
// / and \c getCurrentCompilerTag returns the version tuple in string format.
168
168
bool isCurrentCompilerTagged ();
169
169
170
- // / Retrieves the distribtion tag of the running compiler, if any.
170
+ // / Retrieves the distribution tag of the running compiler, if any.
171
171
StringRef getCurrentCompilerTag ();
172
172
173
+ // / Retrieves the distribution tag of the running compiler for serialization,
174
+ // / if any. This can hold more information than \c getCurrentCompilerTag
175
+ // / depending on the vendor.
176
+ StringRef getCurrentCompilerSerializationTag ();
177
+
173
178
} // end namespace version
174
179
} // end namespace swift
175
180
Original file line number Diff line number Diff line change @@ -297,5 +297,13 @@ StringRef getCurrentCompilerTag() {
297
297
#endif
298
298
}
299
299
300
+ StringRef getCurrentCompilerSerializationTag () {
301
+ #ifdef SWIFT_COMPILER_VERSION
302
+ return SWIFT_COMPILER_VERSION;
303
+ #else
304
+ return StringRef ();
305
+ #endif
306
+ }
307
+
300
308
} // end namespace version
301
309
} // end namespace swift
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ static ValidationInfo validateControlBlock(
370
370
if (forcedDebugRevision ||
371
371
(requiresRevisionMatch && version::isCurrentCompilerTagged ())) {
372
372
StringRef compilerRevision = forcedDebugRevision ?
373
- forcedDebugRevision : version::getCurrentCompilerTag ();
373
+ forcedDebugRevision : version::getCurrentCompilerSerializationTag ();
374
374
if (moduleRevision != compilerRevision) {
375
375
result.status = Status::RevisionIncompatible;
376
376
Original file line number Diff line number Diff line change @@ -1011,7 +1011,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1011
1011
static const char * forcedDebugRevision =
1012
1012
::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION" );
1013
1013
auto revision = forcedDebugRevision ?
1014
- forcedDebugRevision : version::getCurrentCompilerTag ();
1014
+ forcedDebugRevision : version::getCurrentCompilerSerializationTag ();
1015
1015
Revision.emit (ScratchRecord, revision);
1016
1016
1017
1017
IsOSSA.emit (ScratchRecord, options.IsOSSA );
You can’t perform that action at this time.
0 commit comments