[llvm] [LoongArch] Enable all -target-abi options (PR #92222)

WÁNG Xuěruì via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 02:15:01 PDT 2024


================
@@ -14,13 +14,44 @@
 #include "LoongArchBaseInfo.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TargetParser/Triple.h"
 
 namespace llvm {
 
 namespace LoongArchABI {
 
+// Check if ABI has been standardized; issue a warning if it hasn't.
+// FIXME: Once all ABIs are standardized, this will be removed.
+static ABI checkABIStandardized(ABI Abi) {
+  bool IsStandardized = false;
+  StringRef ABIName;
+  switch (Abi) {
+  case ABI_ILP32S:
+    ABIName = "ilp32s";
+    break;
+  case ABI_ILP32F:
+    ABIName = "ilp32f";
+    break;
+  case ABI_ILP32D:
+    ABIName = "ilp32d";
+    break;
+  case ABI_LP64F:
+    ABIName = "lp64f";
+    break;
+  case ABI_LP64S:
+  case ABI_LP64D:
+    IsStandardized = true;
----------------
xen0n wrote:

This can simply be `return Abi` so the `IsStandardized` flag can go away for simpler code.

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


More information about the llvm-commits mailing list