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();