# std\.\{coff,elf\}: Remove the \{MachineType,EM\}\.toTargetCpuArch\(\) functions\. · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f

Requested commit: a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f

Commit: a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f

Tree: a3ec23392b88a7d9e9a2fa9cb99f21d5c2cc6b9f

Author: Alex Rønne Petersen

Committer: Alex Rønne Petersen

## Message

```
std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.

These are fundamentally incapable of producing accurate information for reasons
I've laid out in #20771. Since our only use of these functions is to check that
object files have the correct machine type, and since #21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes #20771.

```

## Parents

- [3fb6e46f6e4231b9569193a15a4357a2ae11fb0f](https://git.cafe/gitcafe/zig/commit/3fb6e46f6e4231b9569193a15a4357a2ae11fb0f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f?format=markdown)
