[llvm] 7094ab4 - [llvm] Modernize bool literals (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 17 18:09:08 PDT 2022
Author: Kazu Hirata
Date: 2022-07-17T18:08:51-07:00
New Revision: 7094ab4ee75771539a4426163345f0746a017006
URL: https://github.com/llvm/llvm-project/commit/7094ab4ee75771539a4426163345f0746a017006
DIFF: https://github.com/llvm/llvm-project/commit/7094ab4ee75771539a4426163345f0746a017006.diff
LOG: [llvm] Modernize bool literals (NFC)
Identified with modernize-use-bool-literals.
Added:
Modified:
llvm/lib/Object/WasmObjectFile.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index ce816b097691..d00359c6deef 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -204,7 +204,7 @@ static Error readInitExpr(wasm::WasmInitExpr &Expr,
if (Expr.Extended) {
Ctx.Ptr = Start;
- while (1) {
+ while (true) {
uint8_t Opcode = readOpcode(Ctx);
switch (Opcode) {
case wasm::WASM_OPCODE_I32_CONST:
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 2f334e211181..b5fb390c08e1 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -417,9 +417,9 @@ bool getMAIIsGFX940XDL(unsigned Opc) {
CanBeVOPD getCanBeVOPD(unsigned Opc) {
const VOPDComponentInfo *Info = getVOPDComponentHelper(Opc);
if (Info)
- return {Info->CanBeVOPDX, 1};
+ return {Info->CanBeVOPDX, true};
else
- return {0, 0};
+ return {false, false};
}
unsigned getVOPDOpcode(unsigned Opc) {
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index e136cd9aedac..b75c4d32cee2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3744,7 +3744,7 @@ void BoUpSLP::reorderTopToBottom() {
unsigned Opcode0 = TE->getOpcode();
unsigned Opcode1 = TE->getAltOpcode();
// The opcode mask selects between the two opcodes.
- SmallBitVector OpcodeMask(TE->Scalars.size(), 0);
+ SmallBitVector OpcodeMask(TE->Scalars.size(), false);
for (unsigned Lane : seq<unsigned>(0, TE->Scalars.size()))
if (cast<Instruction>(TE->Scalars[Lane])->getOpcode() == Opcode1)
OpcodeMask.set(Lane);
diff --git a/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp b/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp
index aad8b2469fab..c64d4dbb3155 100644
--- a/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp
+++ b/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp
@@ -88,7 +88,7 @@ int main(int argc, char **argv) {
Pool.async([&]() { ExitOnErr(Server.Server.listen()); });
Pool.async([&]() {
- while (1) {
+ while (true) {
DebuginfodLogEntry Entry = Log.pop();
if (VerboseLogging) {
outs() << Entry.Message << "\n";
More information about the llvm-commits
mailing list