Skip to content

[llvm] Use llvm::transform (NFC) #137532

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
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
2 changes: 1 addition & 1 deletion llvm/include/llvm/TableGen/DirectiveEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class Clause : public BaseRecord {
StringRef Name = Def->getValueAsString("name");
std::string N = Name.str();
bool Cap = true;
std::transform(N.begin(), N.end(), N.begin(), [&Cap](unsigned char C) {
llvm::transform(N, N.begin(), [&Cap](unsigned char C) {
if (Cap == true) {
C = toUpper(C);
Cap = false;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LVStringPool &llvm::logicalview::getStringPool() { return StringPool; }
// - '//' into '/'
std::string llvm::logicalview::transformPath(StringRef Path) {
std::string Name(Path);
std::transform(Name.begin(), Name.end(), Name.begin(), tolower);
llvm::transform(Name, Name.begin(), tolower);
llvm::replace(Name, '\\', '/');

// Remove all duplicate slashes.
Expand All @@ -47,7 +47,7 @@ std::string llvm::logicalview::transformPath(StringRef Path) {
// '/', '\', '<', '>', '.', ':', '%', '*', '?', '|', '"', ' '.
std::string llvm::logicalview::flattenedFilePath(StringRef Path) {
std::string Name(Path);
std::transform(Name.begin(), Name.end(), Name.begin(), tolower);
llvm::transform(Name, Name.begin(), tolower);

const char *CharSet = "/\\<>.:%*?|\" ";
char *Input = Name.data();
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ bool AArch64InstPrinter::printSysAlias(const MCInst *MI,
return false;

std::string Str = Ins + Name;
std::transform(Str.begin(), Str.end(), Str.begin(), ::tolower);
llvm::transform(Str, Str.begin(), ::tolower);

O << '\t' << Str;
if (NeedsReg) {
Expand Down Expand Up @@ -1077,7 +1077,7 @@ bool AArch64InstPrinter::printSyspAlias(const MCInst *MI,
return false;

std::string Str = Ins + Name;
std::transform(Str.begin(), Str.end(), Str.begin(), ::tolower);
llvm::transform(Str, Str.begin(), ::tolower);

O << '\t' << Str;
O << ", ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ SmallVector<WebAssemblyAsmTypeCheck::StackType, 4>
WebAssemblyAsmTypeCheck::valTypesToStackTypes(
ArrayRef<wasm::ValType> ValTypes) {
SmallVector<StackType, 4> Types(ValTypes.size());
std::transform(ValTypes.begin(), ValTypes.end(), Types.begin(),
[](wasm::ValType Val) -> StackType { return Val; });
llvm::transform(ValTypes, Types.begin(),
[](wasm::ValType Val) -> StackType { return Val; });
return Types;
}

Expand Down
7 changes: 3 additions & 4 deletions llvm/lib/Transforms/Scalar/NewGVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,9 @@ PHIExpression *NewGVN::createPHIExpression(ArrayRef<ValPair> PHIOperands,
HasBackedge = HasBackedge || isBackedge(BB, PHIBlock);
return lookupOperandLeader(P.first) != I;
});
std::transform(Filtered.begin(), Filtered.end(), op_inserter(E),
[&](const ValPair &P) -> Value * {
return lookupOperandLeader(P.first);
});
llvm::transform(Filtered, op_inserter(E), [&](const ValPair &P) -> Value * {
return lookupOperandLeader(P.first);
});
return E;
}

Expand Down