[PATCH] D42979: [ARM] Add 'fillValidCPUArchList' to ARM targets

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 00:54:01 PST 2018


samparker accepted this revision.
samparker added a comment.
This revision is now accepted and ready to land.

Thanks. LGTM to me with two small nits.



================
Comment at: lib/Support/TargetParser.cpp:702
+    if (Arch.ArchID != AArch64::ArchKind::INVALID)
+      Values.emplace_back(Arch.NameCStr, Arch.NameLength);
+  }
----------------
CpuNames has the getName helper for just this.


================
Comment at: unittests/Support/TargetParserTest.cpp:285
+TEST(TargetParserTest, testARMCPUArchList) {
+  SmallVector<StringRef, 32> List;
+  ARM::fillValidCPUArchList(List);
----------------
Why create a SmallVector with fewer elements than you know will be required?


https://reviews.llvm.org/D42979





More information about the llvm-commits mailing list