summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Properly handle short file names on the command line in Windows [TAKE 2]Adrian McCarthy2016-06-201-2/+34
| | | | | | | | Trying to expand short names with a relative path doesn't work, so this first gets the module name to get a full path (which can still have short names). llvm-svn: 273171
* Revert "Properly handle short file names on the command line in Windows"Adrian McCarthy2016-06-171-27/+2
| | | | | | This reverts commit 3e5651782cfc985fca9d94595cad63059e587e2f. llvm-svn: 273033
* Avoid duplicated map lookups. No functionality change intended.Benjamin Kramer2016-06-171-6/+4
| | | | llvm-svn: 273030
* Properly handle short file names on the command line in WindowsAdrian McCarthy2016-06-161-2/+27
| | | | | | | | Some build systems use the short (8.3) file names on Windows, especially if the path has spaces in it. The shortening made it impossible for clang to distinguish between clang.exe, clang++.exe, and clang-cl.exe. So this expands short names in the first argument and does wildcard expansion for the rest. Differential Revision: http://reviews.llvm.org/D21420 llvm-svn: 272967
* Statistic: Add machine parseable json outputMatthias Braun2016-06-151-14/+60
| | | | | | | | | | | | - We lacked a short unique identifier for a statistics, so I renamed the current "Name" field that just contained the DEBUG_TYPE name of the current file to DebugType and added a new "Name" field that contains the C++ identifier of the statistic variable. - Add the -stats-json option which outputs statistics in json format. Differential Revision: http://reviews.llvm.org/D20995 llvm-svn: 272826
* Add a Musl environment to the triple.Rafael Espindola2016-06-141-0/+2
| | | | | | | | It will be used in clang. Patch by Lei Zhang. llvm-svn: 272660
* In openFileForRead, attempt to fetch the actual name of the file on disk -- ↵Taewook Oh2016-06-132-2/+131
| | | | | | | | | | | | | including case -- so that clang can later warn about non-portable #include and #import directives. Differential Revision: http://reviews.llvm.org/D19842 Corresponding clang patch: http://reviews.llvm.org/D19843 Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures Patch by Eric Niebler llvm-svn: 272555
* [AArch64] Add RAS extensions support in AArch64TargetParser.Zijiao Ma2016-06-131-0/+2
| | | | | | | RAS extensions are part of ARMv8.2,now supported in Clang. Add RAS extensions support in AArch64TargetParser. llvm-svn: 272533
* [STLExtras] Introduce and use llvm::count_if; NFCSanjoy Das2016-06-101-5/+4
| | | | | | (This is split out from was D21115) llvm-svn: 272435
* Reapply 272328 and 272329 as a single patch.Alina Sbirlea2016-06-091-10/+3
| | | | | | | | | | | | | | | | | | | | [cpu-detection] [amdfam10] Return barcelona, and amdfam10 for all other subtypes. Address Bug 28067. Along with the refactoring of Host.cpp, getHostCPUName() was modified to return more precise types for CPUs in amdfam10. However, callers of getHostCPUName() do string matching on type, so this cannot be modified. Currently there is support in the x86 backend for barcelona. For all other subtypes the assumed return value is amdfam10. Fix: getHostCPUName() returns barcelona subtype and amdfam10 for all others. This can be extended further when support for the other subtypes is added. Differential revision: http://reviews.llvm.org/D21193 llvm-svn: 272333
* Revert 272328 and 272329 to recommit as a single patch.Alina Sbirlea2016-06-091-3/+10
| | | | llvm-svn: 272332
* Keep barcelona subtype for amdfam10Alina Sbirlea2016-06-091-1/+3
| | | | llvm-svn: 272329
* [cpu-detection] Return amdfam10 for all subtypes. Address Bug 28067.Alina Sbirlea2016-06-091-9/+0
| | | | | | | | | | | | Summary: Remove architecture subtype from the string returned by getHostCPUName(). String matching done on type. Reviewers: llvm-commits, echristo Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D21193 llvm-svn: 272328
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-093-15/+37
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* [cpu-detection] Add missing break statements in outer switchesAlina Sbirlea2016-06-091-6/+9
| | | | | | | | | | | | Summary: Break on all switch cases for outer and inner switches. No functionality changed. Reviewers: llvm-commits, sanjoy Differential Revision: http://reviews.llvm.org/D21158 llvm-svn: 272228
* [DebugInfo] Add calling convention support for DWARF and CodeViewReid Kleckner2016-06-081-16/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Now DISubroutineType has a 'cc' field which should be a DW_CC_ enum. If it is present and non-zero, the backend will emit it as a DW_AT_calling_convention attribute. On the CodeView side, we translate it to the appropriate enum for the LF_PROCEDURE record. I added a new LLVM vendor specific enum to the list of DWARF calling conventions. DWARF does not appear to attempt to standardize these, so I assume it's OK to do this until we coordinate with GCC on how to emit vectorcall convention functions. Reviewers: dexonsmith, majnemer, aaboud, amccarth Subscribers: mehdi_amini, llvm-commits Differential Revision: http://reviews.llvm.org/D21114 llvm-svn: 272197
* Apply most suggestions of clang-tidy's performance-unnecessary-value-paramBenjamin Kramer2016-06-082-5/+3
| | | | | | | Avoids unnecessary copies. All changes audited & pass tests with asan. No functional change intended. llvm-svn: 272190
* Support: correct AArch64 TargetParser implementationSaleem Abdulrasool2016-06-081-20/+21
| | | | | | | | | | | | | | | | | | | | | | | The architecture enumeration is shared across ARM and AArch64. However, the data is not. The code incorrectly would index into the array using the architecture index which was offset by the ARMv7 architecture enumeration. We do not have a marker for indicating the architectural family to which the enumeration belongs so we cannot be clever about offsetting the index (at least it is not immediately apparent to me). Instead, fall back to the tried-and-true method of slowly iterating the array (its not a large array, so the impact of this is not too high). Because of the incorrect indexing, if we were lucky, we would crash, but usually we would return an invalid StringRef. We did not have any tests for the AArch64 target parser previously;. Extend the previous tests I had added for ARM to cover AArch64 for ensuring that we return expected StringRefs. Take the opportunity to change some iterator types to references. This work is needed to support parsing `.arch name` directives in the AArch64 target asm parser. llvm-svn: 272145
* [cpu-detection] Substantial refactor of Host CPU detection code (x86)Alina Sbirlea2016-06-061-261/+650
| | | | | | | | | | | | | | | | | | Summary: Following D20970 (committed as r271726). This is a substantial refactoring of the host CPU detection code. There is no functionality change intended, but the changes are extensive. Definitions of architecture types and subtypes are by no means exhaustive or perfectly defined, but a fair starting point. Suggestions for futher improvements are welcome. Reviewers: llvm-commits Differential Revision: http://reviews.llvm.org/D20988 llvm-svn: 271921
* [LPM] Reinstate r271781 which reinstated r271652 to replace theChandler Carruth2016-06-042-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CALL_ONCE_... macro in the legacy pass manager with the new llvm::call_once facility. Nothing changed sicne the last attempt in r271781 which I reverted in r271788. At least one of the failures I saw was spurious, and I want to make sure the other failures are real before I work around them -- they appeared to only effect ppc64le and ppc64be. Original commit message of r271781: ---- [LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacy pass manager with the new llvm::call_once facility. This reverts commit r271657 and re-applies r271652 with a fix to actually work with arguments. In the original version, we just ended up directly calling std::call_once via ADL because of the std::once_flag argument. The llvm::call_once never worked with arguments. Now, llvm::call_once is a variadic template that perfectly forwards everything. As a part of this it had to move to the header and we use a generic functor rather than an explict function pointer. It would be nice to use std::invoke here but we don't have it yet. That means pointer to members won't work here, but that seems a tolerable compromise. I've also tested this by forcing the fallback path, so hopefully it sticks this time. ---- Original commit message of r271652: ---- [LPM] Replace the CALL_ONCE_... macro in the legacy pass manager with the new llvm::call_once facility. This facility matches the standard APIs and when the platform supports it actually directly uses the standard provided functionality. This is both more efficient on some platforms and much more TSan friendly. The only remaining user of the cas_flag and home-rolled atomics is the fallback implementation of call_once. I have a patch that removes them entirely, but it needs a Windows patch to land first. This alone substantially cleans up the macros for the legacy pass manager, and should subsume some of the work Mehdi was doing to clear the path for TSan testing of ThinLTO, a really important step to have reliable upstream testing of ThinLTO in all forms. ---- llvm-svn: 271800
* [LPM] Revert r271781 which was a re-commit of r271652.Chandler Carruth2016-06-042-1/+28
| | | | | | | | | | | | There appears to be a strange exception thrown and crash using call_once on a PPC build bot, and a *really* weird windows link error for GCMetadata.obj. Still need to investigate the cause of both problems. Original change summary: [LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacy pass manager with the new llvm::call_once facility. llvm-svn: 271788
* [LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacyChandler Carruth2016-06-042-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass manager with the new llvm::call_once facility. This reverts commit r271657 and re-applies r271652 with a fix to actually work with arguments. In the original version, we just ended up directly calling std::call_once via ADL because of the std::once_flag argument. The llvm::call_once never worked with arguments. Now, llvm::call_once is a variadic template that perfectly forwards everything. As a part of this it had to move to the header and we use a generic functor rather than an explict function pointer. It would be nice to use std::invoke here but we don't have it yet. That means pointer to members won't work here, but that seems a tolerable compromise. I've also tested this by forcing the fallback path, so hopefully it sticks this time. Original commit message: ---- [LPM] Replace the CALL_ONCE_... macro in the legacy pass manager with the new llvm::call_once facility. This facility matches the standard APIs and when the platform supports it actually directly uses the standard provided functionality. This is both more efficient on some platforms and much more TSan friendly. The only remaining user of the cas_flag and home-rolled atomics is the fallback implementation of call_once. I have a patch that removes them entirely, but it needs a Windows patch to land first. This alone substantially cleans up the macros for the legacy pass manager, and should subsume some of the work Mehdi was doing to clear the path for TSan testing of ThinLTO, a really important step to have reliable upstream testing of ThinLTO in all forms. llvm-svn: 271781
* Revert commit r271704, a patch that enables warnings for non-portable ↵Taewook Oh2016-06-042-131/+2
| | | | | | #include and #import paths (Corresponding clang patch has been reverted by r271761). Patches are reverted because they generate lots of unadressable warnings for windows and fail tests under ASAN. llvm-svn: 271764
* [LockFileManager] Improve error output by using better error messagesBruno Cardoso Lopes2016-06-041-6/+31
| | | | | | | | | | | | This is currently used by clang to lock access to modules; improve the error message so that clang can use better output messages from locking error issues. rdar://problem/26529101 Differential Review: http://reviews.llvm.org/D20942 llvm-svn: 271755
* [cpu-detection] Naming conventionAlina Sbirlea2016-06-031-28/+27
| | | | | | | | | | | | Summary: Follow-up to D20926 (committed as r271595, r271596). This patch is in preparation for a substantial refactoring of the code. No functionality changed. Differential Revision: http://reviews.llvm.org/D20970 llvm-svn: 271726
* Test commit. Removes some spaces. No functionality changed.Alina Sbirlea2016-06-031-22/+22
| | | | | | | | | | | | Summary: Test commit. Removes some spaces. No functionality changed. Reviewers: llvm-commits Differential Revision: http://reviews.llvm.org/D20972 llvm-svn: 271711
* In openFileForRead, attempt to fetch the actual name of the file on disk -- ↵Taewook Oh2016-06-032-2/+131
| | | | | | | | | | including case -- so that clang can later warn about non-portable #include and #import directives. Differential Revision: http://reviews.llvm.org/D19842 Patch by Eric Niebler llvm-svn: 271704
* Adding reserve and capacity methods to FoldingSetBen Craig2016-06-031-5/+20
| | | | | | http://reviews.llvm.org/D20930 llvm-svn: 271669
* 80-column fixup after last formatting change.Eric Christopher2016-06-021-4/+8
| | | | llvm-svn: 271598
* Fix a couple of misformatted comments spotted in post-commit review.Eric Christopher2016-06-021-8/+7
| | | | llvm-svn: 271596
* This patch is in preparation for a substantial refactoring of theEric Christopher2016-06-021-294/+304
| | | | | | | | | | | | code. To make the diffs easier to read, clang-format everything first. No functionality changed. Patch by Alina Sbirlea! http://reviews.llvm.org/D20926 llvm-svn: 271595
* Fix the use of sys::MemoryFence after including WindowsSupport.h thatChandler Carruth2016-06-021-0/+5
| | | | | | r271558 introduced. llvm-svn: 271563
* This is yet another attempt to re-instate r220932 as discussed inChandler Carruth2016-06-022-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D19271. Previous attempt was broken by NetBSD, so in this version I've made the fallback path generic rather than Windows specific and sent both Windows and NetBSD to it. I've also re-formatted the code some, and used an exact clone of the code in PassSupport.h for doing manual call-once using our atomics rather than rolling a new one. If this sticks, we can replace the fallback path for Windows with a Windows-specific implementation that is more reliable. Original commit message: 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 llvm-svn: 271558
* Remove all of the legacy home-grown atomic operations LLVM providedChandler Carruth2016-06-021-59/+0
| | | | | | | | | | | | | | | | | | | | | | | except for CompareAndSwap. That is the only one still being used anywhere now that statistics have been moved onto std::atomic. Also, add a warning to the header that we shouldn't introduce more uses of these old style atomics and instead should be using C++11's std::atomic facilities. Really hoping that we can hammer out the last couple of users here and replace them with something more localized and/or principled, but figured this was a pretty good start. =] Note that this patch will need to be reverted if r271504 needs to be reverted as that removes the last user of these. However, the biggest risk for that patch was MSVC 2013 and at least one bot has already passed where it would have failed there. I've tested MSVC 2015 using their web interfaces and other platforms seem fine, so I'm optimistic. Differential Revision: http://reviews.llvm.org/D20901 llvm-svn: 271540
* 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
OpenPOWER on IntegriCloud