diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-08 23:32:51 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-08 23:32:51 +0000 |
commit | baf9b562309ae0f82774a6a3b4ffb9417a43a032 (patch) | |
tree | 4da13ed5ecc472f3ed1f921f3a9498a083066aa1 /include/llvm | |
parent | 08ab4fdb598b0cf972a44b20340d538d2591d836 (diff) | |
download | llvm-baf9b562309ae0f82774a6a3b4ffb9417a43a032.tar.gz llvm-baf9b562309ae0f82774a6a3b4ffb9417a43a032.tar.bz2 llvm-baf9b562309ae0f82774a6a3b4ffb9417a43a032.tar.xz |
Add Triple::getArchTypeForDarwinArchName, which converts a "Darwin" architecture
name (e.g. "ppc") to the appropriate constant.
Also, StringRefize additional Triple constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/ADT/Triple.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 03ecd708ff..89736bcc45 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -118,8 +118,8 @@ public: /// @{ Triple() : Data(), Arch(InvalidArch) {} - explicit Triple(const StringRef &Str) : Data(Str), Arch(InvalidArch) {} - explicit Triple(const char *ArchStr, const char *VendorStr, const char *OSStr) + explicit Triple(StringRef Str) : Data(Str), Arch(InvalidArch) {} + explicit Triple(StringRef ArchStr, StringRef VendorStr, StringRef OSStr) : Data(ArchStr), Arch(InvalidArch) { Data += '-'; Data += VendorStr; @@ -258,10 +258,19 @@ public: /// getOSTypeName - Get the canonical name for the \arg Kind vendor. static const char *getOSTypeName(OSType Kind); + /// @} + /// @name Static helpers for converting alternate architecture names. + /// @{ + /// getArchTypeForLLVMName - The canonical type for the given LLVM /// architecture name (e.g., "x86"). static ArchType getArchTypeForLLVMName(const StringRef &Str); + /// getArchTypeForDarwinArchName - Get the architecture type for a "Darwin" + /// architecture name, for example as accepted by "gcc -arch" (see also + /// arch(3)). + static ArchType getArchTypeForDarwinArchName(const StringRef &Str); + /// @} }; |