summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Path.inc
Commit message (Collapse)AuthorAgeFilesLines
* [Support] Correctly handle zero length inputs to UTF conversion functions on ↵Michael J. Spencer2014-02-201-32/+30
| | | | | | Windows. llvm-svn: 201811
* Remove dead code.Rafael Espindola2014-02-131-32/+0
| | | | llvm-svn: 201327
* Rename Windows.h to WindowsSupport.h to avoid ambiguityReid Kleckner2014-02-121-1/+1
| | | | llvm-svn: 201258
* Windows/Path.inc: Move <shlobj.h> after "Windows.h" for some API available.NAKAMURA Takumi2014-02-121-2/+3
| | | | | | | | | | | | | | | I found that swapping the order of some header files helped fix a build issue that we're seeing on mingw32. Without the swap, windows.h was being included before _WIN32_WINNT was being defined and the CreateHardLinkW function was #ifdef'd out. It looks like the header is mainly used to get the SHGetFolderPathW function, so I don't think that there'll be much fallout from the switch. Suggested by Alex Crichton. Thanks! llvm-svn: 201230
* Using the helper API for random number generation.Aaron Ballman2014-02-111-13/+1
| | | | llvm-svn: 201125
* Hopefully fix mingw32 bots.Peter Collingbourne2014-02-011-1/+1
| | | | | | For some reason this symbolic constant isn't defined in some versions of mingw32. llvm-svn: 200605
* Introduce llvm::sys::path::home_directory.Peter Collingbourne2014-01-311-0/+17
| | | | | | | | | This will be used by the line editor library to derive a default path to the history file. Differential Revision: http://llvm-reviews.chandlerc.com/D2199 llvm-svn: 200594
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+3
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Correct word hyphenationsAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* Windows: Be more explicit with Win32 APIsDavid Majnemer2013-10-071-12/+30
| | | | | | | | | | | | 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-14/+15
| | | | | | | 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-15/+14
| | | | | | | This is causing MinGW bots to fail. This reverts commit r192069. llvm-svn: 192070
* Windows: Add support for unicode command linesDavid Majnemer2013-10-061-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 getenv() wrapper that works on multibyte environment variable.Rui Ueyama2013-09-101-56/+61
| | | | | | | | | | | | | | | | | | On Windows, character encoding of multibyte environment variable varies depending on settings. The only reliable way to handle it I think is to use GetEnvironmentVariableW(). GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16 string. That's not ideal because we use UTF-8 as the internal encoding in LLVM. This patch defines a wrapper function which takes and returns UTF-8 string for GetEnvironmentVariableW(). The wrapper function does not do any conversion and just forwards the argument to getenv() on Unix. Differential Revision: http://llvm-reviews.chandlerc.com/D1612 llvm-svn: 190423
* [Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must ↵NAKAMURA Takumi2013-08-221-2/+2
| | | | | | contain Offset when Offset >= 65536. llvm-svn: 189021
* Whitespace.NAKAMURA Takumi2013-08-221-3/+3
| | | | llvm-svn: 189020
* Switching to using a helper function instead of manually converting the ↵Aaron Ballman2013-08-161-24/+1
| | | | | | string to UTF-8. llvm-svn: 188566
* On Windows, autolink advapi32 from Path.inc for CryptAcquireContextWReid Kleckner2013-08-071-0/+4
| | | | | | | | | | | This allows llvm-tblgen to link successfully when compiling with clang. Both MSBuild and CMake will automatically add advapi32 as part of a set of other dlls comprising the win32 API to the link line, but CMake doesn't do that when compiling with clang. Until someone adds that info to cmake upstream, this seems like a reasonable work around. llvm-svn: 187907
* Fix windows' implementation of status when a file doesn't exist.Rafael Espindola2013-07-311-6/+11
| | | | | | | | | The unix one was returning no_such_file_or_directory, but the windows one was return success. Update the one one caller that was depending on the old behavior. llvm-svn: 187463
* Implement getUniqueID for directories on windows.Rafael Espindola2013-07-301-18/+14
| | | | llvm-svn: 187441
* Remove dead code.Rafael Espindola2013-07-301-3/+0
| | | | llvm-svn: 187439
* Make file_status::getUniqueID const.Rafael Espindola2013-07-291-1/+1
| | | | llvm-svn: 187383
* Include st_dev to make the result of getUniqueID actually unique.Rafael Espindola2013-07-291-19/+8
| | | | | | This will let us use getUniqueID instead of st_dev directly on clang. llvm-svn: 187378
* Initialize TempFileHandle.Serge Pavlov2013-07-191-1/+1
| | | | llvm-svn: 186684
* Split openFileForWrite into windows and unix versions.Rafael Espindola2013-07-191-0/+54
| | | | | | It is similar to 186511, but for creating files for writing. llvm-svn: 186679
* Small improvement to the use of GetFileType:Rafael Espindola2013-07-181-1/+8
| | | | | | | | | * assert that the return value is one of the documented values on msdn. * on FILE_TYPE_UNKNOWN, check GetLastError. Unfortunately I can't think of a way to get a FILE_TYPE_UNKNOWN on a test. llvm-svn: 186595
* Windows/Path.inc: Introduce file_type::character_file and ↵NAKAMURA Takumi2013-07-181-0/+13
| | | | | | | | | file_type::fifo_file in sys::fs::getStatus(HANDLE). It fixes llvm/test/Other/close-stderr.ll on msys. FIXME: Provide unittests. llvm-svn: 186588
* Remove dead code.Rafael Espindola2013-07-181-23/+0
| | | | llvm-svn: 186561
* Fix a funny typo. Thanks to Aaron Ballman for noticing.Rafael Espindola2013-07-171-1/+1
| | | | llvm-svn: 186532
* Add FILE_SHARE_WRITE to openFileForRead.Rafael Espindola2013-07-171-1/+1
| | | | | | | | | | | | | | This should fix the windows bots. It looks like the failing tests are of the form prog1 > file prog2 file and prog2 fails trying to read the file. The best fix would probably be to close stdout/stderr in prog1, but it was not the intention of 186511 to change this, so just restore the old behavior for now. llvm-svn: 186530
* Split openFileForRead into Windows and Unix versions.Rafael Espindola2013-07-171-0/+31
| | | | | | | | | | | This has some advantages: * Lets us use native, utf16 windows functions. * Easy to produce good errors on windows about trying to use a directory when we want a file. * Simplifies the unix version a bit. llvm-svn: 186511
* [Support] Fix some warnings when self-hosting clang on WindowsReid Kleckner2013-07-161-2/+0
| | | | llvm-svn: 186413
* Add a version of sys::fs::status that uses fstat.Rafael Espindola2013-07-161-22/+38
| | | | llvm-svn: 186378
* Instead friending status, provide windows and posix constructors to file_status.Rafael Espindola2013-07-161-9/+6
| | | | | | | This opens the way of having static helpers in the .inc files that can construct a file_status. llvm-svn: 186376
* Add include to hopefully fix windows build.Craig Topper2013-07-151-0/+1
| | | | llvm-svn: 186310
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-1/+1
| | | | llvm-svn: 186301
* Use status to implement file_size.Rafael Espindola2013-07-101-21/+0
| | | | | | | | | | The status function is already using a syscall that returns the file size. Remember it and implement file_size as a simple wrapper. No functionally change, but clients that already use status now can avoid calling file_size. llvm-svn: 186016
* We now always create files with the correct permissions. Simplify the interface.Rafael Espindola2013-07-081-34/+0
| | | | llvm-svn: 185834
* Improvements to unique_file and createUniqueDirectory.Rafael Espindola2013-06-281-135/+134
| | | | | | | | | | | | | | | | | | | * Don't try to create parent directories in unique_file. It had two problem: * It violates the contract that it is atomic. If the directory creation success and the file creation fails, we would return an error but the file system was modified. * When creating a temporary file clang would have to first check if the parent directory existed or not to avoid creating one when it was not supposed to. * More efficient implementations of createUniqueDirectory and the unique_file that produces only the file name. Now all 3 just call into a static function passing what they want (name, file or directory). Clang also has to be updated, so tests might fail if a bot picks up this commit and not the corresponding clang one. llvm-svn: 185126
* Rename PathV2 to just Path now that it is the only one.Rafael Espindola2013-06-261-0/+1092
| | | | llvm-svn: 185015
* PathV1 is deprecated since the 18th of Dec 2010. Remove it.Rafael Espindola2013-06-261-587/+0
| | | | llvm-svn: 184960
* Remove sys::GetMainExecutable.Rafael Espindola2013-06-261-9/+0
| | | | llvm-svn: 184916
* Remove PathWithStatus.Rafael Espindola2013-06-261-29/+0
| | | | llvm-svn: 184910
* Move GetEXESuffix to the one place it is used.Rafael Espindola2013-06-251-4/+0
| | | | llvm-svn: 184853
* Remove sys::PathSeparator.Rafael Espindola2013-06-251-2/+0
| | | | llvm-svn: 184852
* Remove Path::getDirectoryContents.Rafael Espindola2013-06-191-48/+0
| | | | llvm-svn: 184311
* Remove Path::canExecute.Rafael Espindola2013-06-191-7/+0
| | | | llvm-svn: 184298
* Remove Path::canWrite.Rafael Espindola2013-06-181-7/+0
| | | | llvm-svn: 184235
* Remove unused Path::canRead.Rafael Espindola2013-06-181-7/+0
| | | | llvm-svn: 184229
* Remove uniqueID from PathV1.h.Rafael Espindola2013-06-181-7/+0
| | | | llvm-svn: 184219
OpenPOWER on IntegriCloud