[PATCH] Windows: Add support for unicode command lines

David Majnemer david.majnemer at gmail.com
Fri Oct 4 08:19:47 PDT 2013



================
Comment at: lib/Support/Windows/Process.inc:191
@@ +190,3 @@
+  SmallVector<size_t, 256> StringOffsets;
+  StringOffsets.reserve(NewArgCount);
+
----------------
David Majnemer wrote:
> Reid Kleckner wrote:
> > Rather than doing this dance with StringOffsets to keep stable pointers into a std::vector, you could use a caller-allocated BumpPtrAllocator to allocate the strings.  That way you get stable strings by default.
> This can be done.
Does the following interface seem reasonable to you?
```
  error_code
  GetArgumentVector(SmallVectorImpl<const char *> &NewArgs,
                    ArrayRef<const char *> ArgsFromMain,
                    SpecificBumpPtrAllocator<char> &ArgAllocator);
```


http://llvm-reviews.chandlerc.com/D1834



More information about the llvm-commits mailing list