[llvm-commits] [llvm] r120984 - in /llvm/trunk/include/llvm/ADT: SmallString.h SmallVector.h
Michael J. Spencer
bigcheesegs at gmail.com
Sun Dec 5 20:27:42 PST 2010
Author: mspencer
Date: Sun Dec 5 22:27:42 2010
New Revision: 120984
URL: http://llvm.org/viewvc/llvm-project?rev=120984&view=rev
Log:
Support/ADT: Move c_str() from SmallString to SmallVectorImpl. The Windows PathV2
implementation needs it for wchar_t and SmallVectorImpl in general.
Modified:
llvm/trunk/include/llvm/ADT/SmallString.h
llvm/trunk/include/llvm/ADT/SmallVector.h
Modified: llvm/trunk/include/llvm/ADT/SmallString.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallString.h?rev=120984&r1=120983&r2=120984&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallString.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallString.h Sun Dec 5 22:27:42 2010
@@ -41,12 +41,6 @@
// 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();
Modified: llvm/trunk/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=120984&r1=120983&r2=120984&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Sun Dec 5 22:27:42 2010
@@ -340,6 +340,12 @@
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);
More information about the llvm-commits
mailing list