[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 23 21:30:31 PDT 2024


================
@@ -1571,7 +1571,9 @@ StringRef sys::getHostCPUName() {
 #if defined(__linux__)
   std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
   StringRef Content = P ? P->getBuffer() : "";
-  return detail::getHostCPUNameForRISCV(Content);
+  StringRef Name = detail::getHostCPUNameForRISCV(Content);
+  if (!Name.empty())
+    return Name;
----------------
dtcxzyw wrote:

Oops, I missed `#else` below this line :)


https://github.com/llvm/llvm-project/pull/94352


More information about the llvm-commits mailing list