Skip to content

Commit 654b3ab

Browse files
authored
Merge branch 'main' into users/el-ev/05-17-_clang_nfc_use_llvm_sort_
2 parents 935633e + aaaae99 commit 654b3ab

Some content is hidden

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

44 files changed

+530
-470
lines changed

bolt/lib/Passes/PettisAndHansen.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,10 @@ std::vector<Cluster> pettisAndHansen(const CallGraph &Cg) {
143143
// Find an arc with max weight and merge its nodes
144144

145145
while (!Carcs.empty()) {
146-
auto Maxpos =
147-
std::max_element(Carcs.begin(), Carcs.end(),
148-
[&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
149-
return Carc1.Weight < Carc2.Weight;
150-
});
146+
auto Maxpos = llvm::max_element(
147+
Carcs, [&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
148+
return Carc1.Weight < Carc2.Weight;
149+
});
151150

152151
ClusterArc Max = *Maxpos;
153152
Carcs.erase(Maxpos);

clang/lib/AST/Expr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,8 +3263,8 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const {
32633263
// refer to temporaries of that type:
32643264

32653265
// - implicit derived-to-base conversions
3266-
if (isa<ImplicitCastExpr>(E)) {
3267-
switch (cast<ImplicitCastExpr>(E)->getCastKind()) {
3266+
if (const auto *ICE = dyn_cast<ImplicitCastExpr>(E)) {
3267+
switch (ICE->getCastKind()) {
32683268
case CK_DerivedToBase:
32693269
case CK_UncheckedDerivedToBase:
32703270
return false;
@@ -3277,7 +3277,7 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const {
32773277
if (isa<MemberExpr>(E))
32783278
return false;
32793279

3280-
if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E))
3280+
if (const auto *BO = dyn_cast<BinaryOperator>(E))
32813281
if (BO->isPtrMemOp())
32823282
return false;
32833283

clang/lib/Driver/ToolChains/MSVC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
211211
CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dynamic"));
212212
auto defines = Args.getAllArgValues(options::OPT_D);
213213
if (Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd) ||
214-
find(begin(defines), end(defines), "_DLL") != end(defines)) {
214+
llvm::is_contained(defines, "_DLL")) {
215215
// Make sure the dynamic runtime thunk is not optimized out at link time
216216
// to ensure proper SEH handling.
217217
CmdArgs.push_back(Args.MakeArgString(

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,8 +2055,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
20552055
// The memory profile runtime appends the pid to make this name more unique.
20562056
const char *MemProfileBasename = "memprof.profraw";
20572057
if (Args.hasArg(OPT_fmemory_profile_EQ)) {
2058-
SmallString<128> Path(
2059-
std::string(Args.getLastArgValue(OPT_fmemory_profile_EQ)));
2058+
SmallString<128> Path(Args.getLastArgValue(OPT_fmemory_profile_EQ));
20602059
llvm::sys::path::append(Path, MemProfileBasename);
20612060
Opts.MemoryProfileOutput = std::string(Path);
20622061
} else if (Args.hasArg(OPT_fmemory_profile))

lldb/tools/lldb-dap/EventHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void SendProcessEvent(DAP &dap, LaunchMethod launch_method) {
9393
exe_fspec.GetPath(exe_path, sizeof(exe_path));
9494
llvm::json::Object event(CreateEventObject("process"));
9595
llvm::json::Object body;
96-
EmplaceSafeString(body, "name", std::string(exe_path));
96+
EmplaceSafeString(body, "name", exe_path);
9797
const auto pid = dap.target.GetProcess().GetProcessID();
9898
body.try_emplace("systemProcessId", (int64_t)pid);
9999
body.try_emplace("isLocalProcess", true);

lldb/tools/lldb-dap/Handler/EvaluateRequestHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void EvaluateRequestHandler::operator()(
205205
lldb::SBError error = value.GetError();
206206
const char *error_cstr = error.GetCString();
207207
if (error_cstr && error_cstr[0])
208-
EmplaceSafeString(response, "message", std::string(error_cstr));
208+
EmplaceSafeString(response, "message", error_cstr);
209209
else
210210
EmplaceSafeString(response, "message", "evaluate failed");
211211
} else {

lldb/tools/lldb-dap/Handler/ExceptionInfoRequestHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void ExceptionInfoRequestHandler::operator()(
136136
if (!ObjectContainsKey(body, "description")) {
137137
char description[1024];
138138
if (thread.GetStopDescription(description, sizeof(description))) {
139-
EmplaceSafeString(body, "description", std::string(description));
139+
EmplaceSafeString(body, "description", description);
140140
}
141141
}
142142
body.try_emplace("breakMode", "always");

lldb/tools/lldb-dap/JSONUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ llvm::json::Value CreateThreadStopped(DAP &dap, lldb::SBThread &thread,
905905
if (!ObjectContainsKey(body, "description")) {
906906
char description[1024];
907907
if (thread.GetStopDescription(description, sizeof(description))) {
908-
EmplaceSafeString(body, "description", std::string(description));
908+
EmplaceSafeString(body, "description", description);
909909
}
910910
}
911911
// "threadCausedFocus" is used in tests to validate breaking behavior.

0 commit comments

Comments
 (0)