summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Program.inc
Commit message (Collapse)AuthorAgeFilesLines
* Fix initialization order warning in mingw32 buildAlp Toker2013-10-181-1/+1
| | | | | | No change in functionality. llvm-svn: 192953
* Windows: Be more explicit with Win32 APIsDavid Majnemer2013-10-071-1/+1
| | | | | | | | | | | | This addresses several issues in a similar vein: - Use the Unicode APIs when possible, running nm on clang shows that we only use Unicode APIs except for FormatMessage, CreateSemaphore, and GetModuleHandle. AFAICT, the latter two are coming from MinGW and not LLVM itself. - Make getMainExecutable more resilient. It previously considered return values of zero from ::GetModuleFileNameA to be acceptable. llvm-svn: 192096
* Revert "Revert "Windows: Add support for unicode command lines""David Majnemer2013-10-071-54/+72
| | | | | | | This reverts commit r192070 which reverted r192069, I forgot to regenerate the configure scripts. llvm-svn: 192079
* Revert "Windows: Add support for unicode command lines"David Majnemer2013-10-061-72/+54
| | | | | | | This is causing MinGW bots to fail. This reverts commit r192069. llvm-svn: 192070
* Windows: Add support for unicode command linesDavid Majnemer2013-10-061-54/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add non-blocking Wait() for launched processesTareq A. Siraj2013-10-011-61/+52
| | | | | | | | | | | | | | | | | - New ProcessInfo class to encapsulate information about child processes. - Generalized the Wait() to support non-blocking wait on child processes. - ExecuteNoWait() now returns a ProcessInfo object with information about the launched child. Users will be able to use this object to perform non-blocking wait. - ExecuteNoWait() now accepts an ExecutionFailed param that tells if execution failed or not. These changes will allow users to implement basic process parallel tools. Differential Revision: http://llvm-reviews.chandlerc.com/D1728 llvm-svn: 191763
* Avoid using alloca in Windows/Program.incReid Kleckner2013-08-071-13/+15
| | | | | | | One use needs to copy the alloca into a std::string, and the other use is before calling CreateProcess, which is very heavyweight anyway. llvm-svn: 187845
* Replace use of PathV1.h in Program.cpp.Rafael Espindola2013-06-141-16/+16
| | | | llvm-svn: 183996
* Remove unused argument.Rafael Espindola2013-06-141-3/+3
| | | | llvm-svn: 183992
* Have sys::FindProgramByName return a std::string.Rafael Espindola2013-06-131-8/+8
| | | | llvm-svn: 183928
* [Support] Fix handle and memory leak for processes that are not waited forReid Kleckner2013-06-131-28/+18
| | | | | | | | | | | | Execute's Data parameter is now optional, so we won't allocate memory for it on Windows and we'll close the process handle. The Unix code should probably do something similar to avoid accumulation of zombie children that haven't been waited on. Tested on Linux and Windows. llvm-svn: 183906
* [Win] Put ChangeStdinToBinary ChangeStdoutToBinary ChangeStderrToBinary in sys.Rafael Espindola2013-06-121-3/+3
| | | | llvm-svn: 183868
* s/Void/void.Rafael Espindola2013-06-121-1/+1
| | | | llvm-svn: 183866
* Attempt at fixing the windows build.Rafael Espindola2013-06-121-34/+35
| | | | llvm-svn: 183865
* Fixes a buffer overrun where the allocated buffer wasn't large enough to ↵Aaron Ballman2013-05-011-1/+8
| | | | | | accommodate the closing quote escape rules in some instances. llvm-svn: 180836
* [Support] Fix argv string escape bug on WindowsReid Kleckner2013-04-221-4/+42
| | | | | | | | | | | | | | | | Summary: This is http://llvm.org/PR15802. Backslashes preceding double quotes in arguments must be escaped. The interesting bit is that all other backslashes should *not* be escaped, because the un-escaping logic is only triggered by the presence of a double quote character. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D705 llvm-svn: 180035
* Add a function to check if an argument list is too long.Rafael Espindola2013-04-111-0/+16
| | | | | | | | | This will be used in clang to decide if it should create an @file or not. It will be tested on the clang side. Patch by Nathan Froyd. llvm-svn: 179285
* Remove an unused method on Program.Chandler Carruth2012-12-311-17/+0
| | | | | | | I'm simplifying this interface as much as I can before merging it with the new process interface. llvm-svn: 171334
* Remove an unused method on the Program class.Chandler Carruth2012-12-311-5/+0
| | | | llvm-svn: 171332
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Support/Program: Make Change<stream>ToBinary return error_code.Michael J. Spencer2011-12-131-6/+12
| | | | llvm-svn: 146522
* Support/Windows: Cleanup scoped handles.Michael J. Spencer2011-12-121-3/+3
| | | | llvm-svn: 146362
* [Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from ↵NAKAMURA Takumi2011-11-291-1/+11
| | | | | | | | | | | | the driver. clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused. llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value. Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception. llvm-svn: 145389
* Return only the least significant 8 bits of the exit status fromPeter Collingbourne2011-11-061-1/+1
| | | | | | Process::Wait on Windows (mimicing POSIX behaviour). llvm-svn: 143876
* Have Program::Wait return -2 for crashed and timeouts instead of embeddingAndrew Trick2011-05-211-4/+5
| | | | | | info in the error message. Per Dan's request. llvm-svn: 131780
* Typo and missing checkin from r131186.Andrew Trick2011-05-111-1/+2
| | | | llvm-svn: 131187
* Windows/Program.inc: Eliminate the declaration of SetInformationJobObject(). ↵NAKAMURA Takumi2011-02-091-9/+0
| | | | | | It should be provided with _WIN32_WINNT>=0x0500. llvm-svn: 125170
* Windows/Program.inc: Quote arguments when dubious characters (used by ↵NAKAMURA Takumi2011-02-051-1/+1
| | | | | | cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev. llvm-svn: 124945
* Merge System into Support.Michael J. Spencer2010-11-291-0/+412
llvm-svn: 120298
OpenPOWER on IntegriCloud