From: Chris Lattner Date: Sat, 19 Sep 2009 23:57:31 +0000 (+0000) Subject: add a simple c_str() method to SmallString. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3670a01d0be3bab1aa5856fea02a854aee2b65d6;p=oota-llvm.git add a simple c_str() method to SmallString. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82337 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h index c39d887c238..035462515a8 100644 --- a/include/llvm/ADT/SmallString.h +++ b/include/llvm/ADT/SmallString.h @@ -38,6 +38,12 @@ public: // Extra methods. StringRef str() const { return StringRef(this->begin(), this->size()); } + const char *c_str() { + this->push_back(0); + this->pop_back(); + return this->data(); + } + // Extra operators. const SmallString &operator=(StringRef RHS) { this->clear();