[PATCH] D96154: [flang][NFC] Make KindTy consistent and consistently used.

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 09:43:43 PST 2021


schweitz created this revision.
schweitz added reviewers: jeanPerier, svedanayagam, clementval, kiranchandramohan, SouraVX.
schweitz added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
schweitz requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96154

Files:
  flang/include/flang/Optimizer/Dialect/FIRType.h
  flang/lib/Optimizer/Dialect/FIRType.cpp


Index: flang/lib/Optimizer/Dialect/FIRType.cpp
===================================================================
--- flang/lib/Optimizer/Dialect/FIRType.cpp
+++ flang/lib/Optimizer/Dialect/FIRType.cpp
@@ -5,9 +5,14 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
+//
+// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
+//
+//===----------------------------------------------------------------------===//
 
 #include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/Optimizer/Dialect/FIRDialect.h"
+#include "mlir/IR/Builders.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/DialectImplementation.h"
 #include "llvm/ADT/SmallPtrSet.h"
@@ -838,7 +843,7 @@
   return Base::get(ctxt, kind);
 }
 
-int fir::CharacterType::getFKind() const { return getImpl()->getFKind(); }
+KindTy fir::CharacterType::getFKind() const { return getImpl()->getFKind(); }
 
 // Field
 
@@ -858,7 +863,7 @@
   return Base::get(ctxt, kind);
 }
 
-int fir::LogicalType::getFKind() const { return getImpl()->getFKind(); }
+KindTy fir::LogicalType::getFKind() const { return getImpl()->getFKind(); }
 
 // INTEGER
 
@@ -866,7 +871,7 @@
   return Base::get(ctxt, kind);
 }
 
-int fir::IntegerType::getFKind() const { return getImpl()->getFKind(); }
+KindTy fir::IntegerType::getFKind() const { return getImpl()->getFKind(); }
 
 // COMPLEX
 
@@ -886,7 +891,7 @@
   return Base::get(ctxt, kind);
 }
 
-int fir::RealType::getFKind() const { return getImpl()->getFKind(); }
+KindTy fir::RealType::getFKind() const { return getImpl()->getFKind(); }
 
 // Box<T>
 
Index: flang/include/flang/Optimizer/Dialect/FIRType.h
===================================================================
--- flang/include/flang/Optimizer/Dialect/FIRType.h
+++ flang/include/flang/Optimizer/Dialect/FIRType.h
@@ -36,7 +36,7 @@
 
 class FIROpsDialect;
 
-using KindTy = int;
+using KindTy = unsigned;
 
 namespace detail {
 struct BoxTypeStorage;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96154.321808.patch
Type: text/x-patch
Size: 2028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210205/0b5cfdb1/attachment.bin>


More information about the llvm-commits mailing list