[PATCH] D105274: Define sys::getHostCPUName for RISC-V

Andreas Schwab via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 04:07:09 PDT 2021


schwab updated this revision to Diff 364748.
schwab added a comment.

Remove dead return.


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

https://reviews.llvm.org/D105274

Files:
  llvm/lib/Support/Host.cpp


Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -1354,6 +1354,16 @@
     return "generic";
   }
 }
+#elif defined(__riscv)
+StringRef sys::getHostCPUName() {
+#if __riscv_xlen == 64
+  return "generic-rv64";
+#elif __riscv_xlen == 32
+  return "generic-rv32";
+#else
+#error "Unhandled value of __riscv_xlen"
+#endif
+}
 #else
 StringRef sys::getHostCPUName() { return "generic"; }
 namespace llvm {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105274.364748.patch
Type: text/x-patch
Size: 516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210806/597d4883/attachment.bin>


More information about the llvm-commits mailing list