Skip to content

Commit 58a80a7

Browse files
committed
Fix format in SpecialCaseList.cpp
Created using spr 1.3.6
2 parents c51ac31 + fb86b3d commit 58a80a7

File tree

299 files changed

+3844
-1800
lines changed

Some content is hidden

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

299 files changed

+3844
-1800
lines changed

bolt/include/bolt/Profile/DataReader.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ struct FuncBranchData {
114114

115115
FuncBranchData() {}
116116

117-
FuncBranchData(StringRef Name, ContainerTy Data)
118-
: Name(Name), Data(std::move(Data)) {}
119-
120-
FuncBranchData(StringRef Name, ContainerTy Data, ContainerTy EntryData)
117+
FuncBranchData(StringRef Name, ContainerTy Data = ContainerTy(),
118+
ContainerTy EntryData = ContainerTy())
121119
: Name(Name), Data(std::move(Data)), EntryData(std::move(EntryData)) {}
122120

123121
ErrorOr<const BranchInfo &> getBranch(uint64_t From, uint64_t To) const;
@@ -205,7 +203,7 @@ struct FuncMemData {
205203

206204
FuncMemData() {}
207205

208-
FuncMemData(StringRef Name, ContainerTy Data)
206+
FuncMemData(StringRef Name, ContainerTy Data = ContainerTy())
209207
: Name(Name), Data(std::move(Data)) {}
210208
};
211209

@@ -241,7 +239,7 @@ struct FuncBasicSampleData {
241239
StringRef Name;
242240
ContainerTy Data;
243241

244-
FuncBasicSampleData(StringRef Name, ContainerTy Data)
242+
FuncBasicSampleData(StringRef Name, ContainerTy Data = ContainerTy())
245243
: Name(Name), Data(std::move(Data)) {}
246244

247245
/// Get the number of samples recorded in [Start, End)

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/Passes/ShrinkWrapping.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -825,14 +825,13 @@ void ShrinkWrapping::computeSaveLocations() {
825825
if (!CSA.CalleeSaved[I])
826826
continue;
827827

828-
std::stable_sort(BestSavePos[I].begin(), BestSavePos[I].end(),
829-
[&](const MCInst *A, const MCInst *B) {
830-
const BinaryBasicBlock *BBA = InsnToBB[A];
831-
const BinaryBasicBlock *BBB = InsnToBB[B];
832-
const uint64_t CountA = BBA->getKnownExecutionCount();
833-
const uint64_t CountB = BBB->getKnownExecutionCount();
834-
return CountB < CountA;
835-
});
828+
llvm::stable_sort(BestSavePos[I], [&](const MCInst *A, const MCInst *B) {
829+
const BinaryBasicBlock *BBA = InsnToBB[A];
830+
const BinaryBasicBlock *BBB = InsnToBB[B];
831+
const uint64_t CountA = BBA->getKnownExecutionCount();
832+
const uint64_t CountB = BBB->getKnownExecutionCount();
833+
return CountB < CountA;
834+
});
836835

837836
for (MCInst *Pos : BestSavePos[I]) {
838837
const BinaryBasicBlock *BB = InsnToBB[Pos];

bolt/lib/Profile/DataReader.cpp

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,26 +1088,11 @@ bool DataReader::hasMemData() {
10881088

10891089
std::error_code DataReader::parseInNoLBRMode() {
10901090
auto GetOrCreateFuncEntry = [&](StringRef Name) {
1091-
auto I = NamesToBasicSamples.find(Name);
1092-
if (I == NamesToBasicSamples.end()) {
1093-
bool Success;
1094-
std::tie(I, Success) = NamesToBasicSamples.insert(std::make_pair(
1095-
Name, FuncBasicSampleData(Name, FuncBasicSampleData::ContainerTy())));
1096-
1097-
assert(Success && "unexpected result of insert");
1098-
}
1099-
return I;
1091+
return NamesToBasicSamples.try_emplace(Name, Name).first;
11001092
};
11011093

11021094
auto GetOrCreateFuncMemEntry = [&](StringRef Name) {
1103-
auto I = NamesToMemEvents.find(Name);
1104-
if (I == NamesToMemEvents.end()) {
1105-
bool Success;
1106-
std::tie(I, Success) = NamesToMemEvents.insert(
1107-
std::make_pair(Name, FuncMemData(Name, FuncMemData::ContainerTy())));
1108-
assert(Success && "unexpected result of insert");
1109-
}
1110-
return I;
1095+
return NamesToMemEvents.try_emplace(Name, Name).first;
11111096
};
11121097

11131098
while (hasBranchData()) {
@@ -1151,26 +1136,11 @@ std::error_code DataReader::parseInNoLBRMode() {
11511136

11521137
std::error_code DataReader::parse() {
11531138
auto GetOrCreateFuncEntry = [&](StringRef Name) {
1154-
auto I = NamesToBranches.find(Name);
1155-
if (I == NamesToBranches.end()) {
1156-
bool Success;
1157-
std::tie(I, Success) = NamesToBranches.insert(std::make_pair(
1158-
Name, FuncBranchData(Name, FuncBranchData::ContainerTy(),
1159-
FuncBranchData::ContainerTy())));
1160-
assert(Success && "unexpected result of insert");
1161-
}
1162-
return I;
1139+
return NamesToBranches.try_emplace(Name, Name).first;
11631140
};
11641141

11651142
auto GetOrCreateFuncMemEntry = [&](StringRef Name) {
1166-
auto I = NamesToMemEvents.find(Name);
1167-
if (I == NamesToMemEvents.end()) {
1168-
bool Success;
1169-
std::tie(I, Success) = NamesToMemEvents.insert(
1170-
std::make_pair(Name, FuncMemData(Name, FuncMemData::ContainerTy())));
1171-
assert(Success && "unexpected result of insert");
1172-
}
1173-
return I;
1143+
return NamesToMemEvents.try_emplace(Name, Name).first;
11741144
};
11751145

11761146
Col = 0;

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/bugprone/NarrowingConversionsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AST_MATCHER_P(QualType, hasAnyType, std::vector<StringRef>, Names) {
3131
return false;
3232

3333
std::string Name = Node.getLocalUnqualifiedType().getAsString();
34-
return llvm::any_of(Names, [&Name](StringRef Ref) { return Ref == Name; });
34+
return llvm::is_contained(Names, Name);
3535
}
3636

3737
AST_MATCHER(FieldDecl, hasIntBitwidth) {

0 commit comments

Comments
 (0)