summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 04:27:42 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 04:27:42 +0000
commite99bbd9ac3cc7ba2615c9b800a002e47c8e13991 (patch)
treeb52345db3e4e67f68f2daf85d0af231d8579a744 /include/llvm
parentf9644867712c531427567ca4f936f507cd34f1b1 (diff)
downloadllvm-e99bbd9ac3cc7ba2615c9b800a002e47c8e13991.tar.gz
llvm-e99bbd9ac3cc7ba2615c9b800a002e47c8e13991.tar.bz2
llvm-e99bbd9ac3cc7ba2615c9b800a002e47c8e13991.tar.xz
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
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/ADT/SmallString.h6
-rw-r--r--include/llvm/ADT/SmallVector.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h
index 05bd8a42c6..7328560822 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 0c9f7eb634..123b85daff 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);