summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:37:18 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:37:18 +0000
commit58fe86dc0ecb7efff01abe2b0024a6a53ebb2c81 (patch)
tree9a16bdfe41de8b658563c67b2d511003ee346b3a /include
parent61187dd0ad3d8574f655074e3e7948193d90bb1e (diff)
Support: Move c_str from SmallVector back to SmallString and add a free standing
templated c_str in Windows.h to replace it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SmallString.h7
-rw-r--r--include/llvm/ADT/SmallVector.h7
2 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h
index 73285608221..4388a85edbe 100644
--- a/include/llvm/ADT/SmallString.h
+++ b/include/llvm/ADT/SmallString.h
@@ -38,6 +38,13 @@ public:
// Extra methods.
StringRef str() const { return StringRef(this->begin(), this->size()); }
+ // TODO: Make this const, if it's safe...
+ const char* c_str() {
+ this->push_back(0);
+ this->pop_back();
+ return this->data();
+ }
+
// Implicit conversion to StringRef.
operator StringRef() const { return str(); }
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index 123b85daff8..1c86622ad83 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -340,13 +340,6 @@ 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);
/// append - Add the specified range to the end of the SmallVector.