summaryrefslogtreecommitdiff
path: root/lib/Support
Commit message (Collapse)AuthorAge
* Undef'ing _WIN32_IE to silence an MSVC warning about redefining a macro value.Aaron Ballman2014-02-03
| | | | | | No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200704 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the non-templated base class of SmallPtrSet toChandler Carruth2014-02-03
| | | | | | | | | | | '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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200687 91177308-0d34-0410-b5e6-96231b3b80d8
* Hopefully fix mingw32 bots.Peter Collingbourne2014-02-01
| | | | | | For some reason this symbolic constant isn't defined in some versions of mingw32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200605 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce llvm::sys::path::home_directory.Peter Collingbourne2014-01-31
| | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200594 91177308-0d34-0410-b5e6-96231b3b80d8
* [CommandLine] Aliases require an value if their target requires a value.Jordan Rose2014-01-29
| | | | | | | | | This can still be overridden by explicitly setting a value requirement on the alias option, but by default it should be the same. PR18649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200407 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary call to pthread_mutexattr_setpshared()Mark Seaborn2014-01-29
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200360 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the "#ifndef HAVE_SYS_WAIT_H" code path in Program.inc to compileMark Seaborn2014-01-27
| | | | | | Without this fix, WaitResult is not defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200259 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back the ConstStringRef change for nowAlp Toker2014-01-27
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200194 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef: Extend constexpr capabilities and introduce ConstStringRefAlp Toker2014-01-27
| | | | | | | | | | | | | | | | | | | (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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200187 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix known typosAlp Toker2014-01-24
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200018 91177308-0d34-0410-b5e6-96231b3b80d8
* [x86] Support i386-*-*-code16 triple for emitting 16-bit codeDavid Woodhouse2014-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199648 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.NAKAMURA Takumi2014-01-20
| | | | | | | | | | | | | | 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 ) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199639 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM: update build attributes for ABI r2.09Saleem Abdulrasool2014-01-19
| | | | | | | Update names for the names as per the current ABI errata. Mark deprecated tags as such. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199576 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ARM build attributes into SupportSaleem Abdulrasool2014-01-19
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199575 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) ↵NAKAMURA Takumi2014-01-12
| | | | | | would barf wide chars after llvm::errs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199057 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_stream formatter: [Win32] Use std::signbit() if available, instead of ↵NAKAMURA Takumi2014-01-12
| | | | | | | | _fpclass(). FIXME: It should be generic to C++11. For now, it is dedicated to mingw-w64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199052 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the simpler version of sys::fs::remove when possible.Rafael Espindola2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198958 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove remove_all. A compiler has no need for recursively deleting a directory.Rafael Espindola2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198955 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix the windows build. The comments in other files don't seem toChandler Carruth2014-01-07
| | | | | | be quite accurate. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198690 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* Make llvm::Regex non-copyable but movable.David Blaikie2014-01-02
| | | | | | Based on a patch by Maciej Piechotka. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198334 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence g++ 4.9 build issueAlp Toker2013-12-31
| | | | | | | | | lib/Support/ThreadLocal.cpp:53:15: error: typedef 'SIZE_TOO_BIG' locally defined but not used [-Werror=unused-local-typedefs] typedef int SIZE_TOO_BIG[sizeof(pthread_key_t) <= sizeof(data) ? 1 : -1]; Done the C++11 way, switching on and using LLVM_STATIC_ASSERT() instead of LLVM_ATTRIBUTE_UNUSED. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198255 91177308-0d34-0410-b5e6-96231b3b80d8
* Use two variables here rather than reusing (and abusing) one. This isChandler Carruth2013-12-27
| | | | | | | much more clear to me. I meant to make this change before committing the original patch, but forgot to merge it in. Sorry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198069 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a simple line-by-line iterator type into the Support library.Chandler Carruth2013-12-27
| | | | | | | | | | | | | | | | | | | This is an iterator which you can build around a MemoryBuffer. It will iterate through the non-empty, non-comment lines of the buffer as a forward iterator. It should be small and reasonably fast (although it could be made much faster if anyone cares, I don't really...). This will be used to more simply support the text-based sample profile file format, and is largely based on the original patch by Diego. I've re-worked the style of it and separated it from the work of producing a MemoryBuffer from a file which both simplifies the interface and makes it easier to test. The style of the API follows the C++ standard naming conventions to fit in better with iterators in general, much like the Path and FileSystem interfaces follow standard-based naming conventions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198068 91177308-0d34-0410-b5e6-96231b3b80d8
* Dwarf: Fix a copy-paste bug.Benjamin Kramer2013-12-22
| | | | | | This tag isn't emitted by any compiler at the moment. PR18306. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197877 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for krait cpu in llvm::sys::getHostCPUName()Kai Nacke2013-12-20
| | | | | | | Recently, support for krait cpu was added. This commit extends getHostCPUName() to return krait as cpu for the APQ8064 (a Krait 300). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197792 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sys::ThreadLocal<> zero-initialized on non-thread builds (PR18205)Hans Wennborg2013-12-19
| | | | | | | | | | | | | According to the docs, ThreadLocal<>::get() should return NULL if no object has been set. This patch makes that the case also for non-thread builds and adds a very basic unit test to check it. (This was causing PR18205 because PrettyStackTraceHead didn't get zero- initialized and we'd crash trying to read past the end of that list. We didn't notice this so much on Linux since we'd crash after printing all the entries, but on Mac we print into a SmallString, and would crash before printing that.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197718 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull in a couple of new constants from the upcoming DWARF 5 standard.Adrian Prantl2013-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197611 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r197438 and r197447 until we figure out how to avoid circular ↵Quentin Colombet2013-12-17
| | | | | | dependency at link time git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197451 91177308-0d34-0410-b5e6-96231b3b80d8
* [LLVM Diagnostic Capabilities] Remove useless includes fromQuentin Colombet2013-12-17
| | | | | | | | | | DiagnosticPrinter.cpp. These was creating a link time dependencies of IR on CodeGen and Analysis. Part of <rdar://problem/15515174> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197447 91177308-0d34-0410-b5e6-96231b3b80d8
* Add warning capabilities in LLVM.Quentin Colombet2013-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds a new LLVMContext::diagnose that can be used to communicate to the front-end, if any, that something of interest happened. The diagnostics are supported by a new abstraction, the DiagnosticInfo class. The base class contains the following information: - The kind of the report: What this is about. - The severity of the report: How bad this is. This patch also adds 2 classes: - DiagnosticInfoInlineAsm: For inline asm reporting. Basically, this diagnostic will be used to switch to the new diagnostic API for LLVMContext::emitError. - DiagnosticStackSize: For stack size reporting. Comes as a replacement of the hard coded warning in PEI. This patch also features dynamic diagnostic identifiers. In other words plugins can use this infrastructure for their own diagnostics (for more details, see getNextAvailablePluginDiagnosticKind). This patch introduces a new DiagnosticHandlerTy and a new DiagnosticContext in the LLVMContext that should be set by the front-end to be able to map these diagnostics in its own system. http://llvm-reviews.chandlerc.com/D2376 <rdar://problem/15515174> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197438 91177308-0d34-0410-b5e6-96231b3b80d8
* Recognize EABIHF as environment and use it for RTAPI + VFP.Joerg Sonnenberger2013-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197405 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer: Increase the alignment of small file buffers to 16Reid Kleckner2013-12-16
| | | | | | | This was manifesting as an LLVM_ASSUME_ALIGNED() failure in an ELF debug info test when building LLVM with clang in the Microsoft C++ ABI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197401 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Add a right shift to BlockFrequency that saturates at 1.Michael Gottesman2013-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197302 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Remove old BlockFrequency entry frequency and printing code.Michael Gottesman2013-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197297 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove APInt::extractBit since it is already implemented via operator[]. ↵Michael Gottesman2013-12-13
| | | | | | Change tests for extractBit to test operator[]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197277 91177308-0d34-0410-b5e6-96231b3b80d8
* [block-freq] Add the APInt method extractBit.Michael Gottesman2013-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197271 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr18235.Rafael Espindola2013-12-13
| | | | | | | | | | The cpp backend is not a reasonable fallback for a missing target. It is a very special backend, so it is reasonable to use it only if explicitly requested. While at it, simplify the interface a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197241 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Typo.Rafael Espindola2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197168 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert the other getHostByName implementations to StringRef.Rafael Espindola2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197166 91177308-0d34-0410-b5e6-96231b3b80d8
* Return a StringRef from getHostCPUName.Rafael Espindola2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197158 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing escape characters to the new Regex::escape() functionAlp Toker2013-12-12
| | | | | | | | | The old AddFixedStringToRegEx() it was based on got away with this for the longest time, but the problem became easy to spot after the cleanup in r197096. Also add a quick unit test to cover regex escaping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197121 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose FileCheck's AddFixedStringToRegEx as Regex::escapeHans Wennborg2013-12-12
| | | | | | | Both FileCheck and clang's -verify need to escape strings for regexes, so let's expose this as a utility in the Regex class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197096 91177308-0d34-0410-b5e6-96231b3b80d8
* Build fix for Android NDK which has neither futimes nor futimensAlp Toker2013-12-11
| | | | | | Based on a patch by Neil Henning! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197045 91177308-0d34-0410-b5e6-96231b3b80d8
* Darwin: update default iOS version to 5.0Tim Northover2013-12-10
| | | | | | | | | | | | Defaulting to iOS 3.0 when LLVM has to guess the version is no longer a useful option and can give surprising results (like tail calls being disabled). 5.0 seems like a reasonable compromise as a platform that's still interesting to some people. rdar://problem/15567348 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196912 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the detection of the pathSylvestre Ledru2013-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When clang is used under GNU/Linux in a chroot without /proc mount, it falls back on the BSD method. However, since the buf variable is used twice and fails with snprintf to produce the correct path. When called as relatived (ie ./clang), it was failing with: "" -cc1 [...] -x c++ x.cc error: unable to execute command: Executable "" doesn't exist! I also took the opportunity to simply the code (the first arg of test_dir was useless). Reviewers: rafael Reviewed By: rafael CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2361 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196791 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Fix handling of args that begin with @ but aren't filesJustin Bogner2013-12-06
| | | | | | | | | | | | | | | Command line arguments that begin with @ but aren't a path to an existing file currently cause later @file arguments to be ignored. Correctly skip over these arguments instead of trying to read a non-existent file 20 times and giving up. Since the problem manifests in the clang driver, the test is in that repository. Fixes rdar://problem/15590906 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196620 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct word hyphenationsAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
* Return true on success in cl::ExpandResponseFilesReid Kleckner2013-12-03
| | | | | | | | | | | | This fixes a logic bug pointed out by Juraj Ivancic. No behavior change because none of the in-tree clients of cl::ExpandResponseFiles check the return value. In this case, the @prefixed arguments are left in the command line. Downstream command line processing has the opportunity to emit errors about it, so this isn't that bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196306 91177308-0d34-0410-b5e6-96231b3b80d8
* Lift self-copy protection up to the header file and add self-moveChandler Carruth2013-11-26
| | | | | | | | | | | | protection to the same layer. This is in line with Howard's advice on how best to handle self-move assignment as he explained on SO[1]. It also ensures that implementing swap with move assignment continues to work in the case of self-swap. [1]: http://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195705 91177308-0d34-0410-b5e6-96231b3b80d8