summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-24 20:45:08 +0000
committerChris Lattner <sabre@nondot.org>2011-07-24 20:45:08 +0000
commitd757d3f5c20043db3a6d5e8011ea35832f311086 (patch)
tree4ad26a254844998993dcf1ef89196f85e6dd8453 /llvm/include
parent9650f0678c8542eb77b043b92d093b3f9af2484d (diff)
downloadbcm5719-llvm-d757d3f5c20043db3a6d5e8011ea35832f311086.tar.gz
bcm5719-llvm-d757d3f5c20043db3a6d5e8011ea35832f311086.zip
switch Triple to take twines instead of stringrefs.
llvm-svn: 135889
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/Triple.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
index fd23608a759..0ad096b9377 100644
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -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) {
}
/// @}
OpenPOWER on IntegriCloud