Skip to content
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

[clang] Use *Set::insert_range (NFC) #132507

Merged
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
Original file line number Diff line number Diff line change
@@ -485,7 +485,7 @@ class ExplodedNodeSet {
if (empty())
Impl = S.Impl;
else
Impl.insert(S.begin(), S.end());
Impl.insert_range(S);
}

iterator begin() { return Impl.begin(); }
2 changes: 1 addition & 1 deletion clang/lib/AST/RecordLayoutBuilder.cpp
Original file line number Diff line number Diff line change
@@ -3304,7 +3304,7 @@ void MicrosoftRecordLayoutBuilder::computeVtorDispSet(
if (MethodRange.begin() == MethodRange.end())
BasesWithOverriddenMethods.insert(MD->getParent());
else
Work.insert(MethodRange.begin(), MethodRange.end());
Work.insert_range(MethodRange);
// We've finished processing this element, remove it from the working set.
Work.erase(MD);
}
2 changes: 1 addition & 1 deletion clang/lib/Analysis/UnsafeBufferUsage.cpp
Original file line number Diff line number Diff line change
@@ -4298,7 +4298,7 @@ static void applyGadgets(const Decl *D, FixableGadgetList FixableGadgets,
HasParm = true;
}
if (HasParm)
GrpsUnionForParms.insert(VarGroup.begin(), VarGroup.end());
GrpsUnionForParms.insert_range(VarGroup);
}
}

2 changes: 1 addition & 1 deletion clang/lib/Driver/Multilib.cpp
Original file line number Diff line number Diff line change
@@ -288,7 +288,7 @@ MultilibSet::expandFlags(const Multilib::flags_list &InFlags) const {
assert(Regex.isValid());
if (llvm::any_of(InFlags,
[&Regex](StringRef F) { return Regex.match(F); })) {
Result.insert(M.Flags.begin(), M.Flags.end());
Result.insert_range(M.Flags);
}
}
return Result;
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaAttr.cpp
Original file line number Diff line number Diff line change
@@ -1267,7 +1267,7 @@ void Sema::ActOnPragmaMSFunction(
return;
}

MSFunctionNoBuiltins.insert(NoBuiltins.begin(), NoBuiltins.end());
MSFunctionNoBuiltins.insert_range(NoBuiltins);
}

void Sema::AddRangeBasedOptnone(FunctionDecl *FD) {
4 changes: 2 additions & 2 deletions clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
@@ -18920,7 +18920,7 @@ void DelegatingCycleHelper(CXXConstructorDecl* Ctor,
// We know that beyond here, we aren't chaining into a cycle.
if (!Target || !Target->isDelegatingConstructor() ||
Target->isInvalidDecl() || Valid.count(TCanonical)) {
Valid.insert(Current.begin(), Current.end());
Valid.insert_range(Current);
Current.clear();
// We've hit a cycle.
} else if (TCanonical == Canonical || Invalid.count(TCanonical) ||
@@ -18947,7 +18947,7 @@ void DelegatingCycleHelper(CXXConstructorDecl* Ctor,
}
}

Invalid.insert(Current.begin(), Current.end());
Invalid.insert_range(Current);
Current.clear();
} else {
DelegatingCycleHelper(Target, Valid, Invalid, Current, S);
3 changes: 1 addition & 2 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
@@ -17944,8 +17944,7 @@ void Sema::PopExpressionEvaluationContext() {
// Otherwise, merge the contexts together.
} else {
Cleanup.mergeFrom(Rec.ParentCleanup);
MaybeODRUseExprs.insert(Rec.SavedMaybeODRUseExprs.begin(),
Rec.SavedMaybeODRUseExprs.end());
MaybeODRUseExprs.insert_range(Rec.SavedMaybeODRUseExprs);
}

// Pop the current expression evaluation context off the stack.
4 changes: 2 additions & 2 deletions clang/lib/Serialization/ASTReaderInternals.h
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ class ASTDeclContextNameLookupTraitBase {
}

// Switch to tracking found IDs in the set.
Found.insert(Data.begin(), Data.end());
Found.insert_range(Data);
}

if (Found.insert(ID).second)
@@ -191,7 +191,7 @@ class LazySpecializationInfoLookupTrait {
}

// Switch to tracking found IDs in the set.
Found.insert(Data.begin(), Data.end());
Found.insert_range(Data);
}

if (Found.insert(Info).second)
2 changes: 1 addition & 1 deletion clang/lib/Serialization/MultiOnDiskHashTable.h
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ template<typename Info> class MultiOnDiskHashTable {

void removeOverriddenTables() {
llvm::DenseSet<file_type> Files;
Files.insert(PendingOverrides.begin(), PendingOverrides.end());
Files.insert_range(PendingOverrides);
// Explicitly capture Files to work around an MSVC 2015 rejects-valid bug.
auto ShouldRemove = [&Files](void *T) -> bool {
auto *ODT = llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(T));
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
Original file line number Diff line number Diff line change
@@ -223,7 +223,7 @@ void CheckerRegistry::initializeRegistry(const CheckerManager &Mgr) {
continue;
}

Tmp.insert(Deps.begin(), Deps.end());
Tmp.insert_range(Deps);

// Enable the checker.
Tmp.insert(&Checker);
2 changes: 1 addition & 1 deletion clang/tools/libclang/Indexing.cpp
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ class ThreadSafeParsedRegions {

void addParsedRegions(ArrayRef<PPRegion> Regions) {
std::lock_guard<std::mutex> MG(Mutex);
ParsedRegions.insert(Regions.begin(), Regions.end());
ParsedRegions.insert_range(Regions);
}
};

Original file line number Diff line number Diff line change
@@ -493,8 +493,7 @@ struct FunctionCallLattice {
if (Other.CalledFunctions.empty())
return LatticeJoinEffect::Unchanged;
const size_t size_before = CalledFunctions.size();
CalledFunctions.insert(Other.CalledFunctions.begin(),
Other.CalledFunctions.end());
CalledFunctions.insert_range(Other.CalledFunctions);
return CalledFunctions.size() == size_before ? LatticeJoinEffect::Unchanged
: LatticeJoinEffect::Changed;
}
2 changes: 1 addition & 1 deletion clang/utils/TableGen/NeonEmitter.cpp
Original file line number Diff line number Diff line change
@@ -1661,7 +1661,7 @@ Intrinsic::DagEmitter::emitDagShuffle(const DagInit *DI) {
}
}

Elts.insert(Revved.begin(), Revved.end());
Elts.insert_range(Revved);
}
};