Skip to content

Commit 2d62dbe

Browse files
committed
merge main into amd-staging
2 parents 9b5dbb1 + d08833f commit 2d62dbe

File tree

47 files changed

+327
-259
lines changed

Some content is hidden

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

47 files changed

+327
-259
lines changed

bolt/lib/Core/DebugData.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ static void writeDWARF5LocList(uint32_t &NumberOfEntries, DIEValue &AttrInfo,
676676
return;
677677
}
678678

679-
std::vector<uint64_t> OffsetsArray;
680679
auto writeExpression = [&](uint32_t Index) -> void {
681680
const DebugLocationEntry &Entry = LocList[Index];
682681
encodeULEB128(Entry.Expr.size(), LocBodyStream);

bolt/lib/Passes/FrameAnalysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ bool FrameAnalysis::updateArgsTouchedFor(const BinaryFunction &BF, MCInst &Inst,
320320
if (!BC.MIB->isCall(Inst))
321321
return false;
322322

323-
std::set<int64_t> Res;
324323
const MCSymbol *TargetSymbol = BC.MIB->getTargetSymbol(Inst);
325324
// If indirect call, we conservatively assume it accesses all stack positions
326325
if (TargetSymbol == nullptr) {

bolt/lib/Passes/HFSort.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ std::vector<Cluster> clusterize(const CallGraph &Cg) {
239239
}
240240

241241
std::vector<Cluster> randomClusters(const CallGraph &Cg) {
242-
std::vector<NodeId> FuncIds(Cg.numNodes(), 0);
243242
std::vector<Cluster> Clusters;
244243
Clusters.reserve(Cg.numNodes());
245244

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4703,7 +4703,6 @@ RewriteInstance::getOutputSections(ELFObjectFile<ELFT> *File,
47034703
}
47044704

47054705
// Assign indices to sections.
4706-
std::unordered_map<std::string, uint64_t> NameToIndex;
47074706
for (uint32_t Index = 1; Index < OutputSections.size(); ++Index)
47084707
OutputSections[Index].first->setIndex(Index);
47094708

bolt/tools/bat-dump/bat-dump.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ static void report_error(StringRef Message, Error E) {
7373
exit(1);
7474
}
7575

76-
static std::string GetExecutablePath(const char *Argv0) {
77-
SmallString<256> ExecutablePath(Argv0);
78-
// Do a PATH lookup if Argv0 isn't a valid path.
79-
if (!llvm::sys::fs::exists(ExecutablePath))
80-
if (llvm::ErrorOr<std::string> P =
81-
llvm::sys::findProgramByName(ExecutablePath))
82-
ExecutablePath = *P;
83-
return std::string(ExecutablePath);
84-
}
85-
8676
void dumpBATFor(llvm::object::ELFObjectFileBase *InputFile) {
8777
BoltAddressTranslation BAT;
8878
if (!BAT.enabledFor(InputFile)) {
@@ -163,7 +153,6 @@ int main(int argc, char **argv) {
163153
report_error(opts::InputFilename, errc::no_such_file_or_directory);
164154

165155
ToolName = argv[0];
166-
std::string ToolPath = GetExecutablePath(argv[0]);
167156
Expected<llvm::object::OwningBinary<llvm::object::Binary>> BinaryOrErr =
168157
llvm::object::createBinary(opts::InputFilename);
169158
if (Error E = BinaryOrErr.takeError())

clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "llvm/Support/YAMLTraits.h"
1313
#include "llvm/Support/raw_ostream.h"
1414

15-
using llvm::yaml::MappingTraits;
1615
using ContextType = clang::find_all_symbols::SymbolInfo::ContextType;
1716
using clang::find_all_symbols::SymbolInfo;
1817
using clang::find_all_symbols::SymbolAndSignals;

clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,21 @@ void NewDeleteOverloadsCheck::onEndOfTranslationUnit() {
168168
// complexity when searching for corresponding free store functions.
169169
for (const auto *Overload : RP.second) {
170170
const auto *Match =
171-
std::find_if(RP.second.begin(), RP.second.end(),
172-
[&Overload](const FunctionDecl *FD) {
173-
if (FD == Overload)
174-
return false;
175-
// If the declaration contexts don't match, we don't
176-
// need to check any further.
177-
if (FD->getDeclContext() != Overload->getDeclContext())
178-
return false;
179-
180-
// Since the declaration contexts match, see whether
181-
// the current element is the corresponding operator.
182-
if (!areCorrespondingOverloads(Overload, FD))
183-
return false;
184-
185-
return true;
186-
});
171+
llvm::find_if(RP.second, [&Overload](const FunctionDecl *FD) {
172+
if (FD == Overload)
173+
return false;
174+
// If the declaration contexts don't match, we don't
175+
// need to check any further.
176+
if (FD->getDeclContext() != Overload->getDeclContext())
177+
return false;
178+
179+
// Since the declaration contexts match, see whether
180+
// the current element is the corresponding operator.
181+
if (!areCorrespondingOverloads(Overload, FD))
182+
return false;
183+
184+
return true;
185+
});
187186

188187
if (Match == RP.second.end()) {
189188
// Check to see if there is a corresponding overload in a base class

clang-tools-extra/clangd/refactor/Rename.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ void filterRenameTargets(llvm::DenseSet<const NamedDecl *> &Decls) {
185185
// For renaming, we're only interested in foo's declaration, so drop the other
186186
// one. There should never be more than one UsingDecl here, otherwise the
187187
// rename would be ambiguos anyway.
188-
auto UD = std::find_if(Decls.begin(), Decls.end(), [](const NamedDecl *D) {
189-
return llvm::isa<UsingDecl>(D);
190-
});
188+
auto UD = llvm::find_if(
189+
Decls, [](const NamedDecl *D) { return llvm::isa<UsingDecl>(D); });
191190
if (UD != Decls.end()) {
192191
Decls.erase(UD);
193192
}

clang/include/clang/Basic/Diagnostic.h

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,29 @@ class FixItHint {
9292
/// modification is known.
9393
FixItHint() = default;
9494

95-
bool isNull() const {
96-
return !RemoveRange.isValid();
97-
}
95+
bool isNull() const { return !RemoveRange.isValid(); }
9896

9997
/// Create a code modification hint that inserts the given
10098
/// code string at a specific location.
101-
static FixItHint CreateInsertion(SourceLocation InsertionLoc,
102-
StringRef Code,
99+
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code,
103100
bool BeforePreviousInsertions = false) {
104101
FixItHint Hint;
105102
Hint.RemoveRange =
106-
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
103+
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
107104
Hint.CodeToInsert = std::string(Code);
108105
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
109106
return Hint;
110107
}
111108

112109
/// Create a code modification hint that inserts the given
113110
/// code from \p FromRange at a specific location.
114-
static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc,
115-
CharSourceRange FromRange,
116-
bool BeforePreviousInsertions = false) {
111+
static FixItHint
112+
CreateInsertionFromRange(SourceLocation InsertionLoc,
113+
CharSourceRange FromRange,
114+
bool BeforePreviousInsertions = false) {
117115
FixItHint Hint;
118116
Hint.RemoveRange =
119-
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
117+
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
120118
Hint.InsertFromRange = FromRange;
121119
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
122120
return Hint;
@@ -143,8 +141,7 @@ class FixItHint {
143141
return Hint;
144142
}
145143

146-
static FixItHint CreateReplacement(SourceRange RemoveRange,
147-
StringRef Code) {
144+
static FixItHint CreateReplacement(SourceRange RemoveRange, StringRef Code) {
148145
return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code);
149146
}
150147
};
@@ -553,13 +550,11 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
553550
/// avoid redundancy across arguments.
554551
///
555552
/// This is a hack to avoid a layering violation between libbasic and libsema.
556-
using ArgToStringFnTy = void (*)(
557-
ArgumentKind Kind, intptr_t Val,
558-
StringRef Modifier, StringRef Argument,
559-
ArrayRef<ArgumentValue> PrevArgs,
560-
SmallVectorImpl<char> &Output,
561-
void *Cookie,
562-
ArrayRef<intptr_t> QualTypeVals);
553+
using ArgToStringFnTy = void (*)(ArgumentKind Kind, intptr_t Val,
554+
StringRef Modifier, StringRef Argument,
555+
ArrayRef<ArgumentValue> PrevArgs,
556+
SmallVectorImpl<char> &Output, void *Cookie,
557+
ArrayRef<intptr_t> QualTypeVals);
563558

564559
void *ArgToStringCookie = nullptr;
565560
ArgToStringFnTy ArgToStringFn;
@@ -656,9 +651,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
656651

657652
/// Retrieve the maximum number of template instantiation
658653
/// notes to emit along with a given diagnostic.
659-
unsigned getTemplateBacktraceLimit() const {
660-
return TemplateBacktraceLimit;
661-
}
654+
unsigned getTemplateBacktraceLimit() const { return TemplateBacktraceLimit; }
662655

663656
/// Specify the maximum number of constexpr evaluation
664657
/// notes to emit along with a given diagnostic.
@@ -744,9 +737,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
744737
/// fails.
745738
///
746739
/// By default, we show all candidates.
747-
void setShowOverloads(OverloadsShown Val) {
748-
ShowOverloads = Val;
749-
}
740+
void setShowOverloads(OverloadsShown Val) { ShowOverloads = Val; }
750741
OverloadsShown getShowOverloads() const { return ShowOverloads; }
751742

752743
/// When a call or operator fails, print out up to this many candidate
@@ -885,9 +876,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
885876
unsigned getNumErrors() const { return NumErrors; }
886877
unsigned getNumWarnings() const { return NumWarnings; }
887878

888-
void setNumWarnings(unsigned NumWarnings) {
889-
this->NumWarnings = NumWarnings;
890-
}
879+
void setNumWarnings(unsigned NumWarnings) { this->NumWarnings = NumWarnings; }
891880

892881
/// Return an ID for a diagnostic with the specified format string and
893882
/// level.
@@ -907,9 +896,8 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
907896

908897
/// Converts a diagnostic argument (as an intptr_t) into the string
909898
/// that represents it.
910-
void ConvertArgToString(ArgumentKind Kind, intptr_t Val,
911-
StringRef Modifier, StringRef Argument,
912-
ArrayRef<ArgumentValue> PrevArgs,
899+
void ConvertArgToString(ArgumentKind Kind, intptr_t Val, StringRef Modifier,
900+
StringRef Argument, ArrayRef<ArgumentValue> PrevArgs,
913901
SmallVectorImpl<char> &Output,
914902
ArrayRef<intptr_t> QualTypeVals) const {
915903
ArgToStringFn(Kind, Val, Modifier, Argument, PrevArgs, Output,
@@ -1074,8 +1062,9 @@ class DiagnosticErrorTrap {
10741062
unsigned NumUnrecoverableErrors;
10751063

10761064
public:
1077-
explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag)
1078-
: Diag(Diag) { reset(); }
1065+
explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag) : Diag(Diag) {
1066+
reset();
1067+
}
10791068

10801069
/// Determine whether any errors have occurred since this
10811070
/// object instance was created.
@@ -1278,7 +1267,8 @@ class DiagnosticBuilder : public StreamingDiagnostic {
12781267
bool Emit() {
12791268
// If this diagnostic is inactive, then its soul was stolen by the copy ctor
12801269
// (or by a subclass, as in SemaDiagnosticBuilder).
1281-
if (!isActive()) return false;
1270+
if (!isActive())
1271+
return false;
12821272

12831273
// Process the diagnostic.
12841274
bool Result = DiagObj->EmitDiagnostic(*this, IsForceEmit);
@@ -1553,7 +1543,9 @@ class Diagnostic {
15531543
unsigned getID() const { return DiagID; }
15541544
const SourceLocation &getLocation() const { return DiagLoc; }
15551545
bool hasSourceManager() const { return DiagObj->hasSourceManager(); }
1556-
SourceManager &getSourceManager() const { return DiagObj->getSourceManager();}
1546+
SourceManager &getSourceManager() const {
1547+
return DiagObj->getSourceManager();
1548+
}
15571549

15581550
unsigned getNumArgs() const { return DiagStorage.NumDiagArgs; }
15591551

@@ -1709,8 +1701,8 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const StoredDiagnostic &);
17091701
/// formats and prints fully processed diagnostics.
17101702
class DiagnosticConsumer {
17111703
protected:
1712-
unsigned NumWarnings = 0; ///< Number of warnings reported
1713-
unsigned NumErrors = 0; ///< Number of errors reported
1704+
unsigned NumWarnings = 0; ///< Number of warnings reported
1705+
unsigned NumErrors = 0; ///< Number of errors reported
17141706

17151707
public:
17161708
DiagnosticConsumer() = default;

clang/lib/AST/DeclTemplate.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
359359

360360
ExternalSource->LoadExternalSpecializations(this->getCanonicalDecl(),
361361
OnlyPartial);
362-
return;
363362
}
364363

365364
bool RedeclarableTemplateDecl::loadLazySpecializationsImpl(

0 commit comments

Comments
 (0)