[Mlir-commits] [mlir] 71da391 - [mlir][NFC] Use proper c++ namespaces in .td files

Jeff Niu llvmlistbot at llvm.org
Tue Jul 19 08:51:25 PDT 2022


Author: lipracer
Date: 2022-07-19T08:51:21-07:00
New Revision: 71da3914c1b6a3f616e048bb5bd28440290b30f7

URL: https://github.com/llvm/llvm-project/commit/71da3914c1b6a3f616e048bb5bd28440290b30f7
DIFF: https://github.com/llvm/llvm-project/commit/71da3914c1b6a3f616e048bb5bd28440290b30f7.diff

LOG: [mlir][NFC] Use proper c++ namespaces in .td files

td files:
mlir::ArrayRef => llvm::ArrayRef
mlir::Optional=>llvm::Optional
mlir::SmallVector => llvm::SmallVector

Reviewed By: rriddle

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

Added: 
    

Modified: 
    mlir/include/mlir/Interfaces/CallInterfaces.td
    mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    mlir/include/mlir/Interfaces/InferTypeOpInterface.td
    mlir/include/mlir/Interfaces/LoopLikeInterface.td
    mlir/include/mlir/Interfaces/VectorInterfaces.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Interfaces/CallInterfaces.td b/mlir/include/mlir/Interfaces/CallInterfaces.td
index 8bee7cf85ca6..96540675f833 100644
--- a/mlir/include/mlir/Interfaces/CallInterfaces.td
+++ b/mlir/include/mlir/Interfaces/CallInterfaces.td
@@ -82,7 +82,7 @@ def CallableOpInterface : OpInterface<"CallableOpInterface"> {
         Returns the results types that the callable region produces when
         executed.
       }],
-      "::mlir::ArrayRef<::mlir::Type>", "getCallableResults"
+      "::llvm::ArrayRef<::mlir::Type>", "getCallableResults"
     >,
   ];
 }

diff  --git a/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
index 2fc4977e75db..093c6d24172f 100644
--- a/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
+++ b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
@@ -70,11 +70,11 @@ def BranchOpInterface : OpInterface<"BranchOpInterface"> {
         some successor, or None if `operandIndex` isn't a successor operand
         index.
       }],
-      "::mlir::Optional<::mlir::BlockArgument>", "getSuccessorBlockArgument",
+      "::llvm::Optional<::mlir::BlockArgument>", "getSuccessorBlockArgument",
       (ins "unsigned":$operandIndex), [{
         ::mlir::Operation *opaqueOp = $_op;
         for (unsigned i = 0, e = opaqueOp->getNumSuccessors(); i != e; ++i) {
-          if (::mlir::Optional<::mlir::BlockArgument> arg = ::mlir::detail::getBranchSuccessorArgument(
+          if (::llvm::Optional<::mlir::BlockArgument> arg = ::mlir::detail::getBranchSuccessorArgument(
                 $_op.getSuccessorOperands(i), operandIndex,
                 opaqueOp->getSuccessor(i)))
             return arg;
@@ -87,7 +87,7 @@ def BranchOpInterface : OpInterface<"BranchOpInterface"> {
         operands. Returns nullptr if a single successor could not be chosen.
       }],
       "::mlir::Block *", "getSuccessorForOperands",
-      (ins "::mlir::ArrayRef<::mlir::Attribute>":$operands), [{}],
+      (ins "::llvm::ArrayRef<::mlir::Attribute>":$operands), [{}],
       /*defaultImplementation=*/[{ return nullptr; }]
     >,
     InterfaceMethod<[{
@@ -161,8 +161,8 @@ def RegionBranchOpInterface : OpInterface<"RegionBranchOpInterface"> {
         successor region must be non-empty.
       }],
       "void", "getSuccessorRegions",
-      (ins "::mlir::Optional<unsigned>":$index,
-           "::mlir::ArrayRef<::mlir::Attribute>":$operands,
+      (ins "::llvm::Optional<unsigned>":$index,
+           "::llvm::ArrayRef<::mlir::Attribute>":$operands,
            "::llvm::SmallVectorImpl<::mlir::RegionSuccessor> &":$regions)
     >,
     InterfaceMethod<[{
@@ -183,7 +183,7 @@ def RegionBranchOpInterface : OpInterface<"RegionBranchOpInterface"> {
         be the region invocations if these were the operands?"
       }],
       "void", "getRegionInvocationBounds",
-      (ins "::mlir::ArrayRef<::mlir::Attribute>":$operands,
+      (ins "::llvm::ArrayRef<::mlir::Attribute>":$operands,
            "::llvm::SmallVectorImpl<::mlir::InvocationBounds> &"
              :$invocationBounds), [{}],
        [{ invocationBounds.append($_op->getNumRegions(),
@@ -239,7 +239,7 @@ def RegionBranchTerminatorOpInterface :
         the parent operation.
       }],
       "::mlir::MutableOperandRange", "getMutableSuccessorOperands",
-      (ins "::mlir::Optional<unsigned>":$index)
+      (ins "::llvm::Optional<unsigned>":$index)
     >,
     InterfaceMethod<[{
         Returns a range of operands that are semantically "returned" by passing
@@ -248,7 +248,7 @@ def RegionBranchTerminatorOpInterface :
         operation.
       }],
       "::mlir::OperandRange", "getSuccessorOperands",
-      (ins "::mlir::Optional<unsigned>":$index), [{}],
+      (ins "::llvm::Optional<unsigned>":$index), [{}],
       /*defaultImplementation=*/[{
         return $_op.getMutableSuccessorOperands(index);
       }]

diff  --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
index e1d9e5e120e1..3c6391732d0d 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
@@ -144,7 +144,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       /*retTy=*/"::mlir::LogicalResult",
       /*methodName=*/"inferReturnTypeComponents",
       /*args=*/(ins "::mlir::MLIRContext*":$context,
-                    "::mlir::Optional<::mlir::Location>":$location,
+                    "::llvm::Optional<::mlir::Location>":$location,
                     "::mlir::ValueShapeRange":$operands,
                     "::mlir::DictionaryAttr":$attributes,
                     "::mlir::RegionRange":$regions,

diff  --git a/mlir/include/mlir/Interfaces/LoopLikeInterface.td b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
index 4e3dd574c743..2578b1b26b7c 100644
--- a/mlir/include/mlir/Interfaces/LoopLikeInterface.td
+++ b/mlir/include/mlir/Interfaces/LoopLikeInterface.td
@@ -52,7 +52,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         If there is a single induction variable return it, otherwise return
         llvm::None.
       }],
-      /*retTy=*/"::mlir::Optional<::mlir::Value>",
+      /*retTy=*/"::llvm::Optional<::mlir::Value>",
       /*methodName=*/"getSingleInductionVar",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -64,7 +64,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         Return the single lower bound value or attribute if it exists, otherwise
         return llvm::None.
       }],
-      /*retTy=*/"::mlir::Optional<::mlir::OpFoldResult>",
+      /*retTy=*/"::llvm::Optional<::mlir::OpFoldResult>",
       /*methodName=*/"getSingleLowerBound",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -76,7 +76,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         Return the single step value or attribute if it exists, otherwise
         return llvm::None.
       }],
-      /*retTy=*/"::mlir::Optional<::mlir::OpFoldResult>",
+      /*retTy=*/"::llvm::Optional<::mlir::OpFoldResult>",
       /*methodName=*/"getSingleStep",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -88,7 +88,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
         Return the single upper bound value or attribute if it exists, otherwise
         return llvm::None.
       }],
-      /*retTy=*/"::mlir::Optional<::mlir::OpFoldResult>",
+      /*retTy=*/"::llvm::Optional<::mlir::OpFoldResult>",
       /*methodName=*/"getSingleUpperBound",
       /*args=*/(ins),
       /*methodBody=*/"",

diff  --git a/mlir/include/mlir/Interfaces/VectorInterfaces.td b/mlir/include/mlir/Interfaces/VectorInterfaces.td
index c36d6d1d7aa6..063ddb31ca36 100644
--- a/mlir/include/mlir/Interfaces/VectorInterfaces.td
+++ b/mlir/include/mlir/Interfaces/VectorInterfaces.td
@@ -28,7 +28,7 @@ def VectorUnrollOpInterface : OpInterface<"VectorUnrollOpInterface"> {
         `targetShape`. Return `None` if the op cannot be unrolled to the target
         vector shape.
       }],
-      /*retTy=*/"::mlir::Optional<::llvm::SmallVector<int64_t, 4>>",
+      /*retTy=*/"::llvm::Optional<::llvm::SmallVector<int64_t, 4>>",
       /*methodName=*/"getShapeForUnroll",
       /*args=*/(ins),
       /*methodBody=*/"",
@@ -143,7 +143,7 @@ def VectorTransferOpInterface : OpInterface<"VectorTransferOpInterface"> {
     >,
     InterfaceMethod<
       /*desc=*/"Return the `in_bounds` boolean ArrayAttr.",
-      /*retTy=*/"::mlir::Optional<::mlir::ArrayAttr>",
+      /*retTy=*/"::llvm::Optional<::mlir::ArrayAttr>",
       /*methodName=*/"in_bounds",
       /*args=*/(ins),
       /*methodBody=*/"return $_op.getInBounds();"


        


More information about the Mlir-commits mailing list