[PATCH] D138026: [ARM][AArch64] Use StringRef in TargetParser structs

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 03:25:42 PST 2022


DavidSpickett added a comment.

> This is now reverse, so that the "+arch-feature" is now visible in the .def, which is a bit clearer.

Clearer for what exactly.



================
Comment at: llvm/lib/Support/AArch64TargetParser.cpp:110
   for (const auto &AE : AArch64ARCHExtNames)
-    if (AE.Feature && ArchExt == AE.getName())
-      return StringRef(AE.Feature);
+    if (!AE.Feature.empty() && ArchExt == AE.Name)
+      return AE.Feature;
----------------
Maybe this is just me but "!empty()" could just be "size()".

I know sometimes containers make empty cheaper but here it's just `== 0` vs `!= 0`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138026



More information about the llvm-commits mailing list