[PATCH] Windows: Add support for unicode command lines

Rui Ueyama ruiu at google.com
Fri Oct 4 08:33:54 PDT 2013



================
Comment at: lib/Support/Windows/Program.inc:51
@@ +50,3 @@
+
+retry_search_path:
+  DWORD len = SearchPathW(NULL, progNameUnicode.data(), L".exe",
----------------
David Majnemer wrote:
> Reid Kleckner wrote:
> > I'd rather not loop with goto.  There are a couple easy ways to rewrite this with a loop construct.
> What's wrong with the goto? I don't see an issue. Would the other ways result in more or less code?
This can easily be re-written with for(;;) { ...; if (len <= buffer.capacity()) break; ...}. It seems that's more normal way to write this kind of logic than goto.

================
Comment at: include/llvm/Support/Process.h:175
@@ +174,3 @@
+  /// for program execution.
+  static Optional<ArrayRef<const char *> >
+  GetArgumentVector(ArrayRef<const char *> OriginalMainArgs,
----------------
In Unix this function does nothing and does not use any argument. In Windows the first argument (OriginalMainArgs) is ignored. It feels like they are really different, and they don't not necessarily have to have the same interface.

I'd probably rather make this a function defined only when LLVM_ON_WIN32 is defined, and guard the call of this function in LLVM's main() with LLVM_ON_WIN32.


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



More information about the llvm-commits mailing list