LLVM 20.0.0git
WindowsMachineFlag.cpp
Go to the documentation of this file.
1//===- WindowsMachineFlag.cpp ---------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Functions for implementing the /machine: flag.
10//
11//===----------------------------------------------------------------------===//
12
14
15#include "llvm/ADT/StringRef.h"
19
20using namespace llvm;
21
22// Returns /machine's value.
32}
33
35 switch (MT) {
37 return "arm";
39 return "arm64";
41 return "arm64ec";
43 return "arm64x";
45 return "x64";
47 return "x86";
48 default:
49 llvm_unreachable("unknown machine type");
50 }
51}
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
std::string lower() const
Definition: StringRef.cpp:113
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:44
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:69
R Default(T Value)
Definition: StringSwitch.h:182
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
Definition: StringSwitch.h:90
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineTypes
Definition: COFF.h:92
@ IMAGE_FILE_MACHINE_ARM64
Definition: COFF.h:100
@ IMAGE_FILE_MACHINE_UNKNOWN
Definition: COFF.h:95
@ IMAGE_FILE_MACHINE_AMD64
Definition: COFF.h:97
@ IMAGE_FILE_MACHINE_ARM64EC
Definition: COFF.h:101
@ IMAGE_FILE_MACHINE_I386
Definition: COFF.h:104
@ IMAGE_FILE_MACHINE_ARM64X
Definition: COFF.h:102
@ IMAGE_FILE_MACHINE_ARMNT
Definition: COFF.h:99
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
COFF::MachineTypes getMachineType(StringRef S)
StringRef machineToStr(COFF::MachineTypes MT)