[PATCH] D95966: [AIX][support] Implement getHostCPUName
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 9 07:58:19 PST 2021
hubert.reinterpretcast added a comment.
LGTM with minor comments on the test.
================
Comment at: llvm/unittests/Support/Host.cpp:436
+TEST_F(HostTest, AIXHostCPUDetect) {
+ // return a value base on the current processor implementation mode.
+ const char *ExePath = "/usr/sbin/getsystype";
----------------
Minor comment wording/formatting nits.
================
Comment at: llvm/unittests/Support/Host.cpp:455
+
+ // just do the comparision on the base implementation mode.
+ if (HostCPU == "970")
----------------
Minor nit: Format as English prose (especially since there's already a period at the end).
================
Comment at: llvm/unittests/Support/Host.cpp:458-459
+ HostCPU = StringRef("pwr4");
+ else if (isalpha(HostCPU.back()))
+ HostCPU = HostCPU.slice(0, HostCPU.size() - 1);
+
----------------
... or `rtrim`.
================
Comment at: llvm/unittests/Support/Host.cpp:459
+ else if (isalpha(HostCPU.back()))
+ HostCPU = HostCPU.slice(0, HostCPU.size() - 1);
+
----------------
Use `drop_back`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95966/new/
https://reviews.llvm.org/D95966
More information about the llvm-commits
mailing list