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 =
184
184
// / this Swift was built.
185
185
StringRef getSwiftRevision ();
186
186
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
+
187
192
} // end namespace version
188
193
} // end namespace swift
189
194
Original file line number Diff line number Diff line change @@ -446,5 +446,13 @@ StringRef getSwiftRevision() {
446
446
#endif
447
447
}
448
448
449
+ bool isCurrentCompilerTagged () {
450
+ #ifdef SWIFT_COMPILER_VERSION
451
+ return true ;
452
+ #else
453
+ return false ;
454
+ #endif
455
+ }
456
+
449
457
} // end namespace version
450
458
} // end namespace swift
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ static ValidationInfo validateControlBlock(
313
313
// env var is set (for testing).
314
314
static const char * forceDebugPreSDKRestriction =
315
315
::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_PER_SDK" );
316
- if (version::Version::getCurrentCompilerVersion (). empty () &&
316
+ if (! version::isCurrentCompilerTagged () &&
317
317
!forceDebugPreSDKRestriction) {
318
318
break ;
319
319
}
@@ -354,7 +354,7 @@ static ValidationInfo validateControlBlock(
354
354
::getenv (" SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION" );
355
355
356
356
bool isCompilerTagged = forcedDebugRevision ||
357
- ! version::Version::getCurrentCompilerVersion (). empty ();
357
+ version::isCurrentCompilerTagged ();
358
358
359
359
StringRef moduleRevision = blobData;
360
360
if (isCompilerTagged) {
You can’t perform that action at this time.
0 commit comments