Skip to content

Commit 9f7f999

Browse files
committed
[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.
1 parent a7336e8 commit 9f7f999

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
124124
!Opts.PackageFlags.IgnorableFlags.empty())
125125
ignorableFlags.push_back(Opts.PackageFlags.IgnorableFlags);
126126

127-
ignorableFlags.push_back("-interface-compiler-version");
128-
ignorableFlags.push_back(version::getCompilerVersion());
127+
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": ";
129128

130-
if (!ignorableFlags.empty()) {
131-
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": ";
132-
llvm::interleave(
133-
ignorableFlags, [&out](StringRef str) { out << str; },
134-
[&out] { out << " "; });
135-
out << "\n";
136-
}
129+
llvm::interleave(
130+
ignorableFlags, [&out](StringRef str) { out << str; },
131+
[&out] { out << " "; });
132+
133+
out << " -interface-compiler-version " << version::getCompilerVersion();
134+
out << "\n";
137135
}
138136
}
139137

0 commit comments

Comments
 (0)