[llvm] 9d3f9f4 - Revert "[llvm-lib] Handle MIPS architecture (#121007)"

YunQiang Su via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 26 17:57:57 PST 2024


Author: YunQiang Su
Date: 2024-12-27T09:57:42+08:00
New Revision: 9d3f9f47e6e630b8308562297757e0911be03a18

URL: https://github.com/llvm/llvm-project/commit/9d3f9f47e6e630b8308562297757e0911be03a18
DIFF: https://github.com/llvm/llvm-project/commit/9d3f9f47e6e630b8308562297757e0911be03a18.diff

LOG: Revert "[llvm-lib] Handle MIPS architecture (#121007)"

This reverts commit 5d529c32cc2d5342a0d183881b6c3023435ed5d3.

Added: 
    

Modified: 
    llvm/lib/Object/WindowsMachineFlag.cpp
    llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp

Removed: 
    llvm/test/tools/llvm-lib/Inputs/mips.ll
    llvm/test/tools/llvm-lib/infer-machine.test
    llvm/test/tools/llvm-lib/machine-opt.test


################################################################################
diff  --git a/llvm/lib/Object/WindowsMachineFlag.cpp b/llvm/lib/Object/WindowsMachineFlag.cpp
index caf357e8c136f7..b9f818775768a2 100644
--- a/llvm/lib/Object/WindowsMachineFlag.cpp
+++ b/llvm/lib/Object/WindowsMachineFlag.cpp
@@ -21,7 +21,6 @@ using namespace llvm;
 
 // Returns /machine's value.
 COFF::MachineTypes llvm::getMachineType(StringRef S) {
-  // Flags must be a superset of Microsoft lib.exe /machine flags.
   return StringSwitch<COFF::MachineTypes>(S.lower())
       .Cases("x64", "amd64", COFF::IMAGE_FILE_MACHINE_AMD64)
       .Cases("x86", "i386", COFF::IMAGE_FILE_MACHINE_I386)
@@ -29,7 +28,6 @@ COFF::MachineTypes llvm::getMachineType(StringRef S) {
       .Case("arm64", COFF::IMAGE_FILE_MACHINE_ARM64)
       .Case("arm64ec", COFF::IMAGE_FILE_MACHINE_ARM64EC)
       .Case("arm64x", COFF::IMAGE_FILE_MACHINE_ARM64X)
-      .Case("mips", COFF::IMAGE_FILE_MACHINE_R4000)
       .Default(COFF::IMAGE_FILE_MACHINE_UNKNOWN);
 }
 

diff  --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index 6ce06b434b2c05..138d9fc7f1d7ff 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -171,7 +171,6 @@ static Expected<COFF::MachineTypes> getCOFFFileMachine(MemoryBufferRef MB) {
   uint16_t Machine = (*Obj)->getMachine();
   if (Machine != COFF::IMAGE_FILE_MACHINE_I386 &&
       Machine != COFF::IMAGE_FILE_MACHINE_AMD64 &&
-      Machine != COFF::IMAGE_FILE_MACHINE_R4000 &&
       Machine != COFF::IMAGE_FILE_MACHINE_ARMNT && !COFF::isAnyArm64(Machine)) {
     return createStringError(inconvertibleErrorCode(),
                              "unknown machine: " + std::to_string(Machine));
@@ -196,8 +195,6 @@ static Expected<COFF::MachineTypes> getBitcodeFileMachine(MemoryBufferRef MB) {
   case Triple::aarch64:
     return T.isWindowsArm64EC() ? COFF::IMAGE_FILE_MACHINE_ARM64EC
                                 : COFF::IMAGE_FILE_MACHINE_ARM64;
-  case Triple::mipsel:
-    return COFF::IMAGE_FILE_MACHINE_R4000;
   default:
     return createStringError(inconvertibleErrorCode(),
                              "unknown arch in target triple: " + *TripleStr);

diff  --git a/llvm/test/tools/llvm-lib/Inputs/mips.ll b/llvm/test/tools/llvm-lib/Inputs/mips.ll
deleted file mode 100644
index dd0f8338cfa97a..00000000000000
--- a/llvm/test/tools/llvm-lib/Inputs/mips.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-target triple = "mipsel-windows-coff"
-
-; Function Attrs: noinline nounwind optnone
-define dso_local void @"?f@@YAXXZ"() #0 {
-entry:
-  ret void
-}

diff  --git a/llvm/test/tools/llvm-lib/infer-machine.test b/llvm/test/tools/llvm-lib/infer-machine.test
deleted file mode 100644
index c1399c617af405..00000000000000
--- a/llvm/test/tools/llvm-lib/infer-machine.test
+++ /dev/null
@@ -1,19 +0,0 @@
-RUN: rm -rf %t && mkdir -p %t
-
-RUN: llc -mtriple=i386-windows-coff -filetype=obj -o %t/i386.obj %S/Inputs/i386.ll
-RUN: llvm-as %S/Inputs/i386.ll -o %t/i386.bc
-RUN: llvm-lib %t/i386.obj %t/i386.bc /out:%t/i386.lib
-RUN: llvm-objdump -h %t/i386.lib | FileCheck %s --check-prefix=I386
-I386: file format coff-i386
-
-RUN: llc -mtriple=x86_64-windows-coff -filetype=obj -o %t/x86_64.obj %S/Inputs/x86_64.ll
-RUN: llvm-as %S/Inputs/x86_64.ll -o %t/x86_64.bc
-RUN: llvm-lib %t/x86_64.obj %t/x86_64.bc /out:%t/x86_64.lib
-RUN: llvm-objdump -h %t/x86_64.lib | FileCheck %s --check-prefix=X86_64
-X86_64: file format coff-x86-64
-
-RUN: llc -mtriple=mipsel-windows-coff -filetype=obj -o %t/mips.obj %S/Inputs/mips.ll
-RUN: llvm-as %S/Inputs/mips.ll -o %t/mips.bc
-RUN: llvm-lib %t/mips.obj %t/mips.bc /out:%t/mips.lib
-RUN: llvm-objdump -h %t/mips.lib | FileCheck %s --check-prefix=MIPS
-MIPS: file format coff-mips

diff  --git a/llvm/test/tools/llvm-lib/machine-opt.test b/llvm/test/tools/llvm-lib/machine-opt.test
deleted file mode 100644
index e5ade82c2f0a63..00000000000000
--- a/llvm/test/tools/llvm-lib/machine-opt.test
+++ /dev/null
@@ -1,13 +0,0 @@
-RUN: rm -f %t.lib
-
-RUN: llvm-lib /out:%t.lib /machine:i386 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-RUN: llvm-lib /out:%t.lib /machine:amd64 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-
-RUN: llvm-lib /out:%t.lib /machine:mips 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-
-RUN: llvm-lib /out:%t.lib /machine:arm 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-RUN: llvm-lib /out:%t.lib /machine:arm64 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-RUN: llvm-lib /out:%t.lib /machine:arm64x 2>&1 | FileCheck --check-prefix=EMPTYWARN %s
-
-EMPTYWARN: warning: no input files, not writing output file
-


        


More information about the llvm-commits mailing list