[Serialization] Use a more reliable macro to get the compiler tag

Use only the SWIFT_COMPILER_VERSION macro to check for swiftmodules
being written by the same compiler that reads it. In practice, it's the
macro used for release builds of the compiler.

rdar://96868333
This commit is contained in:
Alexis Laferrière
2022-07-18 13:02:09 -07:00
parent 82e93806a8
commit 36b87d3c5c
4 changed files with 14 additions and 3 deletions

View File

@@ -1004,7 +1004,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
static const char* forcedDebugRevision =
::getenv("SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION");
auto revision = forcedDebugRevision ?
forcedDebugRevision : version::getSwiftRevision();
forcedDebugRevision : version::getCurrentCompilerTag();
Revision.emit(ScratchRecord, revision);
IsOSSA.emit(ScratchRecord, options.IsOSSA);