File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,11 @@ std::string getSwiftFullVersion(Version effectiveLanguageVersion =
184184// / this Swift was built.
185185StringRef getSwiftRevision ();
186186
187+ // / Is the running compiler built with a version tag for distribution?
188+ // / When true, \c Version::getCurrentCompilerVersion returns a valid version
189+ // / and \c getSwiftRevision returns the version tuple in string format.
190+ bool isCurrentCompilerTagged ();
191+
187192} // end namespace version
188193} // end namespace swift
189194
Original file line number Diff line number Diff line change @@ -446,5 +446,13 @@ StringRef getSwiftRevision() {
446446#endif
447447}
448448
449+ bool isCurrentCompilerTagged () {
450+ #ifdef SWIFT_COMPILER_VERSION
451+ return true ;
452+ #else
453+ return false ;
454+ #endif
455+ }
456+
449457} // end namespace version
450458} // end namespace swift
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ static ValidationInfo validateControlBlock(
313313 // env var is set (for testing).
314314 static const char * forceDebugPreSDKRestriction =
315315 ::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_PER_SDK" );
316- if (version::Version::getCurrentCompilerVersion (). empty () &&
316+ if (! version::isCurrentCompilerTagged () &&
317317 !forceDebugPreSDKRestriction) {
318318 break ;
319319 }
@@ -354,7 +354,7 @@ static ValidationInfo validateControlBlock(
354354 ::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION" );
355355
356356 bool isCompilerTagged = forcedDebugRevision ||
357- ! version::Version::getCurrentCompilerVersion (). empty ();
357+ version::isCurrentCompilerTagged ();
358358
359359 StringRef moduleRevision = blobData;
360360 if (isCompilerTagged) {
You can’t perform that action at this time.
0 commit comments