Skip to content

Commit

Permalink
Revert "[llvm-lib] Handle MIPS architecture (#121007)"
Browse files Browse the repository at this point in the history
This reverts commit 5d529c3.
  • Loading branch information
wzssyqa committed Dec 27, 2024
1 parent 6b53a95 commit 9d3f9f4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 44 deletions.
2 changes: 0 additions & 2 deletions llvm/lib/Object/WindowsMachineFlag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ 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)
.Case("arm", COFF::IMAGE_FILE_MACHINE_ARMNT)
.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);
}

Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions llvm/test/tools/llvm-lib/Inputs/mips.ll

This file was deleted.

19 changes: 0 additions & 19 deletions llvm/test/tools/llvm-lib/infer-machine.test

This file was deleted.

13 changes: 0 additions & 13 deletions llvm/test/tools/llvm-lib/machine-opt.test

This file was deleted.

0 comments on commit 9d3f9f4

Please sign in to comment.