LLVM 24.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"
18
19using namespace llvm;
20
21// Returns /machine's value.
23 // Flags must be a superset of Microsoft lib.exe /machine flags.
25 .Cases({"x64", "amd64"}, COFF::IMAGE_FILE_MACHINE_AMD64)
26 .Cases({"x86", "i386"}, COFF::IMAGE_FILE_MACHINE_I386)
33}
34
36 switch (MT) {
38 return "arm";
40 return "arm64";
42 return "arm64ec";
44 return "arm64x";
46 return "x64";
48 return "x86";
49 default:
50 return "unknown";
51 }
52}
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
LLVM_ABI std::string lower() const
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
MachineTypes
Definition COFF.h:93
@ IMAGE_FILE_MACHINE_ARM64
Definition COFF.h:101
@ IMAGE_FILE_MACHINE_UNKNOWN
Definition COFF.h:96
@ IMAGE_FILE_MACHINE_AMD64
Definition COFF.h:98
@ IMAGE_FILE_MACHINE_ARM64EC
Definition COFF.h:102
@ IMAGE_FILE_MACHINE_R4000
Definition COFF.h:113
@ IMAGE_FILE_MACHINE_I386
Definition COFF.h:105
@ IMAGE_FILE_MACHINE_ARM64X
Definition COFF.h:103
@ IMAGE_FILE_MACHINE_ARMNT
Definition COFF.h:100
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI COFF::MachineTypes getMachineType(StringRef S)
LLVM_ABI StringRef machineToStr(COFF::MachineTypes MT)