[PATCH] D78042: Eliminate all uses of Identifier::is() in the source tree, this doesn't remove the definition of it (yet). NFC.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 11:52:58 PDT 2020


rriddle accepted this revision.
rriddle added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/include/mlir/IR/Identifier.h:85
 
 // Identifier/Identifier equality comparisons are defined inline.
+inline bool operator==(Identifier lhs, StringRef rhs) {
----------------
nit: Can we use /// here?


================
Comment at: mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp:821
     if (llvm::any_of(elidedAttrs,
-                     [&](StringRef elided) { return attr.first.is(elided); })) {
+                     [&](StringRef elided) { return attr.first == elided; })) {
       continue;
----------------
Do you even need the lambda anymore, i.e., could you use `llvm::is_contained` now?


================
Comment at: mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp:889
     if (llvm::any_of(elidedAttrs,
-                     [&](StringRef elided) { return attr.first.is(elided); })) {
+                     [&](StringRef elided) { return attr.first == elided; })) {
       continue;
----------------
Same here.


================
Comment at: mlir/test/lib/Dialect/Test/TestDialect.cpp:411
   bool hadNames = llvm::any_of(result.attributes, [](NamedAttribute attr) {
-    return attr.first.is("names");
+    return attr.first == "names";
   });
----------------
Same here.


================
Comment at: mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp:619
     os << tabs
        << formatv("  if (llvm::any_of({0}, [&](StringRef elided)", elidedAttrs);
+    os << " {return attr.first == elided;})) {\n";
----------------
Same here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78042





More information about the llvm-commits mailing list