summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [Support] Add FormatVariadic support for chrono typesPavel Labath2017-02-071-0/+31
| | | | | | | | | | | | | | | | Summary: The formatter has three knobs: - the user can choose which time unit to use for formatting (default: whatever is the unit of the input) - he can choose whether the unit gets displayed (default: yes) - he can affect the way the number itself is formatted via standard number formatting options (default:default) Reviewers: zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29481 llvm-svn: 294326
* [Support] Simplify triple check in Host CPU test. NFC.Ahmed Bougacha2017-02-041-13/+4
| | | | | | Cleanup the check added in r293990 using the Triple helpers. llvm-svn: 294073
* [Support] Accept macosx triple as 'darwin' in Host unittest. NFC.Ahmed Bougacha2017-02-031-0/+1
| | | | | | | If LLVM was configured with an x86_64-apple-macosx host triple, this test would fail, as the API works but the triple isn't in the whitelist. llvm-svn: 293990
* [ARM] const cast fix for ARMAttributeParser testSam Parker2017-02-011-2/+3
| | | | | | | GCC 4.8 produced a cast qualifier warning, so replaced with C++ style const cast. llvm-svn: 293764
* [ARM] Enable Cortex-M23 and Cortex-M33 support.Javed Absar2017-02-011-0/+4
| | | | | | | | | | | | | Add both cores to the target parser and TableGen. Test that eabi attributes are set correctly for both cores. Additionally, test the absence and presence of MOVT in Cortex-M23 and Cortex-M33, respectively. Committed on behalf of Sanne Wouda. Reviewers : rengolin, olista01. Differential Revision: https://reviews.llvm.org/D29073 llvm-svn: 293761
* Fix fs::set_current_path unit testPavel Labath2017-01-241-1/+5
| | | | | | | | The test fails when there is a symlink on the path because then the path returned by current_path will not match the one we have set. Instead of doing a string match check the unique id of the two files. llvm-svn: 292916
* [Support] Add sys::fs::set_current_path() (aka chdir)Pavel Labath2017-01-241-0/+19
| | | | | | | | | | | | | | | Summary: This adds a cross-platform way of setting the current working directory analogous to the existing current_path() function used for retrieving it. The function will be used in lldb. Reviewers: rafael, silvas, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29035 llvm-svn: 292907
* [ARM] Create objdump subtarget from build attrsSam Parker2017-01-182-0/+385
| | | | | | | | | | | Enable an ELFObjectFile to read the its arm build attributes to produce a target triple with a specific ARM architecture. llvm-objdump now uses this functionality to automatically produce a more accurate target. Differential Revision: https://reviews.llvm.org/D28769 llvm-svn: 292366
* Recommit r292214 "[Support/Compression] - Change zlib API to return Error ↵George Rimar2017-01-171-5/+12
| | | | | | | | | | | | | | | | | | instead of custom status" No any changes, will follow up with D28807 commit containing APLi change for clang to fix build issues happened. Original commit message: [Support/Compression] - Change zlib API to return Error instead of custom status. Previously API returned custom enum values. Patch changes it to return Error with string description. That should help users to report errors in universal way. Differential revision: https://reviews.llvm.org/D28684 llvm-svn: 292226
* Revert r292214 "[Support/Compression] - Change zlib API to return Error ↵George Rimar2017-01-171-12/+5
| | | | | | | | | instead of custom status." It broked clang: http://lab.llvm.org:8080/green//job/clang-stage1-cmake-RA-incremental_build/34218/consoleFull#46141505449ba4694-19c4-4d7e-bec5-911270d8a58c llvm-svn: 292217
* [Support/Compression] - Change zlib API to return Error instead of custom ↵George Rimar2017-01-171-5/+12
| | | | | | | | | | | | status. Previously API returned custom enum values. Patch changes it to return Error with string description. That should help users to report errors in universal way. Differential revision: https://reviews.llvm.org/D28684 llvm-svn: 292214
* Remove unused lambda captures. NFCMalcolm Parsons2017-01-132-2/+3
| | | | llvm-svn: 291916
* Revert r291903 and r291898. Reason: they break check-lld on the bots.Ivan Krasin2017-01-132-385/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Revert [ARM] Fix ubig32_t read in ARMAttributeParser Now using support functions to read data instead of trying to perform casts. =========================================================== Revert [ARM] Enable objdump to construct triple for ARM Now that The ARMAttributeParser has been moved into the library, it has been modified so that it can parse the attributes without printing them and stores them in a map. ELFObjectFile now queries the attributes to fill out the architecture details of a provided triple for 'arm' and 'thumb' targets. llvm-objdump uses this new functionality. Subscribers: llvm-commits, samparker, aemerson, mgorny Differential Revision: https://reviews.llvm.org/D28683 llvm-svn: 291911
* [ARM] Enable objdump to construct triple for ARMSam Parker2017-01-132-0/+385
| | | | | | | | | | | | | Now that The ARMAttributeParser has been moved into the library, it has been modified so that it can parse the attributes without printing them and stores them in a map. ELFObjectFile now queries the attributes to fill out the architecture details of a provided triple for 'arm' and 'thumb' targets. llvm-objdump uses this new functionality. Differential Revision: https://reviews.llvm.org/D28281 llvm-svn: 291898
* Revert r291503, "Lift the 10-type limit for AlignedCharArrayUnion", and ↵NAKAMURA Takumi2017-01-131-18/+0
| | | | | | | | | | | | | followings. r291503, "Lift the 10-type limit for AlignedCharArrayUnion" r291514, "Fix MSVC build of AlignedCharArrayUnion" r291515, "Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet" r291519, "Try once again to fix the MSVC build of AlignedCharArrayUnion" They has been failing on i686-linux. llvm-svn: 291875
* Use EXPECT_EQ instead of ASSERT_EQ in a unit test.Rui Ueyama2017-01-111-10/+10
| | | | llvm-svn: 291713
* Fix memory leak in a unit test.Rui Ueyama2017-01-101-1/+1
| | | | llvm-svn: 291595
* Lift the 10-type limit for AlignedCharArrayUnionSean Callanan2017-01-091-0/+18
| | | | | | | | | | This patch uses C++11 parameter packs and constexpr functions to allow AlignedCharArrayUnion to hold an arbitrary number of types. Differential Revision: https://reviews.llvm.org/D28429 llvm-svn: 291503
* TarWriter: Fix a bug in Ustar header.Rui Ueyama2017-01-092-1/+90
| | | | | | | | | | If we split a filename into `Name` and `Prefix`, `Prefix` is at most 145 bytes. We had a bug that didn't split a path correctly. This bug was pointed out by Rafael in the post commit review. This patch adds a unit test for TarWriter to verify the fix. llvm-svn: 291494
* Support: Add YAML I/O support for custom mappings.Peter Collingbourne2017-01-041-0/+62
| | | | | | | | This will be used to YAMLify parts of the module summary. Differential Revision: https://reviews.llvm.org/D28014 llvm-svn: 290935
* Fix unit test in NDEBUG buildEugene Leviant2016-12-271-0/+2
| | | | llvm-svn: 290604
* Allow setting multiple debug typesEugene Leviant2016-12-272-0/+33
| | | | | | Differential revision: https://reviews.llvm.org/D28109 llvm-svn: 290597
* Move GlobPattern class from LLD to llvm/Support.Rui Ueyama2016-12-202-1/+72
| | | | | | | | | | GlobPattern is a class to handle glob pattern matching. Currently only LLD is using that, but technically that feature is not specific to linkers, so in this patch I move that file to LLVM. Differential Revision: https://reviews.llvm.org/D27969 llvm-svn: 290212
* Simplify format member detection in FormatVariadicPavel Labath2016-12-151-39/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the format member search, which was quite complicated, with a more direct approach to detecting whether a class should be formatted using the format-member method. Instead we use a special type llvm::format_adapter, which every adapter must inherit from. Then the search can be simply implemented with the is_base_of type trait. Aside from the simplification, I like this way more because it makes it more explicit that you are supposed to use this type only for adapter-like formattings, and the other approach (format_provider overloads) should be used as a default (a mistake I made when first trying to use this library). The only slight change in behaviour here is that now choose the format-adapter branch even if the format member invocation will fail to compile (e.g. because it is a non-const member function and we are passing a const adapter), whereas previously we would have gone on to search for format_providers for the type. However, I think that is actually a good thing, as it probably means the programmer did something wrong. Reviewers: zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27679 llvm-svn: 289795
* Add support for Samsung Exynos M3 (NFC)Evandro Menezes2016-12-131-0/+8
| | | | llvm-svn: 289613
* Fix MSCV compilation broken by r289040Pavel Labath2016-12-081-4/+4
| | | | | | | I wanted to use the "not" keyword to make sure it does not get lost in between other checks. MSVC does not like that. llvm-svn: 289041
* Improve format member detection in llvm::formatvPavel Labath2016-12-081-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The existing detection of a format member function has a couple of deficiencies: - the member function does not get detected if one calls formatv with an lvalue, because the template parameter gets deduced as T&, which fails the is_class check. - it also did not work if the function was called with a const variable because the template parameter would get deduced as const T&, again failing the is_class check. This fixes the problem by stripping the references in the uses_format_member template, to make sure the type is correctly detected as class. It also provides specializations of the has_FormatMember template for const and non-const members of the types in order to enable declaring the format member as a "const" function. I have added tests that verify that formatv can be now called in these scenarios. As some scenarios could not be verified at runtime (e.g. making sure that calling a non-const format member on a const object does *not* compile), I have also added some static_asserts which test the behaviour of the template classes used internally by formatv(). Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27525 llvm-svn: 289040
* Refactor TargetParserTests.Zijiao Ma2016-12-061-346/+498
| | | | | | | The TargetParser tests are a bit redundant. Refactor them in a more repeatable way. llvm-svn: 288758
* Support escaping in TrigramIndex.Ivan Krasin2016-12-022-2/+33
| | | | | | | | | | | | | | | | | | Summary: This is a follow up to r288303, where I have introduced TrigramIndex to speed up SpecialCaseList for the cases when all rules are simple wildcards, like *hello*wor.d*. Here, I add support for escaping, so that it's possible to specify rules like *c\+\+abi*. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27318 llvm-svn: 288553
* Use trigrams to speed up SpecialCaseList.Ivan Krasin2016-12-013-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: it's often the case when the rules in the SpecialCaseList are of the form hel.o*bar. That gives us a chance to build trigram index to quickly discard 99% of inputs without running a full regex. A similar idea was used in Google Code Search as described in the blog post: https://swtch.com/~rsc/regexp/regexp4.html The check is defeated, if there's at least one regex more complicated than that. In this case, all inputs will go through the regex. That said, the real-world rules are often simple or can be simplied. That considerably speeds up compiling Chromium with CFI and UBSan. As measured on Chromium's content_message_generator.cc: before, CFI: 44 s after, CFI: 23 s after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference) after, regular compilation to bitcode: 23 s Reviewers: pcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D27188 llvm-svn: 288303
* Fix macro check for ABI breacking check: should use #if instead of #ifndefMehdi Amini2016-11-301-10/+10
| | | | llvm-svn: 288265
* Change Error unittest to use the LLVM_ENABLE_ABI_BREAKING_CHECKS instead of ↵Mehdi Amini2016-11-291-10/+10
| | | | | | | | | | NDEBUG This is consistent with the header (after r288087) and fixes the test for the configuration: -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF llvm-svn: 288196
* Improve error handling in YAML parsingMehdi Amini2016-11-281-0/+8
| | | | | | | | | | | | Some scanner errors were not checked and reported by the parser. Fix PR30934. Recommit r288014 after fixing unittest. Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D26419 llvm-svn: 288071
* [ThreadPool] Rollback recent changes until I figure out the breakage.Davide Italiano2016-11-281-0/+16
| | | | llvm-svn: 288018
* [ThreadPool] Simplify the interface. NFCI.Davide Italiano2016-11-281-16/+0
| | | | | | | The callers don't use the return value. Found by Michael Spencer. llvm-svn: 288016
* Revert "Improve error handling in YAML parsing"Mehdi Amini2016-11-281-8/+0
| | | | | | This reverts commit r288014, the unittest isn't passing llvm-svn: 288015
* Improve error handling in YAML parsingMehdi Amini2016-11-281-0/+8
| | | | | | | | | | | | Some scanner errors were not checked and reported by the parser. Fix PR30934 Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D26419 llvm-svn: 288014
* Add convenient functions to compute hashes of byte vectors.Rui Ueyama2016-11-232-0/+17
| | | | | | | | | In many sitautions, you just want to compute a hash for one chunk of data. This patch adds convenient functions for that purpose. Differential Revision: https://reviews.llvm.org/D26988 llvm-svn: 287726
* Timer: Track name and description.Matthias Braun2016-11-181-2/+2
| | | | | | | | | | | | | 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
* Remove TimeValue classPavel Labath2016-11-162-51/+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
* [AArch64] Add support for Qualcomm's Falkor CPU.Chad Rosier2016-11-151-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D26673 llvm-svn: 287036
* [AArch64] Refactor test per Matthias' request.Chad Rosier2016-11-151-3/+9
| | | | llvm-svn: 287031
* [Support] Introduce llvm::formatv() function.Zachary Turner2016-11-113-1/+540
| | | | | | | | | | | | | | | | | | 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
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-10/+11
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Make the Error class constructor protectedMehdi Amini2016-11-111-2/+4
| | | | | | | | | This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561
* [ADT/MathExtras] Make buildbot happy again.Davide Italiano2016-11-111-6/+6
| | | | llvm-svn: 286559
* [ADT/MathExtras] Add tests for PowerOf2Floor (previously untested).Davide Italiano2016-11-111-0/+6
| | | | llvm-svn: 286551
* [ADT/MathExtras] Introduce PowerOf2Ceil.Davide Italiano2016-11-111-0/+6
| | | | | | | | To be used in lld (and probably somewhere else in llvm). Differential Revision: https://reviews.llvm.org/D26538 llvm-svn: 286549
* [Support] Improve flexibility of binary blob formatter.Zachary Turner2016-11-101-80/+76
| | | | | | | | | | | 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
* Added the ability to dump hex bytes easily into a raw_ostream.Greg Clayton2016-11-091-0/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud