Skip to content

Commit 87452c6

Browse files
committed
Remove string compute logic
1 parent ea8a053 commit 87452c6

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,8 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
6060
<< InterfaceFormatVersion << "\n";
6161
out << "// " SWIFT_COMPILER_VERSION_KEY ": "
6262
<< ToolsVersion << "\n";
63-
64-
// Check if printing package-name is disabled for
65-
// non-package interfaces (by default, it's printed
66-
// in all interfaces).
67-
std::string flagsStr = Opts.Flags;
68-
if (Opts.DisablePackageNameForNonPackageInterface &&
69-
!Opts.printPackageInterface()) {
70-
size_t pkgIdx = 0;
71-
size_t end = flagsStr.size();
72-
auto pkgFlag = StringRef("-package-name ");
73-
size_t pkgLen = pkgFlag.size();
74-
75-
// Find the package-name flag and its value and
76-
// drop them. There can be multiple package-name
77-
// flags passed, so drop them all.
78-
while (pkgIdx < end) {
79-
// First, find "-package-name "
80-
pkgIdx = flagsStr.find(pkgFlag, 0);
81-
if (pkgIdx == std::string::npos)
82-
break;
83-
// If found, find the next flag's starting pos.
84-
auto next = flagsStr.find_first_of("-", pkgIdx + pkgLen + 1);
85-
// Remove the substr in-place.
86-
flagsStr.erase(pkgIdx, next - pkgIdx);
87-
}
88-
}
89-
9063
out << "// " SWIFT_MODULE_FLAGS_KEY ": "
91-
<< flagsStr;
64+
<< Opts.Flags;
9265

9366
// Adding package-name can be disabled in non-package
9467
// swiftinterfaces; add only to package.swiftinterface

0 commit comments

Comments
 (0)