forked from OSchip/llvm-project
Support/ADT: Move c_str() from SmallString to SmallVectorImpl. The Windows PathV2
implementation needs it for wchar_t and SmallVectorImpl in general. llvm-svn: 120984
This commit is contained in:
parent
9f2af628a6
commit
911742c4b7
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue