[flang-commits] [flang] a621e79 - [flang][NFC] move fir namespace into FortranVariableOpInterface ODS declaration
Jean Perier via flang-commits
flang-commits at lists.llvm.org
Wed Nov 9 02:42:03 PST 2022
Author: Jean Perier
Date: 2022-11-09T11:41:24+01:00
New Revision: a621e799168ff6e57c27a49e6badd40b16bc44a8
URL: https://github.com/llvm/llvm-project/commit/a621e799168ff6e57c27a49e6badd40b16bc44a8
DIFF: https://github.com/llvm/llvm-project/commit/a621e799168ff6e57c27a49e6badd40b16bc44a8.diff
LOG: [flang][NFC] move fir namespace into FortranVariableOpInterface ODS declaration
This will be needed to be able to use this interface in HLFIR ODS operation definition
and get the right namespaces.
Differential Revision: https://reviews.llvm.org/D137702
Added:
Modified:
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h
flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 76a117d78e73e..69d0a47e7bdec 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -2872,7 +2872,7 @@ def fir_IsPresentOp : fir_SimpleOp<"is_present", [NoMemoryEffect]> {
}
def fir_DeclareOp : fir_Op<"declare", [AttrSizedOperandSegments,
- DeclareOpInterfaceMethods<FortranVariableOpInterface>]> {
+ DeclareOpInterfaceMethods<fir_FortranVariableOpInterface>]> {
let summary = "declare a variable";
let description = [{
diff --git a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h
index 0e0783ae222dd..60f71627a1bd4 100644
--- a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h
+++ b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h
@@ -19,8 +19,6 @@
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
-namespace fir {
#include "flang/Optimizer/Dialect/FortranVariableInterface.h.inc"
-} // namespace fir
#endif // FORTRAN_OPTIMIZER_DIALECT_FORTRANVARIABLEINTERFACE_H
diff --git a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
index 68f192f1b54f9..5911f39fa4a4b 100644
--- a/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
+++ b/flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
@@ -16,7 +16,7 @@
include "mlir/IR/OpBase.td"
-def FortranVariableOpInterface : OpInterface<"FortranVariableOpInterface"> {
+def fir_FortranVariableOpInterface : OpInterface<"FortranVariableOpInterface"> {
let description = [{
Interface for operations that create Fortran like variables in order to
query about all their Fortran properties.
@@ -151,6 +151,8 @@ def FortranVariableOpInterface : OpInterface<"FortranVariableOpInterface"> {
}];
+ let cppNamespace = "fir";
+
let verify = [{
return ::mlir::cast<::fir::FortranVariableOpInterface>($_op).verifyImpl();
}];
diff --git a/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp b/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
index 12e871a172dab..b0f7fab215c7d 100644
--- a/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
+++ b/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
@@ -12,9 +12,7 @@
#include "flang/Optimizer/Dialect/FortranVariableInterface.h"
-namespace fir {
#include "flang/Optimizer/Dialect/FortranVariableInterface.cpp.inc"
-}
mlir::LogicalResult fir::FortranVariableOpInterface::verifyImpl() {
const unsigned numExplicitTypeParams = getExplicitTypeParams().size();
More information about the flang-commits
mailing list