[ModuleInterface] NFC: Write -interface-compiler-version directly into the output

Instead of storing it in an ignorable attributes, let's emit the
option directly into the output stream to apeace ASAN checker.
This commit is contained in:
Pavel Yaskevich
2024-10-29 09:58:11 -07:00
parent a7336e86f8
commit 9f7f999977

View File

@@ -124,16 +124,14 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
!Opts.PackageFlags.IgnorableFlags.empty())
ignorableFlags.push_back(Opts.PackageFlags.IgnorableFlags);
ignorableFlags.push_back("-interface-compiler-version");
ignorableFlags.push_back(version::getCompilerVersion());
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": ";
if (!ignorableFlags.empty()) {
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": ";
llvm::interleave(
ignorableFlags, [&out](StringRef str) { out << str; },
[&out] { out << " "; });
out << "\n";
}
llvm::interleave(
ignorableFlags, [&out](StringRef str) { out << str; },
[&out] { out << " "; });
out << " -interface-compiler-version " << version::getCompilerVersion();
out << "\n";
}
}