diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2013-10-06 20:25:49 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2013-10-06 20:25:49 +0000 |
| commit | 80bea0c3153775b6be44db0fdae356345afe9d0f (patch) | |
| tree | 758a51aad21ea84239e098150edd150e77e6ccdc /llvm/lib/Support/Unix | |
| parent | f66a81ad5671475b8df2af8e366d20327470d156 (diff) | |
| download | bcm5719-llvm-80bea0c3153775b6be44db0fdae356345afe9d0f.tar.gz bcm5719-llvm-80bea0c3153775b6be44db0fdae356345afe9d0f.zip | |
Windows: Add support for unicode command lines
Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name. Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.
This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
- It doesn't work on cygwin.
- It only work on MinGW with caveats and only then on certain versions.
- We get to keep our entry point as main(). :)
N.B. This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G. clang spawning clang -cc1 would want to give it Unicode arguments.
Reviewers: aaron.ballman, Bigcheese, rnk, ruiu
Reviewed By: rnk
CC: llvm-commits, ygao
Differential Revision: http://llvm-reviews.chandlerc.com/D1834
llvm-svn: 192069
Diffstat (limited to 'llvm/lib/Support/Unix')
| -rw-r--r-- | llvm/lib/Support/Unix/Process.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc index f18fa221036..c5778e746b7 100644 --- a/llvm/lib/Support/Unix/Process.inc +++ b/llvm/lib/Support/Unix/Process.inc @@ -190,6 +190,14 @@ Optional<std::string> Process::GetEnv(StringRef Name) { return std::string(Val); } +error_code Process::GetArgumentVector(SmallVectorImpl<const char *> &ArgsOut, + ArrayRef<const char *> ArgsIn, + SpecificBumpPtrAllocator<char> &) { + ArgsOut.append(ArgsIn.begin(), ArgsIn.end()); + + return error_code::success(); +} + bool Process::StandardInIsUserInput() { return FileDescriptorIsDisplayed(STDIN_FILENO); } |

