diff options
author | Fangrui Song <i@maskray.me> | 2022-08-08 11:24:15 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-08-08 11:24:15 -0700 |
commit | de9d80c1c579e39cc658a508f1d4ba1cd792e4d5 (patch) | |
tree | 169da231cb69f41d33d52469716f5bc337f17465 /llvm/lib/IR | |
parent | 09db7f533174cdda4655d0114cd88bd22d336e31 (diff) | |
download | llvm-de9d80c1c579e39cc658a508f1d4ba1cd792e4d5.zip llvm-de9d80c1c579e39cc658a508f1d4ba1cd792e4d5.tar.gz llvm-de9d80c1c579e39cc658a508f1d4ba1cd792e4d5.tar.bz2 |
[llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
With C++17 there is no Clang pedantic warning or MSVC C5051.
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/IR/Function.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/IR/InlineAsm.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/IR/Value.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 98adff1..f0c41b3 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -903,7 +903,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, // Handle undef ^ undef -> 0 special case. This is a common // idiom (misuse). return Constant::getNullValue(C1->getType()); - LLVM_FALLTHROUGH; + [[fallthrough]]; case Instruction::Add: case Instruction::Sub: return UndefValue::get(C1->getType()); @@ -979,7 +979,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, // -0.0 - undef --> undef (consistent with "fneg undef") if (match(C1, m_NegZeroFP()) && isa<UndefValue>(C2)) return C2; - LLVM_FALLTHROUGH; + [[fallthrough]]; case Instruction::FAdd: case Instruction::FMul: case Instruction::FDiv: @@ -1513,7 +1513,7 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2, if (const GlobalValue *GV = dyn_cast<GlobalValue>(CE1Op0)) if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) return areGlobalsPotentiallyEqual(GV, GV2); - LLVM_FALLTHROUGH; + [[fallthrough]]; case Instruction::UIToFP: case Instruction::SIToFP: case Instruction::ZExt: diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 85f54c7..cbf8ecd 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1186,13 +1186,13 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos, case IIT_EMPTYSTRUCT: OutputTable.push_back(IITDescriptor::get(IITDescriptor::Struct, 0)); return; - case IIT_STRUCT9: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT8: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT7: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT6: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT5: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT4: ++StructElts; LLVM_FALLTHROUGH; - case IIT_STRUCT3: ++StructElts; LLVM_FALLTHROUGH; + case IIT_STRUCT9: ++StructElts; [[fallthrough]]; + case IIT_STRUCT8: ++StructElts; [[fallthrough]]; + case IIT_STRUCT7: ++StructElts; [[fallthrough]]; + case IIT_STRUCT6: ++StructElts; [[fallthrough]]; + case IIT_STRUCT5: ++StructElts; [[fallthrough]]; + case IIT_STRUCT4: ++StructElts; [[fallthrough]]; + case IIT_STRUCT3: ++StructElts; [[fallthrough]]; case IIT_STRUCT2: { OutputTable.push_back(IITDescriptor::get(IITDescriptor::Struct,StructElts)); diff --git a/llvm/lib/IR/InlineAsm.cpp b/llvm/lib/IR/InlineAsm.cpp index 088fcfd..ef3e40d 100644 --- a/llvm/lib/IR/InlineAsm.cpp +++ b/llvm/lib/IR/InlineAsm.cpp @@ -282,7 +282,7 @@ Error InlineAsm::verify(FunctionType *Ty, StringRef ConstStr) { break; } ++NumIndirect; - LLVM_FALLTHROUGH; // We fall through for Indirect Outputs. + [[fallthrough]]; // We fall through for Indirect Outputs. case InlineAsm::isInput: if (NumClobbers) return makeStringError("input constraint occurs after clobber " diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index c707004..13600e3 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -636,7 +636,7 @@ static const Value *stripPointerCastsAndOffsets( case PSK_InBoundsConstantIndices: if (!GEP->hasAllConstantIndices()) return V; - LLVM_FALLTHROUGH; + [[fallthrough]]; case PSK_InBounds: if (!GEP->isInBounds()) return V; diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index e3ea256..24e013c 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2494,7 +2494,7 @@ void Verifier::visitFunction(const Function &F) { case CallingConv::SPIR_KERNEL: Check(F.getReturnType()->isVoidTy(), "Calling convention requires void return type", &F); - LLVM_FALLTHROUGH; + [[fallthrough]]; case CallingConv::AMDGPU_VS: case CallingConv::AMDGPU_HS: case CallingConv::AMDGPU_GS: @@ -2523,7 +2523,7 @@ void Verifier::visitFunction(const Function &F) { } } - LLVM_FALLTHROUGH; + [[fallthrough]]; case CallingConv::Fast: case CallingConv::Cold: case CallingConv::Intel_OCL_BI: |