[PATCH] D113569: [flang][nfc] Add missing headers in TypeConverter.h

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 10:49:38 PST 2021


awarzynski updated this revision to Diff 386246.
awarzynski added a comment.

Remove `#include`s from CodeGen.cpp that belong in TypeConverter.h


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113569/new/

https://reviews.llvm.org/D113569

Files:
  flang/lib/Optimizer/CodeGen/CodeGen.cpp
  flang/lib/Optimizer/CodeGen/TypeConverter.h


Index: flang/lib/Optimizer/CodeGen/TypeConverter.h
===================================================================
--- flang/lib/Optimizer/CodeGen/TypeConverter.h
+++ flang/lib/Optimizer/CodeGen/TypeConverter.h
@@ -16,9 +16,11 @@
 #include "DescriptorModel.h"
 #include "Target.h"
 #include "flang/Lower/Todo.h" // remove when TODO's are done
+#include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/Optimizer/Support/FIRContext.h"
 #include "flang/Optimizer/Support/KindMapping.h"
-#include "llvm/ADT/StringMap.h"
+#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
+#include "mlir/Transforms//DialectConversion.h"
 #include "llvm/Support/Debug.h"
 
 namespace fir {
@@ -95,7 +97,7 @@
   // the addendum defined in descriptor.h.
   mlir::Type convertBoxType(BoxType box, int rank = unknownRank()) {
     // (base_addr*, elem_len, version, rank, type, attribute, f18Addendum, [dim]
-    SmallVector<mlir::Type> dataDescFields;
+    llvm::SmallVector<mlir::Type> dataDescFields;
     mlir::Type ele = box.getEleTy();
     // remove fir.heap/fir.ref/fir.ptr
     if (auto removeIndirection = fir::dyn_cast_ptrEleTy(ele))
@@ -246,7 +248,7 @@
     case llvm::Type::TypeID::FP128TyID:
       return mlir::FloatType::getF128(&getContext());
     default:
-      emitError(UnknownLoc::get(&getContext()))
+      emitError(mlir::UnknownLoc::get(&getContext()))
           << "unsupported type: !fir.real<" << kind << ">";
       return {};
     }
Index: flang/lib/Optimizer/CodeGen/CodeGen.cpp
===================================================================
--- flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -13,11 +13,8 @@
 #include "flang/Optimizer/CodeGen/CodeGen.h"
 #include "PassDetail.h"
 #include "flang/Optimizer/Dialect/FIROps.h"
-#include "flang/Optimizer/Dialect/FIRType.h"
-#include "flang/Optimizer/Support/FIRContext.h"
 #include "mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h"
 #include "mlir/Conversion/LLVMCommon/Pattern.h"
-#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
 #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Matchers.h"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113569.386246.patch
Type: text/x-patch
Size: 2186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211110/c996701d/attachment-0001.bin>


More information about the llvm-commits mailing list