summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r353048.James Henderson2019-02-041-215/+0
| | | | | | It was causing unexpected unit test failures on build bots. llvm-svn: 353050
* [CommandLine] Don't print empty sentinel values from EnumValN lists in help textJames Henderson2019-02-041-0/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make an option value truly optional, both the ValueOptional attribute and an empty-named value are required. Prior to this change, this empty-named value appears in the command-line help text: -some-option - some help text =v1 - description 1 =v2 - description 2 = - This change improves the help text for these sort of options in a number of ways: 1) ValueOptional options with an empty-named value now print their help text twice: both without and then with '=<value>' after the name. The latter version then lists the allowed values after it. 2) Empty-named values with no help text in ValueOptional options are not listed in the permitted values. -some-option - some help text -some-option=<value> - some help text =v1 - description 1 =v2 - description 2 3) Otherwise empty-named options are printed as =<empty> rather than simply '='. 4) Option values without help text do not have the '-' separator printed. -some-option=<value> - some help text =v1 - description 1 =v2 =<empty> - description It also tweaks the llvm-symbolizer -functions help text to not print a trailing ':' as that looks bad combined with 1) above. This is mostly a reland of r352750. Reviewed by: ruiu, thopre, mstorsjo Differential Revision: https://reviews.llvm.org/D57030 llvm-svn: 353048
* Revert r352750.James Henderson2019-02-011-134/+0
| | | | | | | This was causing a build bot failure: http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/ llvm-svn: 352848
* [CommandLine] Improve help text for cl::values style optionsJames Henderson2019-01-311-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make an option value truly optional, both the ValueOptional and an empty-named value are required. This empty-named value appears in the command-line help text, which is not ideal. This change improves the help text for these sort of options in a number of ways: 1) ValueOptional options with an empty-named value now print their help text twice: both without and then with '=<value>' after the name. The latter version then lists the allowed values after it. 2) Empty-named values with no help text in ValueOptional options are not listed in the permitted values. 3) Otherwise empty-named options are printed as =<empty> rather than simply '='. 4) Option values without help text do not have the '-' separator printed. It also tweaks the llvm-symbolizer -functions help text to not print a trailing ':' as that looks bad combined with 1) above. Reviewed by: thopre, ruiu Differential Revision: https://reviews.llvm.org/D57030 llvm-svn: 352750
* [VFS] Fix warning and use better check.Michael J. Spencer2019-01-291-1/+1
| | | | llvm-svn: 352527
* VERSION_GREATER_EQUAL not supported in llvm cmake.Ranjeet Singh2019-01-281-1/+1
| | | | | | | | | | | | Patch https://reviews.llvm.org/D56329 caused build failures for me when building on Windows because of the use of cmake operator 'VERSION_GREATER_EQUAL' which isn't supported in older versions of cmake. The llvm website states that minimum required version of cmake for building llvm is 3.4.3 https://llvm.org/docs/CMake.html Differential Revision: https://reviews.llvm.org/D57326 llvm-svn: 352378
* Fix some warnings on MSVCAlexandre Ganea2019-01-271-1/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D56329 llvm-svn: 352322
* Revert "Add support for prefix-only CLI options"Thomas Preud'homme2019-01-271-75/+1
| | | | | | This reverts commit r351038. llvm-svn: 352310
* Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>Serge Guelton2019-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for isPodLike<std::pair<...>> did not match the expectation of std::is_trivially_copyable which makes the memcpy optimization invalid. This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable. Unfortunately std::is_trivially_copyable is not portable across compiler / STL versions. So a portable version is provided too. Note that the following specialization were invalid: std::pair<T0, T1> llvm::Optional<T> Tests have been added to assert that former specialization are respected by the standard usage of llvm::is_trivially_copyable, and that when a decent version of std::is_trivially_copyable is available, llvm::is_trivially_copyable is compared to std::is_trivially_copyable. As of this patch, llvm::Optional is no longer considered trivially copyable, even if T is. This is to be fixed in a later patch, as it has impact on a long-running bug (see r347004) Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296. Differential Revision: https://reviews.llvm.org/D54472 llvm-svn: 351701
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1974-296/+222
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove F_modify flag from FileOutputBuffer.Rui Ueyama2019-01-191-49/+0
| | | | | | | | This code is dead. There is no use of the feature in the entire LLVM codebase. Differential Revision: https://reviews.llvm.org/D56939 llvm-svn: 351613
* [Support] Remove error return value from one overload of fs::make_absolutePavel Labath2019-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The version of make_absolute which accepted a specific directory to use as the "base" for the computation could never fail, even though it returned a std::error_code. The reason for that seems to be historical -- the CWD flavour (which can fail due to failure to retrieve CWD) was there first, and the new version was implemented by extending that. This removes the error return value from the non-CWD overload and reimplements the CWD version on top of that. This enables us to remove some dead code where people were pessimistically trying to handle the errors returned from this function. Reviewers: zturner, sammccall Subscribers: hiraditya, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56599 llvm-svn: 351317
* Revert "[VFS] Allow multiple RealFileSystem instances with independent CWDs."Amara Emerson2019-01-141-80/+0
| | | | | | This reverts commit r351079, r351069 and r351050 as it broken the greendragon bots on macOS. llvm-svn: 351091
* [VFS] Disable unix-assuming VFS test on windowsSam McCall2019-01-141-1/+1
| | | | llvm-svn: 351079
* [VFS] Allow multiple RealFileSystem instances with independent CWDs.Sam McCall2019-01-141-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously only one RealFileSystem instance was available, and its working directory is shared with the process. This doesn't work well for multithreaded programs that want to work with relative paths - the vfs::FileSystem is assumed to provide the working directory, but a thread cannot control this exclusively. The new vfs::createPhysicalFileSystem() factory copies the process's working directory initially, and then allows it to be independently modified. This implementation records the working directory path, and glues it to relative paths to provide the correct absolute path to the sys::fs:: functions. This will give different results in unusual situations (e.g. the CWD is moved). The main alternative is the use of openat(), fstatat(), etc to ask the OS to resolve paths relative to a directory handle which can be kept open. This is more robust. There are two reasons not to do this initially: 1. these functions are not available on all supported Unixes, and are somewhere between difficult and unavailable on Windows. So we need a path-based fallback anyway. 2. this would mean also adding support at the llvm::sys::fs level, which is a larger project. My clearest idea is an OS-specific `BaseDirectory` object that can be optionally passed to functions there. Eventually this could be backed by either paths or a fd where openat() is supported. This is a large project, and demonstrating here that a path-based fallback works is a useful prerequisite. There is some subtlety to the path-manipulation mechanism: - when setting the working directory, both Specified=makeAbsolute(path) and Resolved=realpath(path) are recorded. These may differ in the presence of symlinks. - getCurrentWorkingDirectory() and makeAbsolute() use Specified - this is similar to the behavior of $PWD and sys::path::current_path - IO operations like openFileForRead use Resolved. This is similar to the behavior of an openat() based implementation, that doesn't see changes in symlinks. There may still be combinations of operations and FS states that yield unhelpful behavior. This is hard to avoid with symlinks and FS abstractions :( The caching behavior of the current working directory is removed in this patch. getRealFileSystem() is now specified to link to the process CWD, so the caching is incorrect. The user who needed this so far is clangd, which will immediately switch to createPhysicalFileSystem(). Reviewers: ilya-biryukov, bkramer, labath Subscribers: ioeric, kadircet, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56545 llvm-svn: 351050
* Add support for prefix-only CLI optionsThomas Preud'homme2019-01-141-1/+75
| | | | | | | | | | | | | | | | | | | | | | Summary: Add support for options that always prefix their value, giving an error if the value is in the next argument or if the option is given a value assignment (ie. opt=val). This is the desired behavior for the -D option of FileCheck for instance. Copyright: - Linaro (changes in version 2 of revision D55940) - GraphCore (changes in later versions and introduced when creating D56549) Reviewers: jdenny Subscribers: llvm-commits, probinson, kristina, hiraditya, JonChesterfield Differential Revision: https://reviews.llvm.org/D56549 llvm-svn: 351038
* [AArch64] Create feature set for Exynos M4Evandro Menezes2019-01-111-7/+18
| | | | | | Complete the feature set for Exynos M4 and update test cases. llvm-svn: 350953
* [unittests][Support] AIX: Skip sticky bit file testsHubert Tong2019-01-091-2/+4
| | | | | | | | | | | | | | | | On AIX, attempting (without root) to set the sticky bit on a file with the `chmod` utility will give: ``` chmod: not all requested changes were made to <file> ``` The same occurs when modifying other permission bits on a file with the sticky bit already set. It seems that the `chmod` function will report success despite failing to set the sticky bit. llvm-svn: 350735
* [AArch64] Add command-line option predresDiogo N. Sampaio2019-01-041-1/+3
| | | | | | | | | | | Prediction control instructions are only mandatory from v8.5a onwards but is optional from Armv8.0-A. This patch adds a command line option to enable it by it's own. Differential Revision: https://reviews.llvm.org/D56007 llvm-svn: 350385
* [ARM] Add command-line option for SBDiogo N. Sampaio2019-01-031-1/+2
| | | | | | | | | | | | | | | SB (Speculative Barrier) is only mandatory from 8.5 onwards but is optional from Armv8.0-A. This patch adds a command line option to enable SB, as it was previously only possible to enable by selecting -march=armv8.5-a. This patch also renames FeatureSpecRestrict to FeatureSB. Reviewed By: olista01, LukeCheeseman Differential Revision: https://reviews.llvm.org/D55990 llvm-svn: 350299
* [AArch64] Add command-line option for SBDiogo N. Sampaio2018-12-281-1/+2
| | | | | | | | | | | | | | | SB (Speculative Barrier) is only mandatory from 8.5 onwards but is optional from Armv8.0-A. This patch adds a command line option to enable SB, as it was previously only possible to enable by selecting -march=armv8.5-a. This patch also moves to FeatureSB the old FeatureSpecRestrict. Reviewers: pbarrio, olista01, t.p.northover, LukeCheeseman Differential Revision: https://reviews.llvm.org/D55921 llvm-svn: 350126
* [VFS] Add isLocal to ProxyFileSystem and add unit tests.Michael J. Spencer2018-12-171-0/+37
| | | | | | Differential Revision: https://reviews.llvm.org/D55789 llvm-svn: 349410
* [NFC][AArch64] Remove duplicate Arch list in target parser testsDavid Spickett2018-12-101-6/+1
| | | | | | | | | | The list generated in the target parser tests is the same as the one in the AArch64 target parser. Use that one instead. Differential Revision: https://reviews.llvm.org/D55509 llvm-svn: 348757
* [AArch64] Add command-line option for SSBSPablo Barrio2018-12-031-2/+3
| | | | | | | | | | | | | | | | | | | | | Summary: SSBS (Speculative Store Bypass Safe) is only mandatory from 8.5 onwards but is optional from Armv8.0-A. This patch adds a command line option to enable SSBS, as it was previously only possible to enable by selecting -march=armv8.5-a. Similar patch upstream in GNU binutils: https://sourceware.org/ml/binutils/2018-09/msg00274.html Reviewers: olista01, samparker, aemerson Reviewed By: samparker Subscribers: javed.absar, kristof.beyls, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D54629 llvm-svn: 348137
* Fix DynamicLibraryTests build on Windows when ↵Michael Platings2018-11-281-0/+7
| | | | | | | | | | | | | | | | | LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is ON extract_symbols.py (introduced in D18826) expects all of its library arguments to be in the same directory - typically <config>/lib. DynamicLibraryLib.lib is instead to be found in lib/<config>. This patch intended to make DynamicLibraryLib.lib be created in <config>/lib alongside most of the other libraries. I previously tried passing absolute paths to extract_symbols.py but this generated command lines that were too long for Visual Studio 2015: D54587 Differential Revision: https://reviews.llvm.org/D54701 llvm-svn: 347764
* [ARM, AArch64] Move ARM/AArch64 target parsers intoDavid Spickett2018-11-281-2/+0
| | | | | | | | | | | | | | | | | separate files to enable future changes. This moves ARM and AArch64 target parsing into their own files. They are still accessible through TargetParser.h as before. Several functions in AArch64 which were just forwarders to ARM have been removed. All except AArch64::getFPUName were unused, and that was only used in a test. Which itself was overlapping one in ARM, so it has also been removed. Differential revision: https://reviews.llvm.org/D53980 llvm-svn: 347741
* [unittests] Fix ExpandTilde test to match handling home dirs with trailing slashSimon Atanasyan2018-11-201-2/+2
| | | | | | | | | | | | | | | | | The `expandTildeExpr` routine just replaces a tilde by a home dir path. If the home dir has a trailing slash, the result of substitution will contain double slashes. For example, `HOME=/foo/ ~/bar` gives `/foo//bar`. That corresponds to (at least) Bash behaviour because the following command `$HOME=/foo/ echo ~/bar` prints `/foo//bar`. The `ExpandTilde` test constructs a path expected as the `fs::expand_tilde` call result by calling `path::append` and the expected path has a single slash. This patch fixes that and allows to pass the unittest on hosts where the `HOME` is `/`. Differential Revision: http://reviews.llvm.org/D54752 llvm-svn: 347346
* [unittest] Skip W+X MappedMemoryTests when MPROTECT is enabledMichal Gorny2018-11-201-0/+53
| | | | | | | | | | | Skip all MappedMemoryTest variants that rely on memory pages being mapped for MF_WRITE|MF_EXEC when MPROTECT is enabled on NetBSD. W^X protection causes all those mmap() calls to fail, causing the tests to fail. Differential Revision: https://reviews.llvm.org/D54080 llvm-svn: 347337
* Test commit - delete a trailing space.Michael Platings2018-11-191-1/+1
| | | | llvm-svn: 347193
* [VFS] Update unittest to fix Windows buildbot.Volodymyr Sapsai2018-11-161-6/+6
| | | | | | | | | Buildbot http://lab.llvm.org:8011/builders/clang-x64-windows-msvc is failing because it doesn't like paths in VFS, make them more Windows-friendly. Follow up to r347009. llvm-svn: 347016
* [VFS] Implement `RedirectingFileSystem::getRealPath`.Volodymyr Sapsai2018-11-161-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | It fixes the case when Objective-C framework is added as a subframework through a symlink. When parent framework infers a module map and fails to detect a symlink, it would add a subframework as a submodule. And when we parse module map for the subframework, we would encounter an error like > error: umbrella for module 'WithSubframework.Foo' already covers this directory By implementing `getRealPath` "an egregious but useful hack" in `ModuleMap::inferFrameworkModule` works as expected. rdar://problem/45821279 Reviewers: bruno, benlangmuir, erik.pilkington Reviewed By: bruno Subscribers: hiraditya, dexonsmith, JDevlieghere, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D54245 llvm-svn: 347009
* [Support] Teach YAMLIO about polymorphic typesScott Linder2018-11-141-0/+233
| | | | | | | | | | | | | | | | | | | | | Add support for "polymorphic" types to YAMLIO. PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or Sequence). When inputting, the PolymorphicTraits type is told which type to become, and when outputting the PolymorphicTraits type is asked which type it currently is. Also add support for TaggedScalarTraits to allow dynamically differentiating between multiple scalar types using YAML tags. Serialize empty maps as "{}" and empty sequences as "[]", so that types are preserved when round-tripping PolymorphicTraits. This change has equivalent semantics, but may break e.g. tests which compare output verbatim. Differential Revision: https://reviews.llvm.org/D48144 llvm-svn: 346884
* Make the ExpandTilde unit test expect "\" (not "/") on Win32Matthew Voss2018-11-131-0/+6
| | | | llvm-svn: 346813
* [FileSystem] Add expand_tilde functionJonas Devlieghere2018-11-131-0/+21
| | | | | | | | | | | | In D54435 there was some discussion about the expand_tilde flag for real_path that I wanted to expose through the VFS. The consensus is that these two things should be separate functions. Since we already have the code for this I went ahead and added a function expand_tilde that does just that. Differential revision: https://reviews.llvm.org/D54448 llvm-svn: 346776
* [Support] Make error banner optional in logAllUnhandledErrorsJonas Devlieghere2018-11-111-5/+4
| | | | | | | | In a lot of places an empty string was passed as the ErrorBanner to logAllUnhandledErrors. This patch makes that argument optional to simplify the call sites. llvm-svn: 346604
* [AArch64] Support HiSilicon's TSV110 processorBryan Chan2018-11-092-3/+35
| | | | | | | | | | | | Reviewers: t.p.northover, SjoerdMeijer, kristof.beyls Reviewed By: kristof.beyls Subscribers: olista01, javed.absar, kristof.beyls, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D53908 llvm-svn: 346546
* Revert "[VFS] Add "expand tilde" argument to getRealPath."Sam McCall2018-11-091-2/+2
| | | | | | | This reverts commit r346453. This is a complex change to a widely-used interface, and was not reviewed. llvm-svn: 346500
* [VFS] Add "expand tilde" argument to getRealPath.Jonas Devlieghere2018-11-091-2/+2
| | | | | | | Add an optional argument to expand tildes in the path to mirror llvm's implementation of the corresponding function. llvm-svn: 346453
* Extend virtual file system with `isLocal` methodJonas Devlieghere2018-11-081-0/+11
| | | | | | | | Expose the `llvm::sys::fs::is_local` function through the VFS. Differential revision: https://reviews.llvm.org/D54127 llvm-svn: 346372
* [VFS] Add support for "no_push" to VFS recursive iterators.Jonas Devlieghere2018-10-311-0/+79
| | | | | | | | | | | The "regular" file system has a useful feature that makes it possible to stop recursing when using the recursive directory iterators. This functionality was missing for the VFS recursive iterator and this patch adds that. Differential revision: https://reviews.llvm.org/D53465 llvm-svn: 345793
* [VFS] Add property 'fallthrough' that controls fallback to real file system.Volodymyr Sapsai2018-10-261-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | Default property value 'true' preserves current behavior. Value 'false' can be used to create VFS "root", file system that gives better control over which files compiler can use during compilation as there are no unpredictable accesses to real file system. Non-fallthrough use case changes how we treat multiple VFS overlay files. Instead of all of them being at the same level just above a real file system, now they are nested and subsequent overlays can refer to files in previous overlays. rdar://problem/39465552 Reviewers: bruno, benlangmuir Reviewed By: bruno Subscribers: dexonsmith, cfe-commits, hiraditya Differential Revision: https://reviews.llvm.org/D50539 llvm-svn: 345431
* [Support] json::Value construction from std::vector<T> and std::map<string,T>.Sam McCall2018-10-181-0/+2
| | | | | | | | | | | | Summary: Previously this required a conversion to json::Array/json::Object first. Reviewers: ioeric Subscribers: kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D53385 llvm-svn: 344732
* Make YAML quote forward slashes.Zachary Turner2018-10-121-1/+3
| | | | | | | | | | | | | | | | | If you have the string /usr/bin, prior to this patch it would not be quoted by our YAML serializer. But a string like C:\src would be, due to the presence of a backslash. This makes the quoting rules of basically every single file path different depending on the path syntax (posix vs. Windows). While technically not required by the YAML specification to quote forward slashes, when the behavior of paths is inconsistent it makes it difficult to portably write FileCheck lines that will work with either kind of path. Differential Revision: https://reviews.llvm.org/D53169 llvm-svn: 344359
* Revert "Make YAML quote forward slashes."Zachary Turner2018-10-121-3/+1
| | | | | | | | | | This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344. This is being reverted because I forgot to write a useful commit message, so I'm going to resubmit it with an actual commit message. llvm-svn: 344358
* Make YAML quote forward slashes.Zachary Turner2018-10-121-1/+3
| | | | llvm-svn: 344357
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-102-0/+1602
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [AArch64] -mcpu=native CPU detection for Cavium processorsJoel Jones2018-10-051-0/+72
| | | | | | | | | | This small patch updates the CPU detection for Cavium processors when -mcpu=native is passed on compile-line. Patch by Stefan Teleman Differential Revision: https://reviews.llvm.org/D51939 llvm-svn: 343897
* [AArch64][v8.5A] Add MTE as an optional AArch64 extensionOliver Stannard2018-10-021-1/+2
| | | | | | | | | | | | This adds the memory tagging extension, which is an optional extension introduced in v8.5A. The new instructions and registers will be added by subsequent patches. Patch by Pablo Barrio! Differential revision: https://reviews.llvm.org/D52486 llvm-svn: 343563
* [Support] Listing a directory containing dangling symlinks is not an error.Sam McCall2018-10-011-46/+21
| | | | | | | | | | | | | | Summary: Reporting this as an error required stat()ing every file, as well as seeming semantically questionable. Reviewers: vsk, bkramer Subscribers: mgrang, kristina, llvm-commits, liaoyuke Differential Revision: https://reviews.llvm.org/D52648 llvm-svn: 343460
OpenPOWER on IntegriCloud