summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Use C++ casts to avoid a warningSanjoy Das2016-05-271-1/+2
| | | | | | | | warning: cast from type ‘const void*’ to type ‘llvm::PrettyStackTraceEntry*’ casts away qualifiers [-Wcast-qual] PrettyStackTraceHead = (PrettyStackTraceEntry*)Top; llvm-svn: 271069
* Avoid some copies by using const references.Benjamin Kramer2016-05-271-1/+1
| | | | | | | clang-tidy's performance-unnecessary-copy-initialization with some manual fixes. No functional changes intended. llvm-svn: 270988
* Linker: teach the IR mover to return llvm::Error.Peter Collingbourne2016-05-271-1/+0
| | | | | | | | | This will be needed in order to consistently return an Error to clients of the API being developed in D20268. Differential Revision: http://reviews.llvm.org/D20550 llvm-svn: 270967
* Don't allocate unnecessarily in APInt::operator[+-]. NFC.Pete Cooper2016-05-271-0/+18
| | | | | | | | | | | | | | | APInt::operator+(uint64_t) just forwarded to operator+(const APInt&). Constructing the APInt for the RHS takes an allocation which isn't required. Also, for APInt's in the slow path, operator+ would call add() internally which iterates over both arrays of values. Instead we can use add_1 and sub_1 which only iterate while there is something to do. Using the memory for 'opt -O2 verify-uselistorder.lto.opt.bc -o opt.bc' (see r236629 for details), this reduces the number of allocations from 23.9M to 22.7M. llvm-svn: 270959
* [Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.Lang Hames2016-05-271-6/+6
| | | | | | | Based on a totally scientific, 30 second google search "in-" appears to be the preferred prefix. llvm-svn: 270950
* [Support] Add a StringError convenience class to Error.hLang Hames2016-05-271-4/+48
| | | | | | | | StringError can be used to represent Errors that aren't recoverable based on the error type, but that have a useful error message that can be reported to the user or logged. llvm-svn: 270948
* Don't use recursion to print out the PrettyStackTrace after a crash. If theRichard Smith2016-05-261-16/+30
| | | | | | | crash was due to a stack overflow, chances are good that this would also cause a stack overflow. llvm-svn: 270903
* Don't allocate in APInt::slt. NFC.Pete Cooper2016-05-261-25/+9
| | | | | | | | | | | | | | | | | | | | | | | APInt::slt was copying the LHS and RHS in to temporaries then making them unsigned so that it could use an unsigned comparision. It did this even on the paths which were trivial to give results for, such as the sign bit of the LHS being set while RHS was not set. This changes the logic to return out immediately in the trivial cases, and use an unsigned comparison in the remaining cases. But this time, just use the unsigned comparison directly without creating any temporaries. This works because, for example: true = (-2 slt -1) = (0xFE ult 0xFF) Also added some tests explicitly for slt with APInt's larger than 64-bits so that this new code is tested. Using the memory for 'opt -O2 verify-uselistorder.lto.opt.bc -o opt.bc' (see r236629 for details), this reduces the number of allocations from 26.8M to 23.9M. llvm-svn: 270881
* [CMake] Restrict libxar linkage to just llvm-objdumpChris Bieneman2016-05-261-3/+0
| | | | | | At some point we're going to need libObject to have this dependency, but as it is now this is causing too many headaches. This commit will reduce the linkage to just llvm-objdump where it is strictly needed, and we'll cross the libObject bridge later when we need it. llvm-svn: 270866
* [AArch64] Adding a TargetParser for AArch64Renato Golin2016-05-251-0/+219
| | | | | | | | | | There's already a ARMTargetParser,now adding a similar one for aarch64. so we can use it to do ARCH/CPU/FPU parsing in clang and llvm, instead of string comparison. Patch by Jojo Ma. llvm-svn: 270687
* [Support] Reapply cleanup r270643Gerolf Hoflehner2016-05-251-39/+0
| | | | llvm-svn: 270674
* [Support] revert previous commit r270643Gerolf Hoflehner2016-05-251-0/+39
| | | | llvm-svn: 270670
* [Support] Cleanup of an ancient Darwin work-around in Signals.inc (PR26174)Gerolf Hoflehner2016-05-251-39/+0
| | | | | | Patch by Jeremy Huddleston Sequoia llvm-svn: 270643
* Add libxar to LLVM_SYSTEM_LIBS if availableChris Bieneman2016-05-241-0/+3
| | | | | | This should fix PR27855. We have some terrible hacks in the CMake to add linking SYSTEM_LIBS to all tools. I think we need a better way to do this in the future. llvm-svn: 270605
* Add FIXMEs to all derived classes of std::error_category.Peter Collingbourne2016-05-241-0/+3
| | | | | | | | This helps make clear that we're moving away from std::error_code. Differential Revision: http://reviews.llvm.org/D20592 llvm-svn: 270604
* Enable use of sigaltstack for signal handlers when available. With this,Richard Smith2016-05-231-1/+1
| | | | | | | backtraces from the signal handler on stack overflow now work reliably (on my system at least...). llvm-svn: 270395
* Fix implicit type conversion. NFC.Chris Bieneman2016-05-211-1/+1
| | | | llvm-svn: 270299
* Switch from the linux-specific 'struct sigaltstack' to POSIX's 'stack_t'. ThisRichard Smith2016-05-201-2/+2
| | | | | | is what I get for trusting my system's man pages I suppose. llvm-svn: 270280
* Add a configure-time check for the existence of sigaltstack. It seems that someRichard Smith2016-05-201-2/+4
| | | | | | systems provide a <signal.h> that doesn't declare it. llvm-svn: 270278
* Reinstate r269992 (reverting r270267), but restricted to cases where glibc isRichard Smith2016-05-201-4/+59
| | | | | | | | | the C standard library implementation in use. This works around a glibc bug in the backtrace() function where it fails to produce a backtrace on x86_64 if libgcc / libunwind is statically linked. llvm-svn: 270276
* Create a sigaltstack when we register our signal handlers. Otherwise we'd veryRichard Smith2016-05-201-0/+31
| | | | | | likely fail to produce a backtrace if we crash due to stack overflow. llvm-svn: 270273
* Revert "Work around a glibc bug: backtrace() spuriously fails if..."Chris Bieneman2016-05-201-51/+4
| | | | | | | | | This commit has been breaking the FreeBSD bots: http://lab.llvm.org:8011/builders/lld-x86_64-freebsd This reverts commit r269992. llvm-svn: 270267
* Work around a glibc bug: backtrace() spuriously fails ifRichard Smith2016-05-181-4/+51
| | | | | | | | | | | | - glibc is dynamically linked, and - libgcc_s is unavailable (for instance, another library is being used to provide the compiler runtime or libgcc is statically linked), and - the target is x86_64. If we run backtrace() and it fails to find any stack frames, try using _Unwind_Backtrace instead if available. llvm-svn: 269992
* Removing an unused variable introduced in r269911; NFC.Aaron Ballman2016-05-181-1/+0
| | | | llvm-svn: 269915
* Add new flag and intrinsic support for MWAITX and MONITORX instructionsAshutosh Nema2016-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: MONITORX/MWAITX instructions provide similar capability to the MONITOR/MWAIT pair while adding a timer function, such that another termination of the MWAITX instruction occurs when the timer expires. The presence of the MONITORX and MWAITX instructions is indicated by CPUID 8000_0001, ECX, bit 29. The MONITORX and MWAITX instructions are intercepted by the same bits that intercept MONITOR and MWAIT. MONITORX instruction establishes a range to be monitored. MWAITX instruction causes the processor to stop instruction execution and enter an implementation-dependent optimized state until occurrence of a class of events. Opcode of MONITORX instruction is "0F 01 FA". Opcode of MWAITX instruction is "0F 01 FB". These opcode information is used in adding tests for the disassembler. These instructions are enabled for AMD's bdver4 architecture. Patch by Ganesh Gopalasubramanian! Reviewers: echristo, craig.topper, RKSimon Subscribers: RKSimon, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19795 llvm-svn: 269911
* [ThinLTO] Option to control path of distributed backend filesTeresa Johnson2016-05-171-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add support to control where files for a distributed backend (the individual index files and optional imports files) are created. This is invoked with a new thinlto-prefix-replace option in the gold plugin and llvm-lto. If specified, expects a string of the form "oldprefix:newprefix", and instead of generating these files in the same directory path as the corresponding bitcode file, will use a path formed by replacing the bitcode file's path prefix matching oldprefix with newprefix. Also add a new replace_path_prefix helper to Path.h in libSupport. Depends on D19636. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19644 llvm-svn: 269771
* Revert "Revert "Revert 220932.": "Removing the static initializer in ↵Mehdi Amini2016-05-144-47/+4
| | | | | | | | | | ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex"" This reverts commit r269577. Broke NetBSD, waiting for Kamil to investigate From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 269584
* Revert "Revert 220932.": "Removing the static initializer in ↵Mehdi Amini2016-05-144-4/+47
| | | | | | | | | | | | | | | | | | | | | | ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex" This reverts commit r221331 and reinstate r220932 as discussed in D19271. Original commit message was: This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once. These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once. Differential Revision: http://reviews.llvm.org/D5922 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 269577
* CachePruning.cpp: Don't use errno.NAKAMURA Takumi2016-05-141-2/+3
| | | | llvm-svn: 269565
* [Power9] Add support for -mcpu=pwr9 in the back endNemanja Ivanovic2016-05-091-0/+1
| | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D19683 Simply adds the bits for being able to specify -mcpu=pwr9 to the back end. llvm-svn: 268950
* Remove LLVM_ENABLE_TIMESTAMPSChris Bieneman2016-05-051-3/+0
| | | | | | | | | | | | | | | | | | | Summary: As per the discussion on LLVM-dev this patch proposes removing LLVM_ENABLE_TIMESTAMPS. The only complicated bit of this patch is the Windows support. On windows we used to log an error if /INCREMENTAL was passed to the linker when timestamps were disabled. With this change since timestamps in code are always disabled we will always compile on windows with /Brepro unless /INCREMENTAL is specified, and we will log a warning when /INCREMENTAL is specified to notify the user that the build will be non-deterministic. See: http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html Reviewers: bogner, silvas, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19892 llvm-svn: 268670
* [Support] Creation of minidump after compiler crash on WindowsLeny Kholodov2016-05-045-1/+244
| | | | | | | | | | | In the current implementation compiler only prints stack trace to console after crash. This patch adds saving of minidump files which contain a useful subset of the information for further debugging. Differential Revision: http://reviews.llvm.org/D18216 llvm-svn: 268519
* Move llvm-readobj/StreamWriter to Support.Zachary Turner2016-05-032-0/+73
| | | | | | | | | We wish to re-use this from llvm-pdbdump, and it provides a nice way to print structured data in scoped format that could prove useful for many other dumping tools as well. Moving to support and changing name to ScopedPrinter to better reflect its purpose. llvm-svn: 268342
* Adding period to the end of a comment to test out commit access.Douglas Yung2016-05-031-1/+1
| | | | llvm-svn: 268337
* Add operator- to Path's reverse_iterator. Needed for D19666Filipe Cabecinhas2016-04-291-0/+4
| | | | | | | | | | Reviewers: rafael, craig.topper, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19724 llvm-svn: 268062
* [Support][X86] Add a few more Intel model numbers to getHostCPUName for ↵Craig Topper2016-04-271-0/+4
| | | | | | airmont and knl. llvm-svn: 267670
* [Support][X86] Change the case values in the Intel family 6 code to hex so ↵Craig Topper2016-04-271-68/+66
| | | | | | its easier to compare with Intel's docs. NFC llvm-svn: 267669
* [Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.Craig Topper2016-04-271-0/+2
| | | | llvm-svn: 267666
* Use gcc's rules for parsing gcc-style response filesNico Weber2016-04-261-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | In gcc, \ escapes every character in response files. It is true that this makes it harder to mention Windows files in rsp files, but not doing this means clang disagrees with gcc, and also disagrees with the shell (on non-Windows) which rsp file quoting is supposed to match. clang isn't free to choose what to do here. In general, the idea for response files is to take bits of your command line and write them to a file unchanged, and have things work the same way. Since the command line would've been interpreted by the shell, things in the rsp file need to be subject to the same shell quoting rules. People who want to put Windows-style paths in their response files either need to do any of: * escape their backslashes * or use clang-cl which uses cl.exe/cmd.exe quoting rules * pass --rsp-quoting=windows to clang to tell it to use cl.exe/cmd.exe quoting rules for response files. Fixes PR27464. http://reviews.llvm.org/D19417 llvm-svn: 267556
* CachePruning: early exit if no path suppliedMehdi Amini2016-04-211-2/+11
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266965
* Add debugging to the cache pruningMehdi Amini2016-04-181-4/+23
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266686
* CachePruning: fix typo, we accumulate file size here, not timeMehdi Amini2016-04-181-1/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266685
* [NFC] Header cleanupMehdi Amini2016-04-186-3/+6
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Remove some unneeded headers and replace some headers with forward class ↵Mehdi Amini2016-04-164-0/+4
| | | | | | | | | | | declarations (NFC) Differential Revision: http://reviews.llvm.org/D19154 Patch by Eugene Kosov <claprix@yandex.ru> From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266524
* Fix missing include on OpenBSDMehdi Amini2016-04-081-0/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265803
* Fix a race condition in support library ThreadPool.Justin Lebar2016-04-061-1/+4
| | | | | | | | | | | | | | | By running TSAN on the ThreadPool unit tests it was discovered that the threads in the pool can pop tasks off the queue at the same time the "wait" routine is trying to check if the task queue is empty. This patch fixes this problem by checking for active threads in the waiter before checking whether the queue is empty. Patch by Jason Henline. Differential Revision: http://reviews.llvm.org/D18811 Reviewers: joker.eph, jlebar llvm-svn: 265618
* Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining ↵Duncan P. N. Exon Smith2016-04-0515-249/+151
| | | | | | | | | | files; other minor fixes." This reverts commit r265454 since it broke the build. E.g.: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/ llvm-svn: 265459
* Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; ↵Eugene Zelenko2016-04-0515-151/+249
| | | | | | | | | | | | other minor fixes. Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 llvm-svn: 265454
* Add Cache Pruning supportMehdi Amini2016-04-022-0/+131
| | | | | | | | | | | | | | | | | | | | Incremental LTO will usea cache to store object files. This patch handles the pruning part of the cache, exposing a few knobs: - Pruning interval: the implementation keeps a "timestamp" file in the directory and will scan it only after a given interval since the last modification of the timestamp file. This is for performance purpose, we don't want to scan continuously the folder. - Entry expiration: this is the time after which a file that hasn't been used is remove from the cache. - Maximum size: expressed in percentage of the available disk space, it helps to avoid that we blow up the disk space. http://reviews.llvm.org/D18422 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265209
* Fix S390 big endian detectionMehdi Amini2016-04-011-2/+3
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265109
OpenPOWER on IntegriCloud