Skip to content

Commit a1a1d33

Browse files
committed
[flang][NFC] Make KindTy consistent and consistently used.
Differential Revision: https://reviews.llvm.org/D96154
1 parent ea35745 commit a1a1d33

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

flang/include/flang/Optimizer/Dialect/FIRType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace fir {
3636

3737
class FIROpsDialect;
3838

39-
using KindTy = int;
39+
using KindTy = unsigned;
4040

4141
namespace detail {
4242
struct BoxTypeStorage;

flang/lib/Optimizer/Dialect/FIRType.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8+
//
9+
// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10+
//
11+
//===----------------------------------------------------------------------===//
812

913
#include "flang/Optimizer/Dialect/FIRType.h"
1014
#include "flang/Optimizer/Dialect/FIRDialect.h"
15+
#include "mlir/IR/Builders.h"
1116
#include "mlir/IR/Diagnostics.h"
1217
#include "mlir/IR/DialectImplementation.h"
1318
#include "llvm/ADT/SmallPtrSet.h"
@@ -838,7 +843,7 @@ CharacterType fir::CharacterType::get(mlir::MLIRContext *ctxt, KindTy kind) {
838843
return Base::get(ctxt, kind);
839844
}
840845

841-
int fir::CharacterType::getFKind() const { return getImpl()->getFKind(); }
846+
KindTy fir::CharacterType::getFKind() const { return getImpl()->getFKind(); }
842847

843848
// Field
844849

@@ -858,15 +863,15 @@ LogicalType fir::LogicalType::get(mlir::MLIRContext *ctxt, KindTy kind) {
858863
return Base::get(ctxt, kind);
859864
}
860865

861-
int fir::LogicalType::getFKind() const { return getImpl()->getFKind(); }
866+
KindTy fir::LogicalType::getFKind() const { return getImpl()->getFKind(); }
862867

863868
// INTEGER
864869

865870
fir::IntegerType fir::IntegerType::get(mlir::MLIRContext *ctxt, KindTy kind) {
866871
return Base::get(ctxt, kind);
867872
}
868873

869-
int fir::IntegerType::getFKind() const { return getImpl()->getFKind(); }
874+
KindTy fir::IntegerType::getFKind() const { return getImpl()->getFKind(); }
870875

871876
// COMPLEX
872877

@@ -886,7 +891,7 @@ RealType fir::RealType::get(mlir::MLIRContext *ctxt, KindTy kind) {
886891
return Base::get(ctxt, kind);
887892
}
888893

889-
int fir::RealType::getFKind() const { return getImpl()->getFKind(); }
894+
KindTy fir::RealType::getFKind() const { return getImpl()->getFKind(); }
890895

891896
// Box<T>
892897

0 commit comments

Comments
 (0)