mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
switch Triple to take twines instead of stringrefs.
llvm-svn: 135889
This commit is contained in:
parent
0e3472660b
commit
489601c923
@ -10,8 +10,7 @@
|
||||
#ifndef LLVM_ADT_TRIPLE_H
|
||||
#define LLVM_ADT_TRIPLE_H
|
||||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include <string>
|
||||
#include "llvm/ADT/Twine.h"
|
||||
|
||||
// Some system headers or GCC predefined macros conflict with identifiers in
|
||||
// this file. Undefine them here.
|
||||
@ -19,8 +18,6 @@
|
||||
#undef sparc
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
class Twine;
|
||||
|
||||
/// Triple - Helper class for working with target triples.
|
||||
///
|
||||
@ -134,24 +131,16 @@ public:
|
||||
/// @{
|
||||
|
||||
Triple() : Data(), Arch(InvalidArch) {}
|
||||
explicit Triple(StringRef Str) : Data(Str), Arch(InvalidArch) {}
|
||||
explicit Triple(StringRef ArchStr, StringRef VendorStr, StringRef OSStr)
|
||||
: Data(ArchStr), Arch(InvalidArch) {
|
||||
Data += '-';
|
||||
Data += VendorStr;
|
||||
Data += '-';
|
||||
Data += OSStr;
|
||||
explicit Triple(const Twine &Str) : Data(Str.str()), Arch(InvalidArch) {}
|
||||
Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr)
|
||||
: Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
|
||||
Arch(InvalidArch) {
|
||||
}
|
||||
|
||||
explicit Triple(StringRef ArchStr, StringRef VendorStr, StringRef OSStr,
|
||||
StringRef EnvironmentStr)
|
||||
: Data(ArchStr), Arch(InvalidArch) {
|
||||
Data += '-';
|
||||
Data += VendorStr;
|
||||
Data += '-';
|
||||
Data += OSStr;
|
||||
Data += '-';
|
||||
Data += EnvironmentStr;
|
||||
Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
|
||||
const Twine &EnvironmentStr)
|
||||
: Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + Twine('-') +
|
||||
EnvironmentStr).str()), Arch(InvalidArch) {
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
@ -8,16 +8,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/Triple.h"
|
||||
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
using namespace llvm;
|
||||
|
||||
//
|
||||
|
||||
const char *Triple::getArchTypeName(ArchType Kind) {
|
||||
switch (Kind) {
|
||||
case InvalidArch: return "<invalid>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user