summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Path.inc
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert a member variable to a local variable. NFC.Rafael Espindola2014-12-161-3/+3
| | | | llvm-svn: 224311
* Remove unused member and simplify. NFC.Rafael Espindola2014-12-161-22/+3
| | | | llvm-svn: 224309
* Remove silly left over from the Windows resize_file implementation.Rafael Espindola2014-12-121-1/+0
| | | | | | | I didn't notice the problem first because on a non debug build the CRT was just exiting the process without any message. llvm-svn: 224139
* Pass a FD to resise_file and add a testcase.Rafael Espindola2014-12-121-12/+4
| | | | | | I will add a real use in another commit. llvm-svn: 224136
* Remove a convoluted way of calling close by moving the call to the only caller.Rafael Espindola2014-12-111-39/+7
| | | | | | As a bonus we can actually check the return value. llvm-svn: 224046
* Remove dead code. NFC.Rafael Espindola2014-12-111-48/+0
| | | | llvm-svn: 224029
* More long path name support on Windows, this time in program execution.Paul Robinson2014-11-241-4/+8
| | | | | | | Allows long paths for the executable and redirected stdin/stdout/stderr. Addresses PR21563. llvm-svn: 222671
* silence gcc 4.9.1 warning in /llvm/lib/Support/Windows/Path.inc:564:39:Yaron Keren2014-11-171-1/+1
| | | | | | | warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (ec = widenPath(path, path_utf16)) llvm-svn: 222122
* Improve long path name support on Windows.Paul Robinson2014-11-131-38/+66
| | | | | | | | | | Windows normally limits the length of an absolute path name to 260 characters; directories can have lower limits. These limits increase to about 32K if you use absolute paths with the special '\\?\' prefix. Teach Support\Windows\Path.inc to use that prefix as needed. TODO: Other parts of Support could also learn to use this prefix. llvm-svn: 221841
* Misc cleanups to the FileSytem api.Rafael Espindola2014-09-111-33/+13
| | | | | | | | | | | | | | | | The main difference is the removal of std::error_code exists(const Twine &path, bool &result); It was an horribly redundant interface since a file not existing is also a valid error_code. Now we have an access function that returns just an error_code. This is the only function that has to be implemented for Unix and Windows. The functions can_write, exists and can_execute an now just wrappers. One still has to be very careful using these function to avoid introducing race conditions (Time of check to time of use). llvm-svn: 217625
* Add writeFileWithSystemEncoding to LibLLVMSuppor.Rafael Espindola2014-09-031-4/+16
| | | | | | | | | | | | | | | | | | | | This patch adds to LLVMSupport the capability of writing files with international characters encoded in the current system encoding. This is relevant for Windows, where we can either use UTF16 or the current code page (the legacy Windows international characters). On UNIX, the file is always saved in UTF8. This will be used in a patch for clang to thoroughly support response files creation when calling other tools, addressing PR15171. On Windows, to correctly support internationalization, we need the ability to write response files both in UTF16 or the current code page, depending on the tool we will call. GCC for mingw, for instance, requires files to be encoded in the current code page. MSVC tools requires files to be encoded in UTF16. Patch by Rafael Auler! llvm-svn: 217068
* Merge TempDir and system_temp_directory.Rafael Espindola2014-08-261-17/+45
| | | | | | | | | We had two functions for finding the temp or cache directory. Each had a different set of smarts about OS specific APIs. With this patch system_temp_directory becomes the only way to do it. llvm-svn: 216460
* Remove dead code. Fixes pr20544.Rafael Espindola2014-08-081-5/+0
| | | | llvm-svn: 215243
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-131-7/+7
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. llvm-svn: 210920
* Fix build on windows.Rafael Espindola2014-06-131-84/+89
| | | | llvm-svn: 210873
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-4/+4
| | | | llvm-svn: 210783
* Don't import make_error_code into the llvm namespace.Rafael Espindola2014-06-121-4/+4
| | | | llvm-svn: 210772
* Don't put generic_category in the llvm namespace.Rafael Espindola2014-06-121-2/+2
| | | | llvm-svn: 210737
* Implement get_magic with generic tools and inline it.Rafael Espindola2014-06-111-42/+0
| | | | llvm-svn: 210716
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* Remove windows_error.Rafael Espindola2014-06-111-30/+36
| | | | | | | | | | MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. llvm-svn: 210631
* Turn errc and windows_error into enum classes.Rafael Espindola2014-05-311-2/+2
| | | | llvm-svn: 209957
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-25/+25
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209952
* delete dead code.Rafael Espindola2014-05-311-11/+0
| | | | llvm-svn: 209938
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-111-0/+5
| | | | | | | | Add a utility function to convert the Windows path separator to Unix style path separators. This is used by a subsequent change in clang to enable the use of Windows SDK headers on Linux. llvm-svn: 203611
* Cleanup the interface for creating soft or hard links.Rafael Espindola2014-03-111-1/+2
| | | | | | | | | | | | Before this patch the unix code for creating hardlinks was unused. The code for creating symbolic links was implemented in lib/Support/LockFileManager.cpp and the code for creating hard links in lib/Support/*/Path.inc. The only use we have for these is in LockFileManager.cpp and it can use both soft and hard links. Just have a create_link function that creates one or the other depending on the platform. llvm-svn: 203596
* Revert create_symbolic_link and both depending changesReid Kleckner2014-03-061-19/+0
| | | | | | | | | | This reverts commits r203136, r203137, and r203138. This code doesn't build on Windows. Even on Vista+, Windows requires elevated privileges to create a symlink. Therefore we can't use symlinks in the compiler. We'll have to find another approach. llvm-svn: 203143
* [Support/FileSystem] Introduce llvm::sys::fs::create_symbolic_link().Argyrios Kyrtzidis2014-03-061-0/+19
| | | | llvm-svn: 203136
* [C++11] Remove the R-value reference #if usage from the ADT and SupportChandler Carruth2014-03-011-2/+0
| | | | | | libraries. It is now always 1 in LLVM builds. llvm-svn: 202580
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-1/+1
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Share a createUniqueEntity implementation between unix and windows.Rafael Espindola2014-02-241-130/+13
| | | | | | | The only extra bit of functionality that had to be exposed for this be be implemented in Path.cpp is opening a file in rw mode. llvm-svn: 202005
* Use static instead of an anonymous namespace.Rafael Espindola2014-02-231-21/+19
| | | | llvm-svn: 201983
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-231-32/+20
| | | | | | | | | | | | | | | Before this patch they would take an boolean argument to say if the path already existed. This was redundant with the returned error_code which is able to represent that. This allowed for callers to incorrectly check only the existed flag instead of first checking the error code. Instead, pass in a boolean flag to say if the previous (non-)existence should be an error or not. Callers of the of the old simple versions are not affected. They still ignore the previous (non-)existence as they did before. llvm-svn: 201979
* [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
OpenPOWER on IntegriCloud