Skip to content

Commit cd4b3bf

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-to-uniform-transforms
2 parents a7e9545 + 6ebb848 commit cd4b3bf

File tree

358 files changed

+26683
-21729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+26683
-21729
lines changed

.github/new-prs-labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ mlgo:
702702
- llvm/unittests/CodeGen/ML*
703703
- llvm/test/CodeGen/MLRegAlloc/**
704704
- llvm/utils/mlgo-utils/**
705+
- llvm/docs/MLGO.rst
705706

706707
tools:llvm-exegesis:
707708
- llvm/tools/llvm-exegesis/**

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3326,7 +3326,7 @@ void BinaryFunction::duplicateConstantIslands() {
33263326
static std::string constructFilename(std::string Filename,
33273327
std::string Annotation,
33283328
std::string Suffix) {
3329-
std::replace(Filename.begin(), Filename.end(), '/', '-');
3329+
llvm::replace(Filename, '/', '-');
33303330
if (!Annotation.empty())
33313331
Annotation.insert(0, "-");
33323332
if (Filename.size() + Annotation.size() + Suffix.size() > MAX_PATH) {

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,10 @@ getUnitForOffset(DIEBuilder &Builder, DWARFContext &DWCtx,
437437
// This is a work around for XCode clang. There is a build error when we
438438
// pass DWCtx.compile_units() to llvm::upper_bound
439439
std::call_once(InitVectorFlag, initCUVector);
440-
auto CUIter = std::upper_bound(CUOffsets.begin(), CUOffsets.end(), Offset,
441-
[](uint64_t LHS, const DWARFUnit *RHS) {
442-
return LHS < RHS->getNextUnitOffset();
443-
});
440+
auto CUIter = llvm::upper_bound(CUOffsets, Offset,
441+
[](uint64_t LHS, const DWARFUnit *RHS) {
442+
return LHS < RHS->getNextUnitOffset();
443+
});
444444
CU = CUIter != CUOffsets.end() ? (*CUIter) : nullptr;
445445
}
446446
return CU;

bolt/lib/Passes/AsmDump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void dumpFunction(const BinaryFunction &BF) {
109109
}
110110

111111
std::string PrintName = BF.getPrintName();
112-
std::replace(PrintName.begin(), PrintName.end(), '/', '-');
112+
llvm::replace(PrintName, '/', '-');
113113
std::string Filename =
114114
opts::AsmDump.empty()
115115
? (PrintName + ".s")

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const char *dynoStatsOptName(const bolt::DynoStats::Category C) {
3535

3636
OptNames[C] = bolt::DynoStats::Description(C);
3737

38-
std::replace(OptNames[C].begin(), OptNames[C].end(), ' ', '-');
38+
llvm::replace(OptNames[C], ' ', '-');
3939

4040
return OptNames[C].c_str();
4141
}

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,12 +1022,12 @@ static llvm::Error serializeIndex(ClangDocContext &CDCtx) {
10221022
// JavaScript from escaping characters incorrectly, and introducing bad paths
10231023
// in the URLs.
10241024
std::string RootPathEscaped = RootPath.str().str();
1025-
std::replace(RootPathEscaped.begin(), RootPathEscaped.end(), '\\', '/');
1025+
llvm::replace(RootPathEscaped, '\\', '/');
10261026
OS << "var RootPath = \"" << RootPathEscaped << "\";\n";
10271027

10281028
llvm::SmallString<128> Base(CDCtx.Base);
10291029
std::string BaseEscaped = Base.str().str();
1030-
std::replace(BaseEscaped.begin(), BaseEscaped.end(), '\\', '/');
1030+
llvm::replace(BaseEscaped, '\\', '/');
10311031
OS << "var Base = \"" << BaseEscaped << "\";\n";
10321032

10331033
CDCtx.Idx.sort();

clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ std::string LLVMHeaderGuardCheck::getHeaderGuard(StringRef Filename,
4949
if (PosLLVM != StringRef::npos)
5050
Guard = Guard.substr(PosLLVM);
5151

52-
std::replace(Guard.begin(), Guard.end(), '/', '_');
53-
std::replace(Guard.begin(), Guard.end(), '.', '_');
54-
std::replace(Guard.begin(), Guard.end(), '-', '_');
52+
llvm::replace(Guard, '/', '_');
53+
llvm::replace(Guard, '.', '_');
54+
llvm::replace(Guard, '-', '_');
5555

5656
// The prevalent style in clang is LLVM_CLANG_FOO_BAR_H
5757
if (StringRef(Guard).starts_with("clang"))

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void IdentifierNamingCheck::HungarianNotation::loadFileConfig(
496496
StringRef Val = Options.get(Buffer, "");
497497
if (!Val.empty()) {
498498
std::string Type = PrimType.str();
499-
std::replace(Type.begin(), Type.end(), '-', ' ');
499+
llvm::replace(Type, '-', ' ');
500500
HNOption.PrimitiveType[Type] = Val.str();
501501
}
502502
}
@@ -1358,7 +1358,7 @@ IdentifierNamingCheck::getFailureInfo(
13581358
std::string KindName =
13591359
fixupWithCase(Type, StyleNames[SK], ND, Style, HNOption,
13601360
IdentifierNamingCheck::CT_LowerCase);
1361-
std::replace(KindName.begin(), KindName.end(), '_', ' ');
1361+
llvm::replace(KindName, '_', ' ');
13621362

13631363
std::string Fixup = fixupWithStyle(Type, Name, Style, HNOption, ND);
13641364
if (StringRef(Fixup) == Name) {

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
800800
M << "'";
801801
}
802802
// Don't allow source code to inject newlines into diagnostics.
803-
std::replace(Message.begin(), Message.end(), '\n', ' ');
803+
llvm::replace(Message, '\n', ' ');
804804
}
805805
}
806806
if (Message.empty()) // either !SyntheticMessage, or we failed to make one.

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ LLVM_ATTRIBUTE_UNUSED std::string nodeToString(const DynTypedNode &N) {
5757
OS << ": ";
5858
N.print(OS, PrintingPolicy(LangOptions()));
5959
}
60-
std::replace(S.begin(), S.end(), '\n', ' ');
60+
llvm::replace(S, '\n', ' ');
6161
return S;
6262
}
6363

clang-tools-extra/clangd/index/FileIndex.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ SlabTuple indexSymbols(ASTContext &AST, Preprocessor &PP,
7979

8080
SymbolCollector Collector(std::move(CollectorOpts));
8181
Collector.setPreprocessor(PP);
82-
index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector, IndexOpts);
82+
index::indexTopLevelDecls(AST, PP, DeclsToIndex, Collector,
83+
std::move(IndexOpts));
8384
if (MacroRefsToIndex)
8485
Collector.handleMacros(*MacroRefsToIndex);
8586

clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ std::unique_ptr<SymbolIndex> openIndex(llvm::StringRef Index) {
381381

382382
bool runCommand(std::string Request, const SymbolIndex &Index) {
383383
// Split on spaces and add required null-termination.
384-
std::replace(Request.begin(), Request.end(), ' ', '\0');
384+
llvm::replace(Request, ' ', '\0');
385385
llvm::SmallVector<llvm::StringRef> Args;
386386
llvm::StringRef(Request).split(Args, '\0', /*MaxSplit=*/-1,
387387
/*KeepEmpty=*/false);

clang-tools-extra/modularize/ModularizeUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static std::string replaceDotDot(StringRef Path) {
443443
// \returns The file path in canonical form.
444444
std::string ModularizeUtilities::getCanonicalPath(StringRef FilePath) {
445445
std::string Tmp(replaceDotDot(FilePath));
446-
std::replace(Tmp.begin(), Tmp.end(), '\\', '/');
446+
llvm::replace(Tmp, '\\', '/');
447447
StringRef Tmp2(Tmp);
448448
if (Tmp2.starts_with("./"))
449449
Tmp = std::string(Tmp2.substr(2));

clang-tools-extra/modularize/ModuleAssistant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ ensureNoCollisionWithReservedName(llvm::StringRef MightBeReservedName) {
156156
static std::string
157157
ensureVaidModuleName(llvm::StringRef MightBeInvalidName) {
158158
std::string SafeName(MightBeInvalidName);
159-
std::replace(SafeName.begin(), SafeName.end(), '-', '_');
160-
std::replace(SafeName.begin(), SafeName.end(), '.', '_');
159+
llvm::replace(SafeName, '-', '_');
160+
llvm::replace(SafeName, '.', '_');
161161
if (isdigit(SafeName[0]))
162162
SafeName = "_" + SafeName;
163163
return SafeName;
@@ -192,7 +192,7 @@ static bool addModuleDescription(Module *RootModule,
192192
return true;
193193
}
194194
// Make canonical.
195-
std::replace(FilePath.begin(), FilePath.end(), '\\', '/');
195+
llvm::replace(FilePath, '\\', '/');
196196
// Insert module into tree, using subdirectories as submodules.
197197
for (llvm::sys::path::const_iterator I = llvm::sys::path::begin(FilePath),
198198
E = llvm::sys::path::end(FilePath);

clang-tools-extra/modularize/PreprocessorTracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ class PreprocessorTrackerImpl : public PreprocessorTracker {
904904
// Convert to a canonical path.
905905
std::string getCanonicalPath(llvm::StringRef path) const {
906906
std::string CanonicalPath(path);
907-
std::replace(CanonicalPath.begin(), CanonicalPath.end(), '\\', '/');
907+
llvm::replace(CanonicalPath, '\\', '/');
908908
return CanonicalPath;
909909
}
910910

clang-tools-extra/pp-trace/PPCallbacksTracker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static std::string getSourceLocationString(Preprocessor &PP,
4444
std::string Result = SS.str();
4545

4646
// YAML treats backslash as escape, so use forward slashes.
47-
std::replace(Result.begin(), Result.end(), '\\', '/');
47+
llvm::replace(Result, '\\', '/');
4848

4949
return Result;
5050
}
@@ -653,7 +653,7 @@ void PPCallbacksTracker::appendFilePathArgument(const char *Name,
653653
llvm::StringRef Value) {
654654
std::string Path(Value);
655655
// YAML treats backslash as escape, so use forward slashes.
656-
std::replace(Path.begin(), Path.end(), '\\', '/');
656+
llvm::replace(Path, '\\', '/');
657657
appendQuotedArgument(Name, Path);
658658
}
659659

0 commit comments

Comments
 (0)