From dce4a407a24b04eebc6a376f8e62b41aaa7b071f Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Thu, 29 May 2014 02:49:00 -0700 Subject: Update LLVM for 3.5 rebase (r209712). Change-Id: I149556c940fb7dc92d075273c87ff584f400941f --- include/llvm/ADT/StringRef.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/llvm/ADT/StringRef.h') diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index 0514d7b196..1f413e8055 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -10,7 +10,6 @@ #ifndef LLVM_ADT_STRINGREF_H #define LLVM_ADT_STRINGREF_H -#include "llvm/Support/Allocator.h" #include #include #include @@ -70,7 +69,7 @@ namespace llvm { /// @{ /// Construct an empty string ref. - /*implicit*/ StringRef() : Data(0), Length(0) {} + /*implicit*/ StringRef() : Data(nullptr), Length(0) {} /// Construct a string ref from a cstring. /*implicit*/ StringRef(const char *Str) @@ -124,9 +123,9 @@ namespace llvm { return Data[Length-1]; } - // copy - Allocate copy in BumpPtrAllocator and return StringRef to it. - StringRef copy(BumpPtrAllocator &Allocator) { - char *S = Allocator.Allocate(Length); + // copy - Allocate copy in Allocator and return StringRef to it. + template StringRef copy(Allocator &A) { + char *S = A.template Allocate(Length); std::copy(begin(), end(), S); return StringRef(S, Length); } @@ -186,7 +185,7 @@ namespace llvm { /// str - Get the contents as an std::string. std::string str() const { - if (Data == 0) return std::string(); + if (!Data) return std::string(); return std::string(Data, Length); } -- cgit v1.2.3