[Mlir-commits] [mlir] fc63c05 - [mlir] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
Fangrui Song
llvmlistbot at llvm.org
Mon Aug 8 20:56:10 PDT 2022
Author: Fangrui Song
Date: 2022-08-08T20:56:05-07:00
New Revision: fc63c0542c8d6e5be07e059d03a73ae77f5155aa
URL: https://github.com/llvm/llvm-project/commit/fc63c0542c8d6e5be07e059d03a73ae77f5155aa
DIFF: https://github.com/llvm/llvm-project/commit/fc63c0542c8d6e5be07e059d03a73ae77f5155aa.diff
LOG: [mlir] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
Added:
Modified:
mlir/lib/AsmParser/Lexer.cpp
mlir/lib/AsmParser/Parser.cpp
mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
mlir/lib/IR/AffineExpr.cpp
mlir/lib/Tools/PDLL/Parser/Lexer.cpp
mlir/lib/Transforms/Utils/DialectConversion.cpp
Removed:
################################################################################
diff --git a/mlir/lib/AsmParser/Lexer.cpp b/mlir/lib/AsmParser/Lexer.cpp
index 5c2416056bb32..5f3453000d768 100644
--- a/mlir/lib/AsmParser/Lexer.cpp
+++ b/mlir/lib/AsmParser/Lexer.cpp
@@ -161,7 +161,7 @@ Token Lexer::lexToken() {
curPtr += 2;
return formToken(Token::file_metadata_end, tokStart);
}
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case '!':
case '^':
case '%':
@@ -265,7 +265,7 @@ void Lexer::skipComment() {
--curPtr;
return;
}
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
default:
// Skip over other characters.
break;
@@ -415,7 +415,7 @@ Token Lexer::lexString(const char *tokStart) {
// include it. If it is the end of file, then it is an error.
if (curPtr - 1 != curBuffer.end())
continue;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case '\n':
case '\v':
case '\f':
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index e30617b906cdc..83a6a35350de4 100644
--- a/mlir/lib/AsmParser/Parser.cpp
+++ b/mlir/lib/AsmParser/Parser.cpp
@@ -55,7 +55,7 @@ Parser::parseCommaSeparatedList(Delimiter delimiter,
case Delimiter::OptionalParen:
if (getToken().isNot(Token::l_paren))
return success();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Delimiter::Paren:
if (parseToken(Token::l_paren, "expected '('" + contextMessage))
return failure();
@@ -67,7 +67,7 @@ Parser::parseCommaSeparatedList(Delimiter delimiter,
// Check for absent list.
if (getToken().isNot(Token::less))
return success();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Delimiter::LessGreater:
if (parseToken(Token::less, "expected '<'" + contextMessage))
return success();
@@ -78,7 +78,7 @@ Parser::parseCommaSeparatedList(Delimiter delimiter,
case Delimiter::OptionalSquare:
if (getToken().isNot(Token::l_square))
return success();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Delimiter::Square:
if (parseToken(Token::l_square, "expected '['" + contextMessage))
return failure();
@@ -89,7 +89,7 @@ Parser::parseCommaSeparatedList(Delimiter delimiter,
case Delimiter::OptionalBraces:
if (getToken().isNot(Token::l_brace))
return success();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Delimiter::Braces:
if (parseToken(Token::l_brace, "expected '{'" + contextMessage))
return failure();
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
index bf4582511f1a4..353f6e29f1ce2 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
@@ -529,7 +529,7 @@ void ScalarType::getExtensions(SPIRVType::ExtensionArrayRefVector &extensions,
ArrayRef<Extension> ref(exts, llvm::array_lengthof(exts));
extensions.push_back(ref);
}
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case StorageClass::Input:
case StorageClass::Output:
if (getIntOrFloatBitWidth() == 16) {
diff --git a/mlir/lib/IR/AffineExpr.cpp b/mlir/lib/IR/AffineExpr.cpp
index b4a593f72f61d..38db97be2a7db 100644
--- a/mlir/lib/IR/AffineExpr.cpp
+++ b/mlir/lib/IR/AffineExpr.cpp
@@ -219,7 +219,7 @@ int64_t AffineExpr::getLargestKnownDivisor() const {
AffineBinaryOpExpr binExpr(nullptr);
switch (getKind()) {
case AffineExprKind::CeilDiv:
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case AffineExprKind::DimId:
case AffineExprKind::FloorDiv:
case AffineExprKind::SymbolId:
@@ -232,7 +232,7 @@ int64_t AffineExpr::getLargestKnownDivisor() const {
binExpr.getRHS().getLargestKnownDivisor();
}
case AffineExprKind::Add:
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case AffineExprKind::Mod: {
binExpr = cast<AffineBinaryOpExpr>();
return llvm::GreatestCommonDivisor64(
@@ -248,7 +248,7 @@ bool AffineExpr::isMultipleOf(int64_t factor) const {
uint64_t l, u;
switch (getKind()) {
case AffineExprKind::SymbolId:
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case AffineExprKind::DimId:
return factor * factor == 1;
case AffineExprKind::Constant:
diff --git a/mlir/lib/Tools/PDLL/Parser/Lexer.cpp b/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
index 92bf4812d8bb4..74b02cc5209d9 100644
--- a/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
+++ b/mlir/lib/Tools/PDLL/Parser/Lexer.cpp
@@ -285,7 +285,7 @@ void Lexer::lexComment() {
--curPtr;
return;
}
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
default:
// Skip over other characters.
break;
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index e205bf51b40f2..d82264b631e8c 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -2782,7 +2782,7 @@ static LogicalResult legalizeUnresolvedMaterialization(
// If an argument materialization failed, fallback to trying a target
// materialization.
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case UnresolvedMaterialization::Target:
newMaterialization = converter->materializeTargetConversion(
rewriter, op->getLoc(), outputType, inputOperands);
More information about the Mlir-commits
mailing list