Skip to content

Commit cac7aab

Browse files
committed
Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)
1 parent d1b63c6 commit cac7aab

File tree

22 files changed

+134
-138
lines changed

22 files changed

+134
-138
lines changed

mlir/examples/toy/Ch1/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch2/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch3/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch4/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch5/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch6/include/toy/AST.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6262

6363
/// Expression class for numeric literals like "1.0".
6464
class NumberExprAST : public ExprAST {
65-
double Val;
65+
double val;
6666

6767
public:
6868
NumberExprAST(Location loc, double val)
69-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
69+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7070

71-
double getValue() { return Val; }
71+
double getValue() { return val; }
7272

7373
/// LLVM style RTTI
7474
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
154154
ExprAST *getLHS() { return lhs.get(); }
155155
ExprAST *getRHS() { return rhs.get(); }
156156

157-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
157+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
158158
std::unique_ptr<ExprAST> rhs)
159-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
159+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
160160
rhs(std::move(rhs)) {}
161161

162162
/// LLVM style RTTI

mlir/examples/toy/Ch7/include/toy/AST.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
6464

6565
/// Expression class for numeric literals like "1.0".
6666
class NumberExprAST : public ExprAST {
67-
double Val;
67+
double val;
6868

6969
public:
7070
NumberExprAST(Location loc, double val)
71-
: ExprAST(Expr_Num, std::move(loc)), Val(val) {}
71+
: ExprAST(Expr_Num, std::move(loc)), val(val) {}
7272

73-
double getValue() { return Val; }
73+
double getValue() { return val; }
7474

7575
/// LLVM style RTTI
7676
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -174,9 +174,9 @@ class BinaryExprAST : public ExprAST {
174174
ExprAST *getLHS() { return lhs.get(); }
175175
ExprAST *getRHS() { return rhs.get(); }
176176

177-
BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
177+
BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
178178
std::unique_ptr<ExprAST> rhs)
179-
: ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
179+
: ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
180180
rhs(std::move(rhs)) {}
181181

182182
/// LLVM style RTTI
@@ -264,8 +264,8 @@ class FunctionAST : public RecordAST {
264264
ExprASTList *getBody() { return body.get(); }
265265

266266
/// LLVM style RTTI
267-
static bool classof(const RecordAST *R) {
268-
return R->getKind() == Record_Function;
267+
static bool classof(const RecordAST *r) {
268+
return r->getKind() == Record_Function;
269269
}
270270
};
271271

@@ -288,8 +288,8 @@ class StructAST : public RecordAST {
288288
}
289289

290290
/// LLVM style RTTI
291-
static bool classof(const RecordAST *R) {
292-
return R->getKind() == Record_Struct;
291+
static bool classof(const RecordAST *r) {
292+
return r->getKind() == Record_Struct;
293293
}
294294
};
295295

mlir/include/mlir/Analysis/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ LogicalResult boundCheckLoadOrStoreOp(LoadOrStoreOpPointer loadOrStoreOp,
362362
bool emitError = true);
363363

364364
/// Returns the number of surrounding loops common to both A and B.
365-
unsigned getNumCommonSurroundingLoops(Operation &A, Operation &B);
365+
unsigned getNumCommonSurroundingLoops(Operation &a, Operation &b);
366366

367367
/// Gets the memory footprint of all data touched in the specified memory space
368368
/// in bytes; if the memory space is unspecified, considers all memory spaces.

mlir/include/mlir/Dialect/Affine/IR/AffineOps.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ class AffineBound {
440440
using operand_iterator = AffineForOp::operand_iterator;
441441
using operand_range = AffineForOp::operand_range;
442442

443-
operand_iterator operand_begin() { return op.operand_begin() + opStart; }
444-
operand_iterator operand_end() { return op.operand_begin() + opEnd; }
445-
operand_range getOperands() { return {operand_begin(), operand_end()}; }
443+
operand_iterator operandBegin() { return op.operand_begin() + opStart; }
444+
operand_iterator operandEnd() { return op.operand_begin() + opEnd; }
445+
operand_range getOperands() { return {operandBegin(), operandEnd()}; }
446446

447447
private:
448448
// 'affine.for' operation that contains this bound.

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ namespace llvm {
4545
template <>
4646
struct PointerLikeTypeTraits<mlir::spirv::FuncOp> {
4747
public:
48-
static inline void *getAsVoidPointer(mlir::spirv::FuncOp I) {
49-
return const_cast<void *>(I.getAsOpaquePointer());
48+
static inline void *getAsVoidPointer(mlir::spirv::FuncOp i) {
49+
return const_cast<void *>(i.getAsOpaquePointer());
5050
}
51-
static inline mlir::spirv::FuncOp getFromVoidPointer(void *P) {
52-
return mlir::spirv::FuncOp::getFromOpaquePointer(P);
51+
static inline mlir::spirv::FuncOp getFromVoidPointer(void *p) {
52+
return mlir::spirv::FuncOp::getFromOpaquePointer(p);
5353
}
54-
static constexpr int NumLowBitsAvailable = 3;
54+
static constexpr int numLowBitsAvailable = 3;
5555
};
5656

5757
} // namespace llvm

0 commit comments

Comments
 (0)