[flang][NFC] move HLFIR dialect definition in IR
authorJean Perier <jperier@nvidia.com>
Wed, 9 Nov 2022 10:37:53 +0000 (11:37 +0100)
committerJean Perier <jperier@nvidia.com>
Wed, 9 Nov 2022 10:39:12 +0000 (11:39 +0100)
Transforms will need to be put in a different library to avoid circular
dependencies with other parts of the compiler. So create an IR
directory, this (flat include directory, IR and Transform directories in
lib) matches how dialects like LLVM dialect are implemented.

Differential Revision: https://reviews.llvm.org/D137701

flang/lib/Optimizer/HLFIR/CMakeLists.txt
flang/lib/Optimizer/HLFIR/IR/CMakeLists.txt [new file with mode: 0644]
flang/lib/Optimizer/HLFIR/IR/HLFIRDialect.cpp [moved from flang/lib/Optimizer/HLFIR/HLFIRDialect.cpp with 100% similarity]

index 890bc52..f33061b 100644 (file)
@@ -1,20 +1 @@
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-
-add_flang_library(HLFIRDialect
-  HLFIRDialect.cpp
-
-  DEPENDS
-  FIRDialect
-  HLFIROpsIncGen
-  ${dialect_libs}
-
-  LINK_LIBS
-  FIRDialect
-  MLIRIR
-  ${dialect_libs}
-
-  LINK_COMPONENTS
-  AsmParser
-  AsmPrinter
-  Remarks
-)
+add_subdirectory(IR)
diff --git a/flang/lib/Optimizer/HLFIR/IR/CMakeLists.txt b/flang/lib/Optimizer/HLFIR/IR/CMakeLists.txt
new file mode 100644 (file)
index 0000000..890bc52
--- /dev/null
@@ -0,0 +1,20 @@
+get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+
+add_flang_library(HLFIRDialect
+  HLFIRDialect.cpp
+
+  DEPENDS
+  FIRDialect
+  HLFIROpsIncGen
+  ${dialect_libs}
+
+  LINK_LIBS
+  FIRDialect
+  MLIRIR
+  ${dialect_libs}
+
+  LINK_COMPONENTS
+  AsmParser
+  AsmPrinter
+  Remarks
+)