summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Support: Remove MemoryObject and DataStreamer interfaces.Peter Collingbourne2016-11-022-69/+0
| | | | | | | | These interfaces are no longer used. Differential Revision: https://reviews.llvm.org/D26222 llvm-svn: 285774
* Attempt to pacify buildbotSerge Pavlov2016-11-011-1/+1
| | | | llvm-svn: 285676
* Allow resolving response file names relative to including fileSerge Pavlov2016-11-011-0/+65
| | | | | | | | | | | | | | 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
* Resubmit "Add support for advanced number formatting."Zachary Turner2016-10-292-0/+177
| | | | | | | | | | | | | 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
* [Support] Fix AlignOf test on i386-linux.Benjamin Kramer2016-10-211-12/+15
| | | | | | | | | On i386 alignof(double) = 8 is not the same as alignof(struct { double }) = 4. This used to be not an issue because the old implementation always measured alignment inside of structs. Wrap a dummy struct around the test to avoid this issue. llvm-svn: 284812
* [Support] Remove llvm::alignOf now that all uses are gone.Benjamin Kramer2016-10-201-166/+55
| | | | | | | | | Also clean up the legacy hacks for AlignedCharArray. I'm keeping LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still support apparently) shipped a buggy alignas(). All other supported compilers have a working alignas. llvm-svn: 284736
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-29/+24
| | | | | | No functionality change intended. llvm-svn: 284733
* Reapply "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-203-0/+90
| | | | | | | | | 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
* Add computeHostNumPhysicalCores() implementation for DarwinMehdi Amini2016-10-191-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D25800 llvm-svn: 284656
* Revert "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-193-90/+0
| | | | | | | | | 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-193-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Resubmit "Add support for advanced number formatting.""Renato Golin2016-10-182-350/+0
| | | | | | | | | | 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-171-27/+33
| | | | | | This should fix the remaining broken builds. llvm-svn: 284437
* Resubmit "Add support for advanced number formatting."Zachary Turner2016-10-172-0/+344
| | | | | | | | | | 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-387/+0
| | | | | | | 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-2/+2
| | | | llvm-svn: 284428
* [Support] Add support for "advanced" number formatting.Zachary Turner2016-10-172-0/+387
| | | | | | | | | | | | | | | 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 windows test.Benjamin Kramer2016-10-171-2/+0
| | | | | | | Windows doesn't have roots, so I think this test doesn't make sense there. llvm-svn: 284386
* [Support] remove_dots: Remove .. from absolute paths.Benjamin Kramer2016-10-171-0/+4
| | | | | | | /../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
* unittests: Explicitly ignore some return values in crash testsJustin Bogner2016-10-161-16/+18
| | | | | | | | Ideally these would actually check that the results are reasonable, but given that we're looping over so many different kinds of path that isn't really practical. llvm-svn: 284350
* Add interface for querying physical hardware concurrencyTeresa Johnson2016-10-142-0/+26
| | | | | | | | | | | | | | | | | | | | 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-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+4
| | | | | | | | | | Reviewers: bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25561 llvm-svn: 284129
* [ARM]: Add Cortex-R52 target to LLVMJaved Absar2016-10-071-2/+2
| | | | | | | This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. Cortex-R52 implements the ARMv8-R architecture. llvm-svn: 283542
* Use StringReg in TargetParser APIs (NFC)Mehdi Amini2016-10-071-8/+8
| | | | llvm-svn: 283527
* Re-commit "Use StringRef in Support/Darf APIs (NFC)"Mehdi Amini2016-10-051-12/+12
| | | | | | | This reverts commit r283285 and re-commit r283275 with a fix for format("%s", Str); where Str is a StringRef. llvm-svn: 283298
* [Support][CommandLine] Add cl::getRegisteredSubcommands()Dean Michael Berris2016-10-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | This should allow users of the library to get a range to iterate through all the subcommands that are registered to the global parser. This allows users to define subcommands in libraries that self-register to have dispatch done at a different stage (like main). It allows for writing code like the following: for (auto *S : cl::getRegisteredSubcommands()) { if (*S) { // Dispatch on S->getName(). } } This change also contains tests that show this usage pattern. Reviewers: zturner, dblaikie, echristo Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24489 llvm-svn: 283296
* Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""Mehdi Amini2016-10-051-12/+12
| | | | | | One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll llvm-svn: 283285
* Re-commit "Use StringRef in Support/Darf APIs (NFC)"Mehdi Amini2016-10-051-12/+12
| | | | | | | This reverts commit r283278 and re-commit r283275 with the update to fix the build on the LLDB side. llvm-svn: 283281
* Revert "Use StringRef in Support/Darf APIs (NFC)"Mehdi Amini2016-10-051-12/+12
| | | | | | This reverts commit r283275, it broke LLDB Android debug server. llvm-svn: 283278
* Use StringRef in Support/Darf APIs (NFC)Mehdi Amini2016-10-041-12/+12
| | | | llvm-svn: 283275
* Use StringRef in CommandLine Options handling (NFC)Mehdi Amini2016-10-011-24/+24
| | | | llvm-svn: 283007
* Add xxhash to llvm.Rafael Espindola2016-09-272-0/+21
| | | | | | It will be used for fast fingerprinting in lld at least. llvm-svn: 282493
* Revert "[Support][CommandLine] Add cl::getRegisteredSubcommands()"Zachary Turner2016-09-131-23/+0
| | | | | | | This reverts r281290, as it breaks unit tests. http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/303 llvm-svn: 281292
* [Support][CommandLine] Add cl::getRegisteredSubcommands()Dean Michael Berris2016-09-131-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | This should allow users of the library to get a range to iterate through all the subcommands that are registered to the global parser. This allows users to define subcommands in libraries that self-register to have dispatch done at a different stage (like main). It allows for writing code like the following: for (auto *S : cl::getRegisteredSubcommands()) { if (*S) { // Dispatch on S->getName(). } } This change also contains tests that show this usage pattern. Reviewers: zturner, dblaikie, echristo Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24489 llvm-svn: 281290
* [YAMLIO] Add the ability to map with context.Zachary Turner2016-09-081-0/+69
| | | | | | | | | | | | | | | | | | | | | mapping a yaml field to an object in code has always been a stateless operation. You could still pass state by using the `setContext` function of the YAMLIO object, but this represented global state for the entire yaml input. In order to have context-sensitive state, it is necessary to pass this state in at the granularity of an individual mapping. This patch adds support for this type of context-sensitive state. You simply pass an additional argument of type T to the `mapRequired` or `mapOptional` functions, and provided you have specialized a `MappingContextTraits<U, T>` class with the appropriate mapping function, you can pass this context into the mapping function. Reviewed By: chandlerc Differential Revision: https://reviews.llvm.org/D24162 llvm-svn: 280977
* [Support] - Fix possible crash in match() of llvm::Regex.George Rimar2016-09-021-0/+9
| | | | | | | | | | | | Crash was possible if match() method was called on object that was moved or object created with empty constructor. Testcases updated. DIfferential revision: https://reviews.llvm.org/D24123 llvm-svn: 280473
* raw_pwrite_stream_test.cpp: _putenv_s() may be assumed as win32-generic.NAKAMURA Takumi2016-09-021-1/+1
| | | | llvm-svn: 280449
* Fix a real temp file leak in FileOutputBufferReid Kleckner2016-09-023-9/+16
| | | | | | | | | | | | | If we failed to commit the buffer but did not die to a signal, the temp file would remain on disk on Windows. Having an open file mapping and file handle prevents the file from being deleted. I am choosing not to add an assertion of success on the temp file removal, since virus scanners and other environmental things can often cause removal to fail in real world tools. Also fix more temp file leaks in unit tests. llvm-svn: 280445
* Try to fix some temp file leaks in SupportTests, PR18335Reid Kleckner2016-09-024-14/+62
| | | | llvm-svn: 280443
* [LLVM/Support] - Create no-arguments constructor for llvm::RegexGeorge Rimar2016-09-011-0/+9
| | | | | | | | | This is useful when need to defer the construction, e.g. using Regex as a member of class. Differential revision: https://reviews.llvm.org/D24101 llvm-svn: 280339
* Move unittests/Support/IteratorTest.cpp to unittests/ADT/Duncan P. N. Exon Smith2016-08-202-213/+0
| | | | | | This testing stuff from ADT, not Support. Fix the file location. llvm-svn: 279372
* [ADT] add pointer_iterator, the opposite of pointee_iteratorTim Shen2016-08-191-0/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D23703 llvm-svn: 279323
* [ADT] Add filter_iterator for filtering elementsTim Shen2016-08-121-0/+69
| | | | | | Differential Revision: https://reviews.llvm.org/D22951 llvm-svn: 278569
* Use the range variant of find instead of unpacking begin/endDavid Majnemer2016-08-112-16/+14
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
* [ADT] Change iterator_adaptor_base's default template arguments to forward ↵Tim Shen2016-08-091-0/+18
| | | | | | | | | | | | more underlying typedefs Reviewers: chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23217 llvm-svn: 278157
* Fix TargetParser unit tests for ARM / AArch64.Zachary Turner2016-08-051-4/+13
| | | | | | | | String pooling is not guaranteed by the standard, so if you're comparing two different string literals for equality, you have to use strcmp. llvm-svn: 277831
* [AArch64] Add support for Samsung Exynos M2 (NFC).Evandro Menezes2016-08-011-3/+4
| | | | llvm-svn: 277364
* TrailingObjects::FixedSizeStorage constexpr fixes + testsHubert Tong2016-07-301-0/+47
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change fixes issues with `LLVM_CONSTEXPR` functions and `TrailingObjects::FixedSizeStorage`. In particular, some of the functions marked `LLVM_CONSTEXPR` used by `FixedSizeStorage` were not implemented such that they evaluate successfully as part of a constant expression despite constant arguments. This change also implements a more traditional template-meta path to accommodate MSVC, and adds unit tests for `FixedSizeStorage`. Drive-by fix: the access control for members of `TrailingObjectsImpl` is tightened. Reviewers: faisalv, rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22668 llvm-svn: 277270
OpenPOWER on IntegriCloud