Skip to content

Commit af2f377

Browse files
committed
refac: add static to functions
1 parent c12083d commit af2f377

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

zkir/Dialect/Field/Conversions/FieldToModArith/FieldToModArith.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ namespace mlir::zkir::field {
3232
#define GEN_PASS_DEF_PRIMEFIELDTOMODARITH
3333
#include "zkir/Dialect/Field/Conversions/FieldToModArith/FieldToModArith.h.inc"
3434

35-
mod_arith::ModArithType convertPrimeFieldType(PrimeFieldType type) {
35+
static mod_arith::ModArithType convertPrimeFieldType(PrimeFieldType type) {
3636
IntegerAttr modulus = type.getModulus();
3737
return mod_arith::ModArithType::get(type.getContext(), modulus);
3838
}
3939

40-
Type convertPrimeFieldLikeType(ShapedType type) {
40+
static Type convertPrimeFieldLikeType(ShapedType type) {
4141
if (auto primeFieldType =
4242
llvm::dyn_cast<PrimeFieldType>(type.getElementType())) {
4343
return type.cloneWith(type.getShape(),

zkir/Dialect/ModArith/Conversions/ModArithToArith/ModArithToArith.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ namespace mlir::zkir::mod_arith {
3131
#define GEN_PASS_DEF_MODARITHTOARITH
3232
#include "zkir/Dialect/ModArith/Conversions/ModArithToArith/ModArithToArith.h.inc"
3333

34-
IntegerType convertModArithType(ModArithType type) {
34+
static IntegerType convertModArithType(ModArithType type) {
3535
APInt modulus = type.getModulus().getValue();
3636
return IntegerType::get(type.getContext(), modulus.getBitWidth());
3737
}
3838

39-
Type convertModArithLikeType(ShapedType type) {
39+
static Type convertModArithLikeType(ShapedType type) {
4040
if (auto modArithType = llvm::dyn_cast<ModArithType>(type.getElementType())) {
4141
return type.cloneWith(type.getShape(), convertModArithType(modArithType));
4242
}
@@ -58,7 +58,7 @@ class ModArithToArithTypeConverter : public TypeConverter {
5858
// needed to represent the result of mod_arith op as an integer
5959
// before applying a remainder operation
6060
template <typename Op>
61-
TypedAttr modulusAttr(Op op, bool mul = false) {
61+
static TypedAttr modulusAttr(Op op, bool mul = false) {
6262
auto type = op.getResult().getType();
6363
auto modArithType = getResultModArithType(op);
6464
APInt modulus = modArithType.getModulus().getValue();
@@ -80,7 +80,7 @@ TypedAttr modulusAttr(Op op, bool mul = false) {
8080

8181
// used for extui/trunci
8282
template <typename Op>
83-
inline Type modulusType(Op op, bool mul = false) {
83+
static inline Type modulusType(Op op, bool mul = false) {
8484
return modulusAttr(op, mul).getType();
8585
}
8686

zkir/Dialect/Poly/Conversions/PolyToField/PolyToField.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace mlir::zkir::poly {
1818
#define GEN_PASS_DEF_POLYTOFIELD
1919
#include "zkir/Dialect/Poly/Conversions/PolyToField/PolyToField.h.inc"
2020

21-
RankedTensorType convertPolyType(PolyType type) {
21+
static RankedTensorType convertPolyType(PolyType type) {
2222
int64_t maxDegree = type.getMaxDegree().getValue().getSExtValue();
2323
return RankedTensorType::get({static_cast<int64_t>(maxDegree + 1)},
2424
type.getBaseField());
@@ -41,7 +41,7 @@ struct CommonConversionInfo {
4141
RankedTensorType tensorType;
4242
};
4343

44-
FailureOr<CommonConversionInfo> getCommonConversionInfo(
44+
static FailureOr<CommonConversionInfo> getCommonConversionInfo(
4545
Operation *op, const TypeConverter *typeConverter) {
4646
// Most ops have a single result type that is a polynomial
4747
PolyType polyTy = dyn_cast<PolyType>(op->getResult(0).getType());

0 commit comments

Comments
 (0)