[llvm-commits] [llvm] r120984 - in /llvm/trunk/include/llvm/ADT: SmallString.h SmallVector.h
Chris Lattner
clattner at apple.com
Sun Dec 5 20:40:05 PST 2010
On Dec 5, 2010, at 8:27 PM, Michael J. Spencer wrote:
> 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.
Hi Michael,
I don't think this makes sense, why not just cast data? With wchar_t you usually need a multibyte 0 anyway.
-Chris
>
> 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);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list