From e99bbd9ac3cc7ba2615c9b800a002e47c8e13991 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 6 Dec 2010 04:27:42 +0000 Subject: [PATCH] Support/ADT: Move c_str() from SmallString to SmallVectorImpl. The Windows PathV2 implementation needs it for wchar_t and SmallVectorImpl in general. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120984 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallString.h | 6 ------ include/llvm/ADT/SmallVector.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h index 05bd8a42c67..73285608221 100644 --- a/include/llvm/ADT/SmallString.h +++ b/include/llvm/ADT/SmallString.h @@ -41,12 +41,6 @@ public: // Implicit conversion to StringRef. operator StringRef() const { return str(); } - const char *c_str() { - this->push_back(0); - this->pop_back(); - return this->data(); - } - // Extra operators. const SmallString &operator=(StringRef RHS) { this->clear(); diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 0c9f7eb6345..123b85daff8 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -340,6 +340,12 @@ public: return Result; } + // TODO: Make this const, if it's safe... + typename SuperClass::const_pointer c_str() { + push_back(0); + pop_back(); + return this->data(); + } void swap(SmallVectorImpl &RHS);