diff options
author | River Riddle <riddleriver@gmail.com> | 2021-11-16 17:21:15 +0000 |
---|---|---|
committer | River Riddle <riddleriver@gmail.com> | 2021-11-16 17:36:26 +0000 |
commit | 195730a6505ac352ae9347010ba701ab5267aad7 (patch) | |
tree | 93e9d00f17286230ea4d86621a63a5a20ec3dc69 /mlir/unittests/IR | |
parent | e7568b68da8a216dc22cdc1c6d8903c94096c846 (diff) | |
download | llvm-195730a6505ac352ae9347010ba701ab5267aad7.tar.gz |
[mlir][NFC] Replace references to Identifier with StringAttr
This is part of the replacement of Identifier with StringAttr.
Differential Revision: https://reviews.llvm.org/D113953
Diffstat (limited to 'mlir/unittests/IR')
-rw-r--r-- | mlir/unittests/IR/AttributeTest.cpp | 7 | ||||
-rw-r--r-- | mlir/unittests/IR/OperationSupportTest.cpp | 8 |
2 files changed, 7 insertions, 8 deletions
diff --git a/mlir/unittests/IR/AttributeTest.cpp b/mlir/unittests/IR/AttributeTest.cpp index 19b57fa754df..f76ab456391a 100644 --- a/mlir/unittests/IR/AttributeTest.cpp +++ b/mlir/unittests/IR/AttributeTest.cpp @@ -8,7 +8,6 @@ #include "mlir/IR/BuiltinAttributes.h" #include "mlir/IR/BuiltinTypes.h" -#include "mlir/IR/Identifier.h" #include "gtest/gtest.h" using namespace mlir; @@ -152,7 +151,7 @@ TEST(DenseSplatTest, StringSplat) { MLIRContext context; context.allowUnregisteredDialects(); Type stringType = - OpaqueType::get(Identifier::get("test", &context), "string"); + OpaqueType::get(StringAttr::get(&context, "test"), "string"); StringRef value = "test-string"; testSplat(stringType, value); } @@ -161,7 +160,7 @@ TEST(DenseSplatTest, StringAttrSplat) { MLIRContext context; context.allowUnregisteredDialects(); Type stringType = - OpaqueType::get(Identifier::get("test", &context), "string"); + OpaqueType::get(StringAttr::get(&context, "test"), "string"); Attribute stringAttr = StringAttr::get("test-string", stringType); testSplat(stringType, stringAttr); } @@ -211,7 +210,7 @@ TEST(SparseElementsAttrTest, GetZero) { IntegerType intTy = IntegerType::get(&context, 32); FloatType floatTy = FloatType::getF32(&context); - Type stringTy = OpaqueType::get(Identifier::get("test", &context), "string"); + Type stringTy = OpaqueType::get(StringAttr::get(&context, "test"), "string"); ShapedType tensorI32 = RankedTensorType::get({2, 2}, intTy); ShapedType tensorF32 = RankedTensorType::get({2, 2}, floatTy); diff --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp index 8c46d961f0cc..b0b48b099f2b 100644 --- a/mlir/unittests/IR/OperationSupportTest.cpp +++ b/mlir/unittests/IR/OperationSupportTest.cpp @@ -237,10 +237,10 @@ TEST(NamedAttrListTest, TestAppendAssign) { { auto it = attrs.begin(); - EXPECT_EQ(it->first, b.getIdentifier("foo")); + EXPECT_EQ(it->first, b.getStringAttr("foo")); EXPECT_EQ(it->second, b.getStringAttr("bar")); ++it; - EXPECT_EQ(it->first, b.getIdentifier("baz")); + EXPECT_EQ(it->first, b.getStringAttr("baz")); EXPECT_EQ(it->second, b.getStringAttr("boo")); } @@ -261,10 +261,10 @@ TEST(NamedAttrListTest, TestAppendAssign) { { auto it = attrs.begin(); - EXPECT_EQ(it->first, b.getIdentifier("foo")); + EXPECT_EQ(it->first, b.getStringAttr("foo")); EXPECT_EQ(it->second, b.getStringAttr("f")); ++it; - EXPECT_EQ(it->first, b.getIdentifier("zoo")); + EXPECT_EQ(it->first, b.getStringAttr("zoo")); EXPECT_EQ(it->second, b.getStringAttr("z")); } |