Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/TextAPI/MachO/Architecture.h
Show All 19 Lines | |||||
class raw_ostream; | class raw_ostream; | ||||
class StringRef; | class StringRef; | ||||
class Triple; | class Triple; | ||||
namespace MachO { | namespace MachO { | ||||
/// Defines the architecture slices that are supported by Text-based Stub files. | /// Defines the architecture slices that are supported by Text-based Stub files. | ||||
enum Architecture : uint8_t { | enum Architecture : uint8_t { | ||||
#define ARCHINFO(Arch, Type, SubType) AK_##Arch, | #define ARCHINFO(Arch, Type, SubType, NumBits) AK_##Arch, | ||||
#include "llvm/TextAPI/MachO/Architecture.def" | #include "llvm/TextAPI/MachO/Architecture.def" | ||||
#undef ARCHINFO | #undef ARCHINFO | ||||
AK_unknown, // this has to go last. | AK_unknown, // this has to go last. | ||||
}; | }; | ||||
/// Convert a CPU Type and Subtype pair to an architecture slice. | /// Convert a CPU Type and Subtype pair to an architecture slice. | ||||
Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType); | Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType); | ||||
/// Convert a name to an architecture slice. | /// Convert a name to an architecture slice. | ||||
Architecture getArchitectureFromName(StringRef Name); | Architecture getArchitectureFromName(StringRef Name); | ||||
/// Convert an architecture slice to a string. | /// Convert an architecture slice to a string. | ||||
StringRef getArchitectureName(Architecture Arch); | StringRef getArchitectureName(Architecture Arch); | ||||
/// Convert an architecture slice to a CPU Type and Subtype pair. | /// Convert an architecture slice to a CPU Type and Subtype pair. | ||||
std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch); | std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch); | ||||
/// Convert a target to an architecture slice. | /// Convert a target to an architecture slice. | ||||
Architecture mapToArchitecture(const llvm::Triple &Target); | Architecture mapToArchitecture(const llvm::Triple &Target); | ||||
/// Check if architecture is 64 bit. | |||||
jhenderson: Nit: missing full stop. | |||||
bool is64Bit(Architecture); | |||||
Would getNumberOfBits be a more "generic" API? JDevlieghere: Would `getNumberOfBits` be a more "generic" API? | |||||
I agree but I named that to conform to the MachO api. cishida: I agree but I named that to conform to the MachO api. | |||||
Fair enough. JDevlieghere: Fair enough. | |||||
raw_ostream &operator<<(raw_ostream &OS, Architecture Arch); | raw_ostream &operator<<(raw_ostream &OS, Architecture Arch); | ||||
} // end namespace MachO. | } // end namespace MachO. | ||||
} // end namespace llvm. | } // end namespace llvm. | ||||
#endif // LLVM_TEXTAPI_MACHO_ARCHITECTURE_H | #endif // LLVM_TEXTAPI_MACHO_ARCHITECTURE_H |
Nit: missing full stop.