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();
191191
192192// / Is the running compiler built with a version tag for distribution?
193193// / 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.
195195bool isCurrentCompilerTagged ();
196196
197+ // / Retrieves the distribtion tag of the running compiler, if any.
198+ StringRef getCurrentCompilerTag ();
199+
197200} // end namespace version
198201} // end namespace swift
199202
Original file line number Diff line number Diff line change @@ -507,5 +507,13 @@ bool isCurrentCompilerTagged() {
507507#endif
508508}
509509
510+ StringRef getCurrentCompilerTag () {
511+ #ifdef SWIFT_COMPILER_VERSION
512+ return SWIFT_COMPILER_VERSION;
513+ #else
514+ return StringRef ();
515+ #endif
516+ }
517+
510518} // end namespace version
511519} // end namespace swift
Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ static ValidationInfo validateControlBlock(
359359 StringRef moduleRevision = blobData;
360360 if (isCompilerTagged) {
361361 StringRef compilerRevision = forcedDebugRevision ?
362- forcedDebugRevision : version::getSwiftRevision ();
362+ forcedDebugRevision : version::getCurrentCompilerTag ();
363363 if (moduleRevision != compilerRevision) {
364364 result.status = Status::RevisionIncompatible;
365365
Original file line number Diff line number Diff line change @@ -1004,7 +1004,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
10041004 static const char * forcedDebugRevision =
10051005 ::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION" );
10061006 auto revision = forcedDebugRevision ?
1007- forcedDebugRevision : version::getSwiftRevision ();
1007+ forcedDebugRevision : version::getCurrentCompilerTag ();
10081008 Revision.emit (ScratchRecord, revision);
10091009
10101010 IsOSSA.emit (ScratchRecord, options.IsOSSA );
You can’t perform that action at this time.
0 commit comments