Skip to content

[Driver] Use a range constructor of StringSet (NFC) #133201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions clang/lib/Driver/Job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ void Command::buildArgvForResponseFile(
return;
}

llvm::StringSet<> Inputs;
for (const auto *InputName : InputFileList)
Inputs.insert(InputName);
llvm::StringSet<> Inputs(llvm::from_range, InputFileList);
Out.push_back(Executable);

if (PrependArg)
Expand Down
8 changes: 2 additions & 6 deletions clang/lib/Driver/Multilib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ void Multilib::print(raw_ostream &OS) const {
bool Multilib::operator==(const Multilib &Other) const {
// Check whether the flags sets match
// allowing for the match to be order invariant
llvm::StringSet<> MyFlags;
for (const auto &Flag : Flags)
MyFlags.insert(Flag);
llvm::StringSet<> MyFlags(llvm::from_range, Flags);

for (const auto &Flag : Other.Flags)
if (!MyFlags.contains(Flag))
Expand Down Expand Up @@ -272,9 +270,7 @@ bool MultilibSet::select(

llvm::StringSet<>
MultilibSet::expandFlags(const Multilib::flags_list &InFlags) const {
llvm::StringSet<> Result;
for (const auto &F : InFlags)
Result.insert(F);
llvm::StringSet<> Result(llvm::from_range, InFlags);
for (const FlagMatcher &M : FlagMatchers) {
std::string RegexString(M.Match);

Expand Down