summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [Triple] Add Facebook vendorShoaib Meenai2016-11-221-0/+2
| | | | | | | | | Add a compiler vendor for Facebook, to enable future vendor-specific behavior. Differential Revision: https://reviews.llvm.org/D25136 llvm-svn: 287684
* Fix comment typos. NFC.Simon Pilgrim2016-11-201-1/+1
| | | | | | Identified by Pedro Giffuni in PR27636. llvm-svn: 287490
* Fix file name resolution in nested response filesSerge Pavlov2016-11-201-0/+6
| | | | | | | | | | If a response file in construct `@file` was specified by relative name, constructs `@file` nested within it were resolved incorrectly if the flag RelativeNames in call to ExpandResponseFile was set to true. This feature is used in configuration files, tests for it are in respective change (see D24933). llvm-svn: 287482
* Attempt to fix big-endian buildbots.Rui Ueyama2016-11-201-7/+0
| | | | llvm-svn: 287476
* Style fix. NFC.Rui Ueyama2016-11-201-7/+7
| | | | llvm-svn: 287475
* Fix buildbot.Rui Ueyama2016-11-201-2/+2
| | | | llvm-svn: 287474
* SHA1: unroll loop in hashBlock.Rui Ueyama2016-11-201-44/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code is taken from public domain. https://github.com/jsonn/src/blob/trunk/common/lib/libc/hash/sha1/sha1.c I wrote a sha1 command and ran it on my Xeon E5-2680 v2 2.80GHz machine. Here is a result. The new hash function is 37% faster than before. Performance counter stats for './llvm-sha1-old /ssd/build/bin/lld' (10 runs): 6640.503687 task-clock (msec) # 1.001 CPUs utilized ( +- 0.03% ) 54 context-switches # 0.008 K/sec ( +- 5.03% ) 5 cpu-migrations # 0.001 K/sec ( +- 31.73% ) 183,803 page-faults # 0.028 M/sec ( +- 0.00% ) 18,527,954,113 cycles # 2.790 GHz ( +- 0.03% ) 4,993,237,485 stalled-cycles-frontend # 26.95% frontend cycles idle ( +- 0.11% ) <not supported> stalled-cycles-backend 50,217,149,423 instructions # 2.71 insns per cycle # 0.10 stalled cycles per insn ( +- 0.00% ) 6,094,322,337 branches # 917.750 M/sec ( +- 0.00% ) 11,778,239 branch-misses # 0.19% of all branches ( +- 0.01% ) 6.634017401 seconds time elapsed ( +- 0.03% ) Performance counter stats for './llvm-sha1-new /ssd/build/bin/lld' (10 runs): 4167.062720 task-clock (msec) # 1.001 CPUs utilized ( +- 0.02% ) 52 context-switches # 0.012 K/sec ( +- 16.45% ) 7 cpu-migrations # 0.002 K/sec ( +- 32.20% ) 183,804 page-faults # 0.044 M/sec ( +- 0.00% ) 11,626,611,958 cycles # 2.790 GHz ( +- 0.02% ) 4,491,897,976 stalled-cycles-frontend # 38.63% frontend cycles idle ( +- 0.05% ) <not supported> stalled-cycles-backend 24,320,180,617 instructions # 2.09 insns per cycle # 0.18 stalled cycles per insn ( +- 0.00% ) 1,574,674,576 branches # 377.886 M/sec ( +- 0.00% ) 11,769,693 branch-misses # 0.75% of all branches ( +- 0.00% ) 4.163251552 seconds time elapsed ( +- 0.02% ) Differential Revision: https://reviews.llvm.org/D26890 llvm-svn: 287473
* Revert "Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch"Mehdi Amini2016-11-181-16/+0
| | | | | | This reverts commit r287352, LLDB CI is broken. llvm-svn: 287374
* Statistic/Timer: Include timers in PrintStatisticsJSON().Matthias Braun2016-11-182-27/+67
| | | | | | Differential Revision: https://reviews.llvm.org/D25588 llvm-svn: 287370
* Timer: Track name and description.Matthias Braun2016-11-181-18/+23
| | | | | | | | | | | | | The previously used "names" are rather descriptions (they use multiple words and contain spaces), use short programming language identifier like strings for the "names" which should be used when exporting to machine parseable formats. Also removed a unused TimerGroup from Hexxagon. Differential Revision: https://reviews.llvm.org/D25583 llvm-svn: 287369
* Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatchMehdi Amini2016-11-181-0/+16
| | | | | | | | | | | | | | | | | | | | | Summary: LLVM will define a symbol, either EnableABIBreakingChecks or DisableABIBreakingChecks depending on the configuration setting for LLVM_ABI_BREAKING_CHECKS. The llvm-config.h header will add weak references to these symbols in every clients that includes this header. This should ensure that a mismatch triggers a link failure (or a load time failure for DSO). On MSVC, the pragma "detect_mismatch" is used instead. Reviewers: rnk, jroelofs Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26841 llvm-svn: 287352
* Add a little endian variant of TCE.Pekka Jaaskelainen2016-11-161-1/+10
| | | | llvm-svn: 287111
* Remove TimeValue classPavel Labath2016-11-162-56/+0
| | | | | | | | | | | | | | Summary: All uses have been replaced by appropriate std::chrono types, and the class is now unused. Reviewers: zturner, mehdi_amini Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26447 llvm-svn: 287094
* Simplify identify_magic.Rui Ueyama2016-11-151-26/+23
| | | | | | This patch defines a memcmp-ish helper function to simplify identify_magic. llvm-svn: 286928
* Add a file magic for CL.exe's object file created with /GL.Rui Ueyama2016-11-151-11/+7
| | | | | | | | | | | | This patch makes it possible to identify object files created by CL.exe with /GL option. Such file contains Microsoft proprietary intermediate code instead of target machine code to do LTO. I need this to print out user-friendly error message from LLD. Differential Revision: https://reviews.llvm.org/D26645 llvm-svn: 286919
* Use _Unwind_Backtrace on Apple platforms.Bob Wilson2016-11-141-1/+1
| | | | | | | | | | | | | Darwin's backtrace() function does not work with sigaltstack (which was enabled when available with r270395) — it does a sanity check to make sure that the current frame pointer is within the expected stack area (which it is not when using an alternate stack) and gives up otherwise. The alternative of _Unwind_Backtrace seems to work fine on macOS, so use that when backtrace() fails. Note that we then use backtrace_symbols_fd() with the addresses from _Unwind_Backtrace, but I’ve tested that and it also seems to work fine. rdar://problem/28646552 llvm-svn: 286851
* [Support] Add StringRef::find_lower and contains_lower.Zachary Turner2016-11-121-0/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D25299 llvm-svn: 286724
* [Support] Introduce llvm::formatv() function.Zachary Turner2016-11-114-28/+213
| | | | | | | | | | | | | | | | | | This introduces a new type-safe general purpose formatting library. It provides compile-time type safety, does not require a format specifier (since the type is deduced), and provides mechanisms for extending the format capability to user defined types, and overriding the formatting behavior for existing types. This patch additionally adds documentation for the API to the LLVM programmer's manual. Mailing List Thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html Differential Revision: https://reviews.llvm.org/D25587 llvm-svn: 286682
* Timer: Remove group-less NamedRegionTimer constructor.Matthias Braun2016-11-101-14/+0
| | | | | | | | | | | | | | | The NamedRegionTimer initializer without a group name puts the Timer into the "Misc" group and is (nearly) unused. Remove it. The only user of this constructor appears to be the HexagonGenInsert pass, which creates a counter without group to count the complete execution time of that pass, however since every pass gets a counter by the PassManager anyway this should be unnecessary. Also removed the pointless TimerGroup there. Differential Revision: https://reviews.llvm.org/D25582 llvm-svn: 286524
* Fix type ambiguity with std::maxZachary Turner2016-11-101-1/+1
| | | | llvm-svn: 286498
* [Support] Improve flexibility of binary blob formatter.Zachary Turner2016-11-102-66/+56
| | | | | | | | | | | This makes it possible to indent a binary blob by a certain number of bytes, and also makes some things more idiomatic. Finally, it integrates this binary blob formatter into ScopedPrinter which used to have its own implementation of this algorithm. Differential Revision: https://reviews.llvm.org/D26477 llvm-svn: 286495
* Zero-initialize chrono duration objectsPavel Labath2016-11-091-1/+1
| | | | | | | The default duration constructor does not zero-initialize the object, we need to do that manually. llvm-svn: 286359
* Added the ability to dump hex bytes easily into a raw_ostream.Greg Clayton2016-11-091-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unit tests were added to verify this functionality keeps working correctly. Example output for raw hex bytes: llvm::ArrayRef<uint8_t> Bytes = ...; llvm::outs() << format_hex_bytes(Bytes); 554889e5 4881ec70 04000048 8d051002 00004c8d 05fd0100 004c8b0d d0020000 Example output for raw hex bytes with offsets: llvm::outs() << format_hex_bytes(Bytes, 0x100000d10); 0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 Example output for raw hex bytes with ASCII with offsets: llvm::outs() << format_hex_bytes_with_ascii(Bytes, 0x100000d10); 0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 |UH.?H.?p...H....| 0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 |..L..?...L..?...| The default groups bytes into 4 byte groups, but this can be changed to 1 byte: llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 1 /*ByteGroupSize*/); 0x0000000100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02 0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00 llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 2 /*ByteGroupSize*/); 0x0000000100000d10: 5548 89e5 4881 ec70 0400 0048 8d05 1002 0x0000000100000d20: 0000 4c8d 05fd 0100 004c 8b0d d002 0000 llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 8 /*NumPerLine*/, 1 /*ByteGroupSize*/); 0x0000000100000d10: 55 48 89 e5 48 81 ec 70 0x0000000100000d18: 04 00 00 48 8d 05 10 02 0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 0x0000000100000d28: 00 4c 8b 0d d0 02 00 00 https://reviews.llvm.org/D26405 llvm-svn: 286316
* Fix memory leaks (coverity issues 1365586 & 1365591)Sylvestre Ledru2016-11-081-2/+6
| | | | | | | | | | Reviewers: hfinkel Subscribers: george.burgess.iv, malcolm.parsons, boris.ulasevich, llvm-commits Differential Revision: https://reviews.llvm.org/D26347 llvm-svn: 286223
* [APFloat] Make functions that produce APFloaat objects use correct semantics.Tim Shen2016-11-061-19/+37
| | | | | | | | | | | | | | | | | Summary: Fixes PR30869. In D25977 I meant to change all functions that care about lifetime. I changed constructors, factory functions, but I missed member/free functions that return new instances. This patch changes them. Reviewers: hfinkel, kbarton, echristo, joerg Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D26269 llvm-svn: 286060
* Correct mprotect page boundries to round up end page. Fixes PR30905.Alina Sbirlea2016-11-051-1/+4
| | | | | | | | | | | | | | Summary: Update the boundries for mprotect. Patch by Andrew Adams. Fixes PR30905. Reviewers: loladiro, andrew.w.kaylor, chandlerc Subscribers: abadams, llvm-commits Differential Revision: https://reviews.llvm.org/D26312 llvm-svn: 286032
* Support: Remove MemoryObject and DataStreamer interfaces.Peter Collingbourne2016-11-024-241/+0
| | | | | | | | These interfaces are no longer used. Differential Revision: https://reviews.llvm.org/D26222 llvm-svn: 285774
* [RISCV] Recognise riscv32 and riscv64 in triple parsing codeAlex Bradbury2016-11-011-0/+21
| | | | | | | | | | | This is the first in a series of 10 initial patches that incrementally add an MC layer for RISC-V to LLVM. See <http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html> for more discussion. Differential Revision: https://reviews.llvm.org/D23557 llvm-svn: 285707
* Allow resolving response file names relative to including fileSerge Pavlov2016-11-011-6/+23
| | | | | | | | | | | | | | If a response file included by construct @file itself includes a response file and that file is specified by relative file name, current behavior is to resolve the name relative to the current working directory. The change adds additional flag to ExpandResponseFiles that may be used to resolve nested response file names relative to including file. With the new mode a set of related response files may be kept together and reference each other with short position independent names. Differential Revision: https://reviews.llvm.org/D24917 llvm-svn: 285675
* NativeFormatting.cpp: Fix build for mingw. Where would writePadding() be?NAKAMURA Takumi2016-10-291-1/+0
| | | | llvm-svn: 285509
* [APFloat] Remove the redundent function body of uninitialized ctor, which ↵Tim Shen2016-10-291-4/+1
| | | | | | should be done in r285468 llvm-svn: 285486
* Resubmit "Add support for advanced number formatting."Zachary Turner2016-10-292-93/+171
| | | | | | | | | | | | | This resubmits r284436 and r284437, which were reverted in r284462 as they were breaking the AArch64 buildbot. The breakage on AArch64 turned out to be a miscompile which is still not fixed, but is actively tracked at llvm.org/pr30748. This resubmission re-writes the code in a way so as to make the miscompile not happen. llvm-svn: 285483
* Refactor DW_LNE_* into Dwarf.defAdrian Prantl2016-10-281-8/+6
| | | | llvm-svn: 285475
* Refactor DW_LNS_* into Dwarf.defAdrian Prantl2016-10-281-13/+6
| | | | llvm-svn: 285474
* Refactor DW_APPLE_PROPERTY_* into Dwarf.defAdrian Prantl2016-10-281-31/+6
| | | | llvm-svn: 285473
* Refactor DW_CFA_* into Dwarf.defAdrian Prantl2016-10-281-32/+6
| | | | llvm-svn: 285472
* Refactor all DW_FORM_* constants into Dwarf.defAdrian Prantl2016-10-281-34/+6
| | | | llvm-svn: 285470
* [APFloat] Fix memory bugs revealed by MSanTim Shen2016-10-281-3/+8
| | | | | | | | | | Reviewers: eugenis, hfinkel, kbarton, iteratee, echristo Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D26102 llvm-svn: 285468
* Move the DWARF attribute constants into Dwarf.def and delete 300 lines of ↵Adrian Prantl2016-10-281-195/+6
| | | | | | silly code. llvm-svn: 285425
* Import/update constants from the DWARF 5 public review draft document.Adrian Prantl2016-10-281-3/+20
| | | | | | https://reviews.llvm.org/D26051 llvm-svn: 285421
* Reapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." withTim Shen2016-10-271-59/+115
| | | | | | a workaround for old clang. llvm-svn: 285358
* Revert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."Tim Shen2016-10-271-115/+59
| | | | | | This reverts r285351, since it breaks the build. llvm-svn: 285354
* [APFloat] Add DoubleAPFloat mode to APFloat. NFC.Tim Shen2016-10-271-59/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds DoubleAPFloat mode to APFloat. Now, an APFloat with semantics PPCDoubleDouble will have DoubleAPFloat layout (APFloat.U.Double), which contains two underlying APFloats as PPCDoubleDoubleImpl and IEEEdouble semantics. Currently the IEEEdouble APFloat is not used, and the first APFloat behaves exactly the same before this change. This patch consists of three kinds of logics: 1) Construction and destruction of APFloat. Now the ctors, dtor, assign opertors and factory functions construct different underlying layout based on the semantics passed in. 2) s/IEEE/getIEEE()/ for normal, lifetime-unrelated computation functions. These functions only access Floats[0] in DoubleAPFloat, which is the same as today's semantic. 3) A "Double dispatch" function, APFloat::convert. Converting between two different layouts requires appropriate logic. Neither of these change the external behavior. Reviewers: hfinkel, kbarton, echristo, iteratee Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D25977 llvm-svn: 285351
* DebugInfo: support for DWARFv5 DW_AT_alignment attributeVictor Leschuk2016-10-261-0/+2
| | | | | | | | | | | | * Assume that clang passes non-zero alignment value to DIBuilder only in case when it was forced by C++11 'alignas', C11 '_Alignas' or compiler attribute '__attribute__((aligned (N)))'. * Emit DW_AT_alignment if alignment is specified for type/object. Differential Revision: https://reviews.llvm.org/D24425 llvm-svn: 285189
* Revert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".Vassil Vassilev2016-10-261-2/+0
| | | | | | The commit broke the builds. llvm-svn: 285183
* DebugInfo: support for DWARFv5 DW_AT_alignment attributeVictor Leschuk2016-10-261-0/+2
| | | | | | | | | | | | * Assume that clang passes non-zero alignment value to DIBuilder only in case when it was forced by C++11 'alignas', C11 '_Alignas' or compiler attribute '__attribute__((aligned (N)))'. * Emit DW_AT_alignment if alignment is specified for type/object. Differential Revision: https://reviews.llvm.org/D24425 llvm-svn: 285181
* [APFloat] Make APFloat an interface class to the internal IEEEFloat. NFC.Tim Shen2016-10-251-372/+244
| | | | | | | | | | | | | | | | | | | | | Summary: The intention is to make APFloat an interface class, so that later I can add a second implementation class DoubleAPFloat to correctly implement PPCDoubleDouble semantic. The interface of IEEEFloat is not public, and can be simplified (currently it's exactly the same as the old APFloat), but that belongs to a separate patch. DoubleAPFloat should look like: class DoubleAPFloat { const fltSemantics *Semantics; std::unique_ptr<APFloat> APFloats; // Two heap-allocated APFloats. }; There is no functional change, nor public interface change. Reviewers: hfinkel, chandlerc, iteratee, echristo, kbarton Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25536 llvm-svn: 285105
* Removed FIXME from include ordering commentSimon Pilgrim2016-10-241-1/+1
| | | | | | Nothing to fix, it's just the way it has to be. llvm-svn: 284991
* [Chrono] Fix !HAVE_FUTIMENS buildPavel Labath2016-10-241-1/+2
| | | | | | | | If we don't have futimens(), we fall back to futimes(), which only supports microsecond timestamps. In that case, we need to explicitly cast away the extra precision in setLastModificationAndAccessTime(). llvm-svn: 284977
* Fix windows builds by swapping windows.h and wincrypt.h ordering.Simon Pilgrim2016-10-241-1/+1
| | | | | | We need to include windows.h first even though it breaks default include ordering rules llvm-svn: 284968
OpenPOWER on IntegriCloud