File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,12 @@ StringRef getSwiftRevision();
191
191
192
192
// / Is the running compiler built with a version tag for distribution?
193
193
// / When true, \c Version::getCurrentCompilerVersion returns a valid version
194
- // / and \c getSwiftRevision returns the version tuple in string format.
194
+ // / and \c getCurrentCompilerTag returns the version tuple in string format.
195
195
bool isCurrentCompilerTagged ();
196
196
197
+ // / Retrieves the distribtion tag of the running compiler, if any.
198
+ StringRef getCurrentCompilerTag ();
199
+
197
200
} // end namespace version
198
201
} // end namespace swift
199
202
Original file line number Diff line number Diff line change @@ -507,5 +507,13 @@ bool isCurrentCompilerTagged() {
507
507
#endif
508
508
}
509
509
510
+ StringRef getCurrentCompilerTag () {
511
+ #ifdef SWIFT_COMPILER_VERSION
512
+ return SWIFT_COMPILER_VERSION;
513
+ #else
514
+ return StringRef ();
515
+ #endif
516
+ }
517
+
510
518
} // end namespace version
511
519
} // end namespace swift
Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ static ValidationInfo validateControlBlock(
359
359
StringRef moduleRevision = blobData;
360
360
if (isCompilerTagged) {
361
361
StringRef compilerRevision = forcedDebugRevision ?
362
- forcedDebugRevision : version::getSwiftRevision ();
362
+ forcedDebugRevision : version::getCurrentCompilerTag ();
363
363
if (moduleRevision != compilerRevision) {
364
364
result.status = Status::RevisionIncompatible;
365
365
Original file line number Diff line number Diff line change @@ -1004,7 +1004,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
1004
1004
static const char * forcedDebugRevision =
1005
1005
::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION" );
1006
1006
auto revision = forcedDebugRevision ?
1007
- forcedDebugRevision : version::getSwiftRevision ();
1007
+ forcedDebugRevision : version::getCurrentCompilerTag ();
1008
1008
Revision.emit (ScratchRecord, revision);
1009
1009
1010
1010
IsOSSA.emit (ScratchRecord, options.IsOSSA );
You can’t perform that action at this time.
0 commit comments