Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:37

0001 //===- llvm/TextAPI/Architecture.h - Architecture ---------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Defines the architecture enum and helper methods.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_TEXTAPI_ARCHITECTURE_H
0014 #define LLVM_TEXTAPI_ARCHITECTURE_H
0015 
0016 #include <cstdint>
0017 #include <utility>
0018 
0019 namespace llvm {
0020 class raw_ostream;
0021 class StringRef;
0022 class Triple;
0023 
0024 namespace MachO {
0025 
0026 /// Defines the architecture slices that are supported by Text-based Stub files.
0027 enum Architecture : uint8_t {
0028 #define ARCHINFO(Arch, Type, SubType, NumBits) AK_##Arch,
0029 #include "llvm/TextAPI/Architecture.def"
0030 #undef ARCHINFO
0031   AK_unknown, // this has to go last.
0032 };
0033 
0034 /// Convert a CPU Type and Subtype pair to an architecture slice.
0035 Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType);
0036 
0037 /// Convert a name to an architecture slice.
0038 Architecture getArchitectureFromName(StringRef Name);
0039 
0040 /// Convert an architecture slice to a string.
0041 StringRef getArchitectureName(Architecture Arch);
0042 
0043 /// Convert an architecture slice to a CPU Type and Subtype pair.
0044 std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch);
0045 
0046 /// Convert a target to an architecture slice.
0047 Architecture mapToArchitecture(const llvm::Triple &Target);
0048 
0049 /// Check if architecture is 64 bit.
0050 bool is64Bit(Architecture);
0051 
0052 raw_ostream &operator<<(raw_ostream &OS, Architecture Arch);
0053 
0054 } // end namespace MachO.
0055 } // end namespace llvm.
0056 
0057 #endif // LLVM_TEXTAPI_ARCHITECTURE_H