Skip to content

Commit 0d5155a

Browse files
authored
merge main into amd-staging (llvm#2232)
2 parents 5255366 + 6d27783 commit 0d5155a

File tree

68 files changed

+728
-279
lines changed

Some content is hidden

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

68 files changed

+728
-279
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/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,10 @@ Improvements to Clang's diagnostics
570570
}
571571
572572
573+
- A new ``-Wcharacter-conversion`` warns where comparing or implicitly converting
574+
between different Unicode character types (``char8_t``, ``char16_t``, ``char32_t``).
575+
This warning only triggers in C++ as these types are aliases in C. (#GH138526)
576+
573577
Improvements to Clang's time-trace
574578
----------------------------------
575579

clang/include/clang/AST/ASTDiagnostic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ namespace clang {
3838
/// is initialized before passing it in.
3939
QualType desugarForDiagnostic(ASTContext &Context, QualType QT,
4040
bool &ShouldAKA);
41+
42+
std::string FormatUTFCodeUnitAsCodepoint(unsigned Value, QualType T);
43+
4144
} // end namespace clang
4245

4346
#endif

0 commit comments

Comments
 (0)