summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* [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
* Remove TimeValue usage from llvm/SupportPavel Labath2016-10-248-91/+123
| | | | | | | | | | | | | | | | | Summary: This is a follow-up to D25416. It removes all usages of TimeValue from llvm/Support library (except for the actual TimeValue declaration), and replaces them with appropriate usages of std::chrono. To facilitate this, I have added small utility functions for converting time points and durations into appropriate OS-specific types (FILETIME, struct timespec, ...). Reviewers: zturner, mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25730 llvm-svn: 284966
* Do a sweep over move ctors and remove those that are identical to the default.Benjamin Kramer2016-10-201-4/+0
| | | | | | | | | | All of these existed because MSVC 2013 was unable to synthesize default move ctors. We recently dropped support for it so all that error-prone boilerplate can go. No functionality change intended. llvm-svn: 284721
* Reapply "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-205-124/+56
| | | | | | | | | This is a resubmission of r284590. The mingw build should be fixed now. The problem was we were matching time_t with _localtime_64s, which was incorrect on _USE_32BIT_TIME_T systems. Instead I use localtime_s, which should always evaluate to the correct function. llvm-svn: 284720
* Remove LLVM_NOEXCEPT and replace it with noexceptReid Kleckner2016-10-191-1/+1
| | | | | | | Now that we have dropped MSVC 2013, all supported compilers support noexcept and we can drop this portability macro. llvm-svn: 284672
* Add computeHostNumPhysicalCores() implementation for DarwinMehdi Amini2016-10-191-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D25800 llvm-svn: 284656
* Revert "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-195-56/+124
| | | | | | | | | This reverts commit r284590 as it fails on the mingw buildbot. I think I know the fix, but I cannot test it right now. Will reapply when I verify it works ok. This reverts r284590. llvm-svn: 284615
* Add Chrono.h - std::chrono support headerPavel Labath2016-10-195-124/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: std::chrono mostly covers the functionality of llvm::sys::TimeValue and lldb_private::TimeValue. This header adds a bit of utility functions and typedefs, which make the usage of the library and porting code from TimeValues easier. Rationale: - TimePoint typedef - precision of system_clock is implementation defined - using a well-defined precision helps maintain consistency between platforms, makes it interact better with existing TimeValue classes, and avoids cases there a time point is implicitly convertible to a specific precision on some platforms but not on others. - system_clock::to_time_t only accepts time_points with the default system precision (even though time_t has only second precision on all platforms we support). To avoid the need for explicit casts, I have added a toTimeT() wrapper function. toTimePoint(time_t) was not strictly necessary, but I have added it for symmetry. Reviewers: zturner, mehdi_amini Subscribers: beanz, mgorny, llvm-commits, modocache Differential Revision: https://reviews.llvm.org/D25416 llvm-svn: 284590
* Reduce global namespace pollution. NFC.Benjamin Kramer2016-10-181-2/+2
| | | | llvm-svn: 284521
* Revert "Resubmit "Add support for advanced number formatting.""Renato Golin2016-10-182-328/+89
| | | | | | | | | | This reverts commits 284436 and 284437 because they still break AArch64 bots: Value of: format_number(-10, IntegerStyle::Integer, 1) Actual: "-0" Expected: "-10" llvm-svn: 284462
* Rename HexStyle -> HexFormatStyle, and remove a constexpr.Zachary Turner2016-10-172-23/+24
| | | | | | This should fix the remaining broken builds. llvm-svn: 284437
* Resubmit "Add support for advanced number formatting."Zachary Turner2016-10-172-89/+327
| | | | | | | | | | This resubmits commits 284425 and r284428, which were reverted in r284429 due to some infinite recursion caused by an incorrect selection of function overloads. Reproduced the failure on Linux using GCC 4.8.4, and confirmed that with the new patch the tests path on GCC as well as MSVC. So hopefully this fixes everything. llvm-svn: 284436
* Revert formatting changes.Zachary Turner2016-10-172-323/+88
| | | | | | | This reverts r288425 and r284428 as they are causing test crashes on some systems. llvm-svn: 284429
* Try to fix build after invalid pointer conversion.Zachary Turner2016-10-171-0/+14
| | | | llvm-svn: 284428
* [Support] Add support for "advanced" number formatting.Zachary Turner2016-10-172-88/+309
| | | | | | | | | | | | | | | raw_ostream has not afforded a lot of flexibility in terms of how to format numbers when outputting. Wrap this all up into a set of low level helper functions that can be used to output numbers with arbitrary precision, alignment, format, etc and then update raw_ostream to use these functions. This will be useful for upcoming improvements to llvm's string formatting libraries, but are still useful independently. Differential Revision: https://reviews.llvm.org/D25497 llvm-svn: 284425
* Rename interface for querying physical hardware concurrencyTeresa Johnson2016-10-171-1/+1
| | | | | | | | | | Based on post-commit review for D25585/r284180, rename hardware_physical_concurrency to heavyweight_hardware_concurrency, to better reflect what type of tasks it should be used for and to enable other systems to map this to something other than the number of physical cores. llvm-svn: 284390
* [Support] remove_dots: Remove .. from absolute paths.Benjamin Kramer2016-10-171-5/+8
| | | | | | | /../foo is still a proper path after removing the dotdot. This should now finally match https://9p.io/sys/doc/lexnames.html [Cleaning names]. llvm-svn: 284384
* Support: Return void from Scanner::scan_ns_uri_char, no one uses the resultJustin Bogner2016-10-161-7/+2
| | | | | | | Simplify this a little bit since the result is never used. It can be added back easily enough if that changes. llvm-svn: 284348
* PR30711: Fix incorrect profiling of 'long long' in FoldingSet, then use it toRichard Smith2016-10-161-4/+4
| | | | | | fix TBAA violation in profiling of pointers. llvm-svn: 284336
* hardware_physical_concurrency() should return 1 when LLVM is built with ↵Mehdi Amini2016-10-141-0/+3
| | | | | | LLVM_ENABLE_THREADS=OFF llvm-svn: 284283
* Define "contiki" OS specifier.David L Kreitzer2016-10-141-0/+2
| | | | | | | | Patch by Michael LeMay Differential revision: http://reviews.llvm.org/D24897 llvm-svn: 284240
* Timer: Fix doxygen comments, use member initializer; NFCMatthias Braun2016-10-141-16/+12
| | | | llvm-svn: 284181
* Add interface for querying physical hardware concurrencyTeresa Johnson2016-10-141-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: This will be used by ThinLTO to set the amount of backend parallelism, which performs better when restricted to the number of physical cores (on X86 at least, where getHostNumPhysicalCores is currently defined). If not available this falls back to thread::hardware_concurrency. Note I didn't add to the thread class since that is a typedef to std::thread where available. Reviewers: mehdi_amini Subscribers: beanz, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D25585 llvm-svn: 284180
* Add interface to compute number of physical cores on host systemTeresa Johnson2016-10-132-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For now I have only added support for x86_64 Linux, but other systems can be added incrementally. This is to be used for setting the default parallelism for ThinLTO backends (instead of thread::hardware_concurrency which includes hyperthreading and is too aggressive). I'll send this as a follow-on patch, and it will fall back to hardware_concurrency when the new getHostNumPhysicalCores returns -1 (when not supported for a given host system). I also added an interface to MemoryBuffer to force reading a file as a stream - this is required for /proc/cpuinfo which is a special file that looks like a normal file but appears to have 0 size. The existing readers of this file in Host.cpp are reading the first 1024 or so bytes from it, because the necessary info is near the top. But for the new functionality we need to be able to read the entire file. I can go back and change the other readers to use the new getFileAsStream as a follow-on patch since it seems much more robust. Added a unittest. Reviewers: mehdi_amini Subscribers: beanz, mgorny, llvm-commits, modocache Differential Revision: https://reviews.llvm.org/D25564 llvm-svn: 284138
* Do not delete leading ../ in remove_dots.Eric Liu2016-10-131-6/+5
| | | | | | | | | | Reviewers: bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25561 llvm-svn: 284129
* [Support][CommandLine] Display subcommands in help when there are less than 3Alex Lorenz2016-10-121-1/+1
| | | | | | | | | | | | | | subcommands This commit fixes a bug where the help output doesn't display subcommands when a tool has less than 3 subcommands. This change doesn't include a corresponding unittest as there is no viable way to provide a unittest for it. Differential Revision: https://reviews.llvm.org/D25463 llvm-svn: 283998
* Fix build error on LP64 platforms.Rui Ueyama2016-10-111-1/+2
| | | | llvm-svn: 283922
* [raw_ostream] Raise some helper functions out of raw_ostream.Zachary Turner2016-10-113-137/+200
| | | | | | | | | | Low level functionality to format numbers were embedded in the implementation of raw_ostream. I have need to use these through an interface other than the overloaded stream operators, so they need to be raised to a level that they can be used from either raw_ostream operators or other code. llvm-svn: 283921
OpenPOWER on IntegriCloud