mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
Add llvm::triple constructor from arch, vendor, os strings, and recognize
DragonFly OS type. llvm-svn: 72242
This commit is contained in:
parent
67af546881
commit
aa01cbb890
@ -50,6 +50,7 @@ public:
|
||||
UnknownOS,
|
||||
|
||||
Darwin,
|
||||
DragonFly,
|
||||
FreeBSD,
|
||||
Linux
|
||||
};
|
||||
@ -75,6 +76,13 @@ public:
|
||||
|
||||
Triple() : Data(""), Arch(InvalidArch) {}
|
||||
explicit Triple(const char *Str) : Data(Str), Arch(InvalidArch) {}
|
||||
explicit Triple(const char *ArchStr, const char *VendorStr, const char *OSStr)
|
||||
: Data(ArchStr), Arch(InvalidArch) {
|
||||
Data += '-';
|
||||
Data += VendorStr;
|
||||
Data += '-';
|
||||
Data += OSStr;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Typed Component Access
|
||||
|
@ -44,6 +44,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
|
||||
case UnknownOS: return "unknown";
|
||||
|
||||
case Darwin: return "darwin";
|
||||
case DragonFly: return "dragonfly";
|
||||
case FreeBSD: return "freebsd";
|
||||
case Linux: return "linux";
|
||||
}
|
||||
@ -80,6 +81,8 @@ void Triple::Parse() const {
|
||||
std::string OSName = getOSName();
|
||||
if (memcmp(&OSName[0], "darwin", 6) == 0)
|
||||
OS = Darwin;
|
||||
else if (memcmp(&OSName[0], "dragonfly", 9) == 0)
|
||||
OS = DragonFly;
|
||||
else if (memcmp(&OSName[0], "freebsd", 7) == 0)
|
||||
OS = FreeBSD;
|
||||
else if (memcmp(&OSName[0], "linux", 5) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user