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

Andreas Schwab via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 11:28:16 PDT 2021


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

Use #error.


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
@@ -1335,6 +1335,17 @@
     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"
+  return "generic";
+#endif
+}
 #else
 StringRef sys::getHostCPUName() { return "generic"; }
 namespace llvm {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105274.360899.patch
Type: text/x-patch
Size: 537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/cde8c594/attachment.bin>


More information about the llvm-commits mailing list