[PATCH] D110323: [fir][NFC] rename canBePointerOrHeapElementType to cannotBePointerOrHeapElementType

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 05:30:54 PDT 2021


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

This patch is part of the upstreaming effort from fir-dev branch.
Rename the function so the name conveys better what it does.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110323

Files:
  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
@@ -300,7 +300,7 @@
   return emitError() << "invalid type for boxproc" << eleTy << '\n';
 }
 
-static bool canBePointerOrHeapElementType(mlir::Type eleTy) {
+static bool cannotBePointerOrHeapElementType(mlir::Type eleTy) {
   return eleTy.isa<BoxType, BoxCharType, BoxProcType, ShapeType, ShapeShiftType,
                    SliceType, FieldType, LenType, HeapType, PointerType,
                    ReferenceType, TypeDescType>();
@@ -436,7 +436,7 @@
 mlir::LogicalResult
 fir::HeapType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
                       mlir::Type eleTy) {
-  if (canBePointerOrHeapElementType(eleTy))
+  if (cannotBePointerOrHeapElementType(eleTy))
     return emitError() << "cannot build a heap pointer to type: " << eleTy
                        << '\n';
   return mlir::success();
@@ -487,7 +487,7 @@
 mlir::LogicalResult fir::PointerType::verify(
     llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
     mlir::Type eleTy) {
-  if (canBePointerOrHeapElementType(eleTy))
+  if (cannotBePointerOrHeapElementType(eleTy))
     return emitError() << "cannot build a pointer to type: " << eleTy << '\n';
   return mlir::success();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110323.374514.patch
Type: text/x-patch
Size: 1387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210923/832c198a/attachment.bin>


More information about the llvm-commits mailing list