Skip to content

[clang] Use llvm::append_range (NFC) #136256

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: 2 additions & 2 deletions clang/lib/CodeGen/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ bool AArch64ABIInfo::passAsPureScalableType(
return false;

for (uint64_t I = 0; I < NElt; ++I)
llvm::copy(EltCoerceToSeq, std::back_inserter(CoerceToSeq));
llvm::append_range(CoerceToSeq, EltCoerceToSeq);

NVec += NElt * NV;
NPred += NElt * NP;
Expand Down Expand Up @@ -818,7 +818,7 @@ void AArch64ABIInfo::flattenType(
flattenType(AT->getElementType(), EltFlattened);

for (uint64_t I = 0; I < NElt; ++I)
llvm::copy(EltFlattened, std::back_inserter(Flattened));
llvm::append_range(Flattened, EltFlattened);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Driver/XRayArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) {
// Get the list of modes we want to support.
auto SpecifiedModes = Args.getAllArgValues(options::OPT_fxray_modes);
if (SpecifiedModes.empty())
llvm::copy(XRaySupportedModes, std::back_inserter(Modes));
llvm::append_range(Modes, XRaySupportedModes);
else
for (const auto &Arg : SpecifiedModes) {
// Parse CSV values for -fxray-modes=...
Expand All @@ -167,7 +167,7 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) {
if (M == "none")
Modes.clear();
else if (M == "all")
llvm::copy(XRaySupportedModes, std::back_inserter(Modes));
llvm::append_range(Modes, XRaySupportedModes);
else
Modes.push_back(std::string(M));
}
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Sema/SemaConcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,8 +2012,8 @@ FormulaType SubsumptionChecker::Normalize(const NormalizedConstraint &NC) {
for (const auto &RTransform : Right) {
Clause Combined;
Combined.reserve(LTransform.size() + RTransform.size());
llvm::copy(LTransform, std::back_inserter(Combined));
llvm::copy(RTransform, std::back_inserter(Combined));
llvm::append_range(Combined, LTransform);
llvm::append_range(Combined, RTransform);
Add(std::move(Combined));
}
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void SemaSYCL::deepTypeCheckForDevice(SourceLocation UsedAt,
// When nullptr is discovered, this means we've gone back up a level, so
// the history should be cleaned.
StackForRecursion.push_back(nullptr);
llvm::copy(RecDecl->fields(), std::back_inserter(StackForRecursion));
llvm::append_range(StackForRecursion, RecDecl->fields());
}
} while (!StackForRecursion.empty());
}
Expand Down
2 changes: 1 addition & 1 deletion clang/tools/clang-installapi/ClangInstallAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static bool runFrontend(StringRef ProgName, Twine Label, bool Verbose,
// headers.
std::vector<std::string> Args = {ProgName.data(), "-target",
Ctx.Slice->getTriple().str().c_str()};
llvm::copy(InitialArgs, std::back_inserter(Args));
llvm::append_range(Args, InitialArgs);
Args.push_back(InputFile);

// Create & run invocation.
Expand Down
4 changes: 2 additions & 2 deletions clang/tools/clang-installapi/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ Options::processAndFilterOutInstallAPIOptions(ArrayRef<const char *> Args) {
if (A->getOption().getID() > (unsigned)OPT_UNKNOWN) {
ClangDriverArgs.push_back(A->getSpelling().data());
} else
llvm::copy(A->getValues(), std::back_inserter(ClangDriverArgs));
llvm::append_range(ClangDriverArgs, A->getValues());
}
return ClangDriverArgs;
}
Expand Down Expand Up @@ -751,7 +751,7 @@ Options::Options(DiagnosticsEngine &Diag, FileManager *FM,
if (A->isClaimed())
continue;
FrontendArgs.emplace_back(A->getSpelling());
llvm::copy(A->getValues(), std::back_inserter(FrontendArgs));
llvm::append_range(FrontendArgs, A->getValues());
}
}

Expand Down
2 changes: 1 addition & 1 deletion clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args,
else
Arg->render(Args, LinkerArgs);
}
llvm::copy(LinkerArgs, std::back_inserter(CmdArgs));
llvm::append_range(CmdArgs, LinkerArgs);
}

// Pass on -mllvm options to the linker invocation.
Expand Down
Loading