summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* _CS_DARWIN_USER macros available on darwin>=9. Thanks, Dave Odell!David Fang2014-02-121-1/+2
| | | | llvm-svn: 201255
* 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
* Remove TimeValue::toPosixTime() -- it is buggy, semantics are unclear, and itsDmitri Gribenko2014-02-111-2/+2
| | | | | | only current user should be using toEpochTime() instead. llvm-svn: 201136
* Using the helper API for random number generation.Aaron Ballman2014-02-113-14/+2
| | | | llvm-svn: 201125
* Hopefully fixing the MinGW 32 build, which was broken by r200767. Not using ↵Aaron Ballman2014-02-112-9/+11
| | | | | | rand_s() since MinGW does not have an implementation for it, but instead using the underlying CryptGenRandom APIs. llvm-svn: 201124
* [CMake] LLVMSupport should be responsible to provide system_libs.NAKAMURA Takumi2014-02-101-0/+2
| | | | llvm-svn: 201077
* Fix an invalid check for duplicate option categories.Alexander Kornienko2014-02-071-4/+10
| | | | | | | An intermediate solution until the problems with analyzer plugins linking with llvm/Support and causing assertions due to duplicate GeneralCategory are solved. llvm-svn: 200981
* Try to unbreak the mingw32 build.Benjamin Kramer2014-02-071-1/+1
| | | | llvm-svn: 200973
* Revert "Fix an invalid check for duplicate option categories."Rafael Espindola2014-02-051-14/+3
| | | | | | | | This reverts commit r200853. It was causing clang/Analysis/checker-plugins.c to crash. llvm-svn: 200858
* Fix an invalid check for duplicate option categories.Alexander Kornienko2014-02-051-3/+14
| | | | | | | | | | | | | | | | | | | | Summary: The check performed in the comparator is invalid, as some STL implementations enforce strict weak ordering by calling the comparator with the same value. This check was also in a wrong place: the assertion would only fire when -help was used. The new check is performed each time the category is registered (we are not going to have thousands of them, so it's fine to do it in O(N^2)). Reviewers: jordan_rose Reviewed By: jordan_rose CC: cfe-commits, alexmc Differential Revision: http://llvm-reviews.chandlerc.com/D2699 llvm-svn: 200853
* Fix configure to find arc4random via header files.Todd Fiala2014-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: On Ubuntu 12.04 LTS, arc4random is provided by libbsd.so, which is a transitive dependency of libedit. If a system had libedit on it that was implemented in terms of libbsd.so, then the arc4random test, previously implemented as a linker test, would succeed with -ledit. However, on Ubuntu this would also require a #include <bsd/stdlib.h>. This caused a build breakage on configure-based Ubuntu 12.04 with libedit installed. FIX: This fix changes configure to test for arc4random by searching for it in the standard header files. On Ubuntu 12.04, this test now properly fails to find arc4random as it is not defined in the default header locations. It also tweaks the #define names to match the output of the header check command, which is slightly different than the linker function check #defines. I tested the following scenarios: (1) Ubuntu 12.04 without the libedit package [did not find arc4random, as expected] (2) Ubuntu 12.04 with libedit package [properly did not find arc4random, as expected] (3) Ubuntu 12.04 with most recent libedit, custom built, and not dependent on libbsd.so [properly did not find arc4random, as expected]. (4) FreeBSD 10.0B1 [properly found arc4random, as expected] llvm-svn: 200819
* Implemented support for Process::GetRandomNumber on Windows.Aaron Ballman2014-02-042-0/+12
| | | | | | Patch thanks to Stephan Tolksdorf! llvm-svn: 200767
* Undef'ing _WIN32_IE to silence an MSVC warning about redefining a macro value.Aaron Ballman2014-02-031-0/+1
| | | | | | No functional change intended. llvm-svn: 200704
* Rename the non-templated base class of SmallPtrSet toChandler Carruth2014-02-031-13/+15
| | | | | | | | | | | 'SmallPtrSetImplBase'. This more closely matches the organization of SmallVector and should allow introducing a SmallPtrSetImpl which serves the same purpose as SmallVectorImpl: isolating the element type from the particular small size chosen. This in turn allows a lot of simplification of APIs by not coding them against a specific small size which is rarely needed. llvm-svn: 200687
* 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-312-0/+32
| | | | | | | | | 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
* [CommandLine] Aliases require an value if their target requires a value.Jordan Rose2014-01-291-0/+7
| | | | | | | | | This can still be overridden by explicitly setting a value requirement on the alias option, but by default it should be the same. PR18649 llvm-svn: 200407
* Remove unnecessary call to pthread_mutexattr_setpshared()Mark Seaborn2014-01-291-7/+0
| | | | | | | | | | | | | | | | | | | The default value of this attribute is PTHREAD_PROCESS_PRIVATE, so there's no point in calling pthread_mutexattr_setpshared() to set that. See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_getpshared.html This removes some ifdefs that tend to need to be extended for other platforms (e.g. for NaCl). Note that this call was in the first implementation of Mutex, added in r22403, so it doesn't appear to have been added in response to a performance problem. Differential Revision: http://llvm-reviews.chandlerc.com/D2633 llvm-svn: 200360
* Fix the "#ifndef HAVE_SYS_WAIT_H" code path in Program.inc to compileMark Seaborn2014-01-271-0/+1
| | | | | | Without this fix, WaitResult is not defined. llvm-svn: 200259
* Roll back the ConstStringRef change for nowAlp Toker2014-01-271-1/+1
| | | | | | | | | | | There are a couple of interesting things here that we want to check over (particularly the expecting asserts in StringRef) and get right for general use in ADT so hold back on this one. For clang we have a workable templated solution to use in the meanwhile. This reverts commit r200187. llvm-svn: 200194
* StringRef: Extend constexpr capabilities and introduce ConstStringRefAlp Toker2014-01-271-1/+1
| | | | | | | | | | | | | | | | | | | (1) Add llvm_expect(), an asserting macro that can be evaluated as a constexpr expression as well as a runtime assert or compiler hint in release builds. This technique can be used to construct functions that are both unevaluated and compiled depending on usage. (2) Update StringRef using llvm_expect() to preserve runtime assertions while extending the same checks to static asserts in C++11 builds that support the feature. (3) Introduce ConstStringRef, a strong subclass of StringRef that references compile-time constant strings. It's convertible to, but not from, ordinary StringRef and thus can be used to add compile-time safety to various interfaces in LLVM and clang that only accept fixed inputs such as diagnostic format strings that tend to get misused. llvm-svn: 200187
* Fix known typosAlp Toker2014-01-245-18/+17
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* [x86] Support i386-*-*-code16 triple for emitting 16-bit codeDavid Woodhouse2014-01-201-0/+2
| | | | llvm-svn: 199648
* [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.NAKAMURA Takumi2014-01-201-0/+2
| | | | | | | | | | | | | | ADDITIONAL_HEADERS is intended to add header files for IDEs as hint. For example: add_llvm_library(LLVMSupport Host.cpp ADDITIONAL_HEADERS Unix/Host.inc Windows/Host.inc ) llvm-svn: 199639
* ARM: update build attributes for ABI r2.09Saleem Abdulrasool2014-01-191-4/+4
| | | | | | | Update names for the names as per the current ABI errata. Mark deprecated tags as such. llvm-svn: 199576
* Move ARM build attributes into SupportSaleem Abdulrasool2014-01-192-0/+96
| | | | | | | | | | | | This moves the ARM build attributes definitions and support routines into the Support library. The support routines simply permit the conversion of the value to and from a string representation. The movement is prompted in order to permit access to the constants and string representations from readobj in order to facilitate decoding of the attributes section. llvm-svn: 199575
* raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) ↵NAKAMURA Takumi2014-01-121-2/+3
| | | | | | would barf wide chars after llvm::errs(). llvm-svn: 199057
OpenPOWER on IntegriCloud