summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* [C++11] Revert uses of lambdas with array_pod_sort.Benjamin Kramer2014-03-071-5/+6
| | | | | | Looks like GCC implements the lambda->function pointer conversion differently. llvm-svn: 203294
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-071-6/+5
| | | | | | No functionality change. llvm-svn: 203288
* [Support/LockFileManager] Re-apply r203137 and r203138 but use symbolic ↵Argyrios Kyrtzidis2014-03-061-24/+56
| | | | | | | | links only on unix. Reid Kleckner pointed out that we can't use symbolic links on Windows. llvm-svn: 203162
* Support: split object format out of environmentSaleem Abdulrasool2014-03-061-7/+45
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). llvm-svn: 203160
* Revert create_symbolic_link and both depending changesReid Kleckner2014-03-063-64/+24
| | | | | | | | | | 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/LockFileManager] Make the LockFileManager more robust against races.Argyrios Kyrtzidis2014-03-061-17/+34
| | | | | | | | | | | There was a race where: - The LockFileManager tries to own the lock file and fails. - The other owner then releases and removes the lock file. - The LockFileManager tries to read the owner info from the lock file but fails now. In such a case have LockFileManager try to get ownership again, instead of error'ing out. llvm-svn: 203138
* [Support/LockFileManager] Use symbolic link for the lock file.Argyrios Kyrtzidis2014-03-061-13/+4
| | | | | | | | Hard links do not work on SMB network directories, and it causes us to fail to build clang module files if the module cache is in such a directory. rdar://15944959 llvm-svn: 203137
* [Support/FileSystem] Introduce llvm::sys::fs::create_symbolic_link().Argyrios Kyrtzidis2014-03-062-0/+32
| | | | llvm-svn: 203136
* Add <cstddef> for use of std::ptrdiff_t.Ahmed Charles2014-03-061-0/+1
| | | | llvm-svn: 203086
* Fix break by qualifying ptrdiff_t with std::.Ahmed Charles2014-03-061-2/+2
| | | | llvm-svn: 203084
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-069-28/+17
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-051-8/+5
| | | | | | | | | When using a //net/ path, we were transforming the trailing / into a '.' when the path was just the root path and we were iterating backwards. Forwards iteration and other kinds of root path (C:\, /) were already correct. llvm-svn: 202999
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-052-23/+81
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. llvm-svn: 202959
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-1/+1
| | | | llvm-svn: 202957
* Remove unnecessary variables.Ahmed Charles2014-03-051-2/+2
| | | | | | Found self-hosting clang-cl on windows. :) llvm-svn: 202935
* Remove dependence on std::function.Richard Smith2014-03-041-15/+6
| | | | llvm-svn: 202902
* Add support for arbitrary functors to CrashRecoveryContext.Richard Smith2014-03-041-6/+15
| | | | llvm-svn: 202895
* APFloat: Add a move ctor and operator=Benjamin Kramer2014-03-041-0/+18
| | | | llvm-svn: 202883
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-042-735/+0
| | | | | | | | | | a bit surprising, as the class is almost entirely abstracted away from any particular IR, however it encodes the comparsion predicates which mutate ranges as ICmp predicate codes. This is reasonable as they're used for both instructions and constants. Thus, it belongs in the IR library with instructions and constants. llvm-svn: 202838
* [C+11] Add 'override' keyword to methods in the support library.Craig Topper2014-03-041-1/+1
| | | | llvm-svn: 202791
* Revert "[C++11] Replace LLVM atomics with std::atomic."Benjamin Kramer2014-03-034-7/+8
| | | | | | | Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list llvm-svn: 202731
* [C++11] Replace LLVM atomics with std::atomic.Benjamin Kramer2014-03-034-8/+7
| | | | | | | | | | | With C++11 we finally have a standardized way to specify atomic operations. Use them to replace the existing custom implemention. Sadly the translation is not entirely trivial as std::atomic allows more fine-grained control over the atomicity. I tried to preserve the old semantics as well as possible. Differential Revision: http://llvm-reviews.chandlerc.com/D2915 llvm-svn: 202730
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-022-2/+2
| | | | | | The old implementation is no longer needed in C++11. llvm-svn: 202644
* [C++11] Replace LLVM_STATIC_ASSERT with static_assert, we now haveChandler Carruth2014-03-021-2/+2
| | | | | | access to it on all host toolchains. llvm-svn: 202642
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-026-20/+20
| | | | llvm-svn: 202621
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-022-5/+5
| | | | | | directly, and remove the macro. llvm-svn: 202612
* Now that we have C++11, turn simple functors into lambdas and remove a ton ↵Benjamin Kramer2014-03-012-27/+12
| | | | | | | | of boilerplate. No intended functionality change. llvm-svn: 202588
* [C++11] Remove the R-value reference #if usage from the ADT and SupportChandler Carruth2014-03-013-8/+0
| | | | | | libraries. It is now always 1 in LLVM builds. llvm-svn: 202580
* Fix RWMutex to be thread-safe when pthread_rwlock is not availableMark Seaborn2014-03-011-6/+14
| | | | | | | | | | | | | | lib/Support/RWMutex.cpp contains an implementation of RWMutex that uses pthread_rwlock, but when pthread_rwlock is not available (such as under NaCl, when using newlib), it silently falls back to using the no-op definition in lib/Support/Unix/RWMutex.inc, which is not thread-safe. Fix this case to be thread-safe by using a normal mutex. Differential Revision: http://llvm-reviews.chandlerc.com/D2892 llvm-svn: 202570
* CommandLine: Exit successfully for -version and -helpJustin Bogner2014-02-281-3/+3
| | | | | | | | | | | Tools that use the CommandLine library currently exit with an error when invoked with -version or -help. This is unusual and non-standard, so we'll fix them to exit successfully instead. I don't expect that anyone relies on the current behaviour, so this should be a fairly safe change. llvm-svn: 202530
* Re-apply r200853, which should not crash after Clang plugins were converted ↵Alexander Kornienko2014-02-271-7/+13
| | | | | | to loadable modules in r201256. llvm-svn: 202404
* Revert "Use StringRef in raw_fd_ostream constructor"Ben Langmuir2014-02-271-2/+3
| | | | | | This reverts commit r202225, which may cause a performance regression. llvm-svn: 202338
* Remove unnecessary llvm:: qualification.Eric Christopher2014-02-261-2/+2
| | | | llvm-svn: 202316
* [CMake] BUILD_SHARED_LIBS: Fixup for r202261: Give PULIC to system_libs in ↵NAKAMURA Takumi2014-02-261-1/+9
| | | | | | LLVMSupport. llvm-svn: 202263
* [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to ↵NAKAMURA Takumi2014-02-261-1/+1
| | | | | | | | | | | | | | | | | | increase opportunity for parallel build. target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library, although final targets have dependencies to whole dependent libraries. It makes most libraries can be built in parallel. target_link_libraries(PRIVATE) is used to shaared library. Each dependent library is linked to the target.so, and its user will not see its grandchildren. For example, - libclang.so has sufficient libclang*.a(s). - c-index-test requires just only libclang.so. FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing. llvm-svn: 202241
* Use StringRef in raw_fd_ostream constructorBen Langmuir2014-02-261-3/+2
| | | | llvm-svn: 202225
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-244-7/+7
| | | | | | | | | 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
* Add AArch64 big endian Target (aarch64_be)Christian Pirker2014-02-241-42/+49
| | | | llvm-svn: 202024
* Share a createUniqueEntity implementation between unix and windows.Rafael Espindola2014-02-243-205/+90
| | | | | | | 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
* Delete dead code.Rafael Espindola2014-02-242-12/+0
| | | | llvm-svn: 202001
* Use static instead of an anonymous namespace.Rafael Espindola2014-02-232-35/+31
| | | | llvm-svn: 201983
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-233-52/+34
| | | | | | | | | | | | | | | 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
* Use simpler form of llvm::sys::fs::remove.Rafael Espindola2014-02-231-2/+1
| | | | llvm-svn: 201975
* Simplify linking to system librariesNAKAMURA Takumi2014-02-231-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | The LLVMSupport library implementation consolidates all dependencies on system libraries. Move the logic gathering system libraries out of 'cmake/modules/LLVM-Config.cmake' and into 'lib/Support/CMakeLists.txt'. Use the target_link_libraries() command there to tell CMake about the link dependencies of the LLVMSupport implementation. CMake will automatically propagate this to all targets that link LLVMSupport directly or indirectly. We still need to build knowledge of system library dependencies into 'llvm-config'. Store the list of libraries needed in a property on LLVMSupport and teach 'tools/llvm-config/CMakeLists.txt' to retrieve it from there. Drop all calls to 'link_system_libs' and 'get_system_libs' from our CMake code. Replace their implementations with a warning that explains the calls are no longer necessary. Also drop from 'LLVMConfig.cmake' the HAVE_* and related variables that were published there only to allow 'get_system_libs' to run outside our build process. Contributed by Brad King. llvm-svn: 201969
* Don't inline get[S|U]LEB128Size() until they are proved to be hot.Logan Chien2014-02-222-0/+45
| | | | llvm-svn: 201939
* [Support] Correctly handle zero length inputs to UTF conversion functions on ↵Michael J. Spencer2014-02-201-32/+30
| | | | | | Windows. llvm-svn: 201811
* Use mkdir instead of stat+mkdir.Rafael Espindola2014-02-131-11/+18
| | | | | | | | | | | | | This is an optimistic version of create_diretories: it tries to create the directory first and looks at the parent only if that fails. Running strace on "mkdir -p" shows that it is pessimistic, calling mkdir on every element of the path. We could implement that if needed. In any case, with both strategies there is no reason to call stat, just check the return of mkdir. llvm-svn: 201347
* Remove dead code.Rafael Espindola2014-02-132-45/+0
| | | | llvm-svn: 201327
* Use simpler version of sys::fs::exists when possible.Rafael Espindola2014-02-131-5/+3
| | | | llvm-svn: 201289
* Rename Windows.h to WindowsSupport.h to avoid ambiguityReid Kleckner2014-02-1214-15/+18
| | | | llvm-svn: 201258
OpenPOWER on IntegriCloud