summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ADT] Split optional to only include copy mechanics and dtor for non-trivial ↵Benjamin Kramer2018-01-182-69/+112
| | | | | | | | | | | | | types. This makes uses of Optional more transparent to the compiler (and clang-tidy) and generates slightly smaller code. This is a re-land of r317019, which had issues with GCC 4.8 back then. Those issues don't reproduce anymore, but I'll watch the buildbots closely in case anything goes wrong. llvm-svn: 322838
* Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)Kamil Rytarowski2018-01-184-0/+101
| | | | | | | | | | | | | | | | | | | Summary: getgrouplist, getgroupmembership -- calculate group access list Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42064 llvm-svn: 322836
* Fix logging test on windowsPavel Labath2018-01-181-2/+2
| | | | | | | | | | | | | Refactor in r322653 broke the logging test on windows because MSVC uses a fully qualified name as the value of __FUNCTION__, which is not what we were expecting. I'm changing the code to use the more portable __func__, which behaves the same as on clang/gcc. The standard still says that the value of __func__ is implementation defined, so if we run into problems with this test again we may just need to drop it. llvm-svn: 322834
* Add new interceptors: access(2), faccessat(2)Kamil Rytarowski2018-01-184-0/+41
| | | | | | | | | | | | | | | | | | | Summary: access, faccessat - check access permissions of a file or pathname Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42065 llvm-svn: 322831
* Add missing headers for Debug buildsJonas Hahnfeld2018-01-182-0/+2
| | | | llvm-svn: 322830
* Add new interceptors for pwcache(3)-style functionsKamil Rytarowski2018-01-186-0/+138
| | | | | | | | | | | | | | | | | | | | | Summary: From <pwd.h>: user_from_uid, uid_from_user From <grp.h>: group_from_gid, gid_from_group Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42068 llvm-svn: 322829
* A new test to demostrate the current SHLD/SHRD code generation.Andrew V. Tischenko2018-01-181-0/+464
| | | | llvm-svn: 322828
* [clangd] Output log messages to stderr when not configured (e.g. in tests). NFCSam McCall2018-01-182-5/+12
| | | | llvm-svn: 322827
* [ASTMatcher] Add isScoped matcher for enumDecl.Haojian Wu2018-01-184-0/+26
| | | | | | | | | | | | Summary: Reviewers: bkramer, aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42185 llvm-svn: 322826
* [RISCV][NFC] Add nounwind to functions in div.ll and mul.llAlex Bradbury2018-01-182-16/+16
| | | | | | | Committing this separately to minimise irrelevant changes for an upcoming patch. llvm-svn: 322825
* [clangd] CodeCompleteTests cleanup: naming, ordering, helpers. NFCSam McCall2018-01-181-164/+157
| | | | llvm-svn: 322824
* [SelectionDAG] Convert assert to condtionSam Parker2018-01-181-3/+2
| | | | | | | | | Follow-up to r322120 which can cause assertions for AArch64 because v1f64 and v1i64 are legal types. Differential Revision: https://reviews.llvm.org/D42097 llvm-svn: 322823
* [clang-tidy] Don't generate fix for argument constructed from ↵Haojian Wu2018-01-183-3/+30
| | | | | | | | | | | | | | | | | | | | | | std::initializer_list. Summary: A follow-up fix of rL311652. The previous `vector` in our test is different with `std::vector`, so The check still generates fixes for std::vector (`auto p = std::unique_ptr<Foo>(new Foo({1,2,3}))`) in real world, the patch makes the vector behavior in test align with std::vector (both AST nodes are the same now). Reviewers: ilya-biryukov, alexfh Reviewed By: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41852 llvm-svn: 322822
* [clangd] Use fuzzy match to select top N index results.Sam McCall2018-01-182-13/+25
| | | | | | | | | | | | | | | | | | | | | Summary: This makes performance slower but more predictable (it always processes every symbol). We need to find ways to make this fast, possibly by precomputing short queries or capping the number of scored results. But our current approach is too naive. It also no longer returns results in a "good" order. In fact it's pathological: the top N results are ranked from worst to best. Indexes aren't responsible for ranking and MergedIndex can't do a good job, so I'm pleased that this will make any hidden assumptions we have more noticeable :-) Reviewers: hokein Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D42060 llvm-svn: 322821
* [X86] Use vmovdqu64/vmovdqa64 for unmasked integer vector stores for ↵Craig Topper2018-01-1810-57/+63
| | | | | | | | consistency with loads. Previously we used 64 for vXi64 stores and 32 for everything else. This change uses 64 for everything just like do for loads. llvm-svn: 322820
* [X86] Remove isel patterns for using unmasked vmovdqa32/vmovdqu32 for ↵Craig Topper2018-01-1817-115/+116
| | | | | | | | integer vector loads. These patterns were just looking for a vXi64 bitcasted to vXi32, but there is no advantage to using vmovdqa32 over vmovdqa64. llvm-svn: 322819
* Revert "Add a value_type to ArrayRef."Clement Courbet2018-01-182-9/+0
| | | | | | | | clang OOMs on arm. This reverts commit a272b2f2ef63f7f602c9ef4d9e10dc4eb9f00aa1. llvm-svn: 322818
* [X86] Remove windows line endings from a test file. NFCCraig Topper2018-01-181-93/+93
| | | | llvm-svn: 322817
* Revert rC322769: [RISCV] Propagate -mabi and -march values to GNU assembler.Hiroshi Inoue2018-01-183-27/+0
| | | | | | Temporarily revert rC322769 due to buildbot failurs. llvm-svn: 322816
* Add a lld test for a llvm fix.Rafael Espindola2018-01-181-0/+15
| | | | | | | This is tested in llvm, but it seems reasonable to have a small integration test in lld. llvm-svn: 322815
* Don't drop dso_local in LTO.Rafael Espindola2018-01-182-1/+17
| | | | | | | | | LTO sets dso_local as an optimization, so don't clear it. This avoid clearing it from undefined hidden symbols, which would then fail the verifier. llvm-svn: 322814
* Fix Scope::dump()Richard Trieu2018-01-181-64/+35
| | | | | | | | | The dump function for Scope only has 20 out of the 24 flags. Since it looped until no flags were left, having an unknown flag lead to an infinite loop. That loop has been changed to a single pass for each flag, plus an assert to alert if new flags are added. llvm-svn: 322813
* Update Google Benchmark libraryEric Fiselier2018-01-1877-2625/+4886
| | | | llvm-svn: 322812
* [DAGCombiner] Add a DAG combine to turn a splat build_vector where the splat ↵Craig Topper2018-01-182-8/+23
| | | | | | | | | | elemnt is a bitcast from a vector type into a concat_vector For example, a build_vector of i64 bitcasted from v2i32 can be turned into a concat_vectors of the v2i32 vectors with a bitcast to a vXi64 type Differential Revision: https://reviews.llvm.org/D42090 llvm-svn: 322811
* Fix most GCC test failures.Eric Fiselier2018-01-186-15/+61
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes almost all currently failing tests when using GCC ToT. The specific changes are: (A) Workaround gcc.gnu.org/PR83921 which rejects variables w/o initializers in constexpr contexts -- even when the variable is an empty class. This bug has been worked around at all callsites by adding an initializer. Additionally a new test, constexpr_init.pass.cpp, has been added to test that Clang doesn't suffer from these bugs. (B) Fix streambuf.assign/swap.pass.cpp. This test was never actually calling the swap method as intended. In fact, the swap function it intended to call was ill-formed when instantiated. GCC diagnosed this ill-formedness w/o needing an instantiation. (C) size_delete11.pass.cpp was fixed by adding c++2a to the list of unsupported dialects. llvm-svn: 322810
* [analyzer] a few helper methods for getting and comparing symbolic valuesGeorge Karpenkov2018-01-185-2/+42
| | | | | | | | API calls should express intent, and that's a motivation behind this patch. Differential Revision: https://reviews.llvm.org/D42218 llvm-svn: 322809
* Update for llvm change.Rafael Espindola2018-01-189-9/+9
| | | | llvm-svn: 322808
* Update for llvm change.Rafael Espindola2018-01-182-2/+2
| | | | llvm-svn: 322807
* Make GlobalValues with non-default visibilility dso_local.Rafael Espindola2018-01-1820-61/+70
| | | | | | | | | | | | This is similar to r322317, but for visibility. It is not as neat because we have to special case extern_weak. The idea is the same as the previous change, make the transition to explicit dso_local easier for the frontends. With this they only have to add dso_local to symbols where we need some external information to decide if it is dso_local (like it being part of an ELF executable). llvm-svn: 322806
* GlobalISel: Make MachineCSE runnable in the middle of the GlobalISelJustin Bogner2018-01-185-17/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, it is not possible to run MachineCSE in the middle of the GlobalISel pipeline. Being able to run generic optimizations between the core passes of GlobalISel was one of the goals of the new ISel framework. This is the first attempt to do it. The problem is that MachineCSE pass assumes all register operands have a register class, which, in GlobalISel context, won't be true until after the InstructionSelect pass. The reason for this behaviour is that before replacing one virtual register with another, MachineCSE pass (and most of the other optimization machine passes) must check if the virtual registers' constraints have a (sufficiently large) intersection, and constrain the resulting register appropriately if such intersection exists. GlobalISel extends the representation of such constraints from just a register class to a triple (low-level type, register bank, register class). This commit adds MachineRegisterInfo::constrainRegAttrs method that extends MachineRegisterInfo::constrainRegClass to such a triple. The idea is that going forward we should use: - RegisterBankInfo::constrainGenericRegister within GlobalISel's InstructionSelect pass - MachineRegisterInfo::constrainRegClass within SelectionDAG ISel - MachineRegisterInfo::constrainRegAttrs everywhere else regardless the target and instruction selector it uses. Patch by Roman Tereshin. Thanks! llvm-svn: 322805
* [analyzer] NFC: Remove unused method - BugReporter::RemoveUnneededCalls().Artem Dergachev2018-01-181-2/+0
| | | | | | | | Patch by Henry Wong! Differential Revision: https://reviews.llvm.org/D42106 llvm-svn: 322804
* [CMake] Make check-lldb work with LLDB_CODESIGN_IDENTITY=''Vedant Kumar2018-01-182-5/+23
| | | | | | | | | | | | On Darwin, if a test machine isn't set up for code-signing (see docs/code-signing.txt), running check-lldb should use the system debugserver instead of the unsigned one built in-tree. This makes it possible to run lldb's test suite without having code-signing set up, which is really convenient. Differential Revision: https://reviews.llvm.org/D42215 llvm-svn: 322803
* [WebAssembly] Remove duplicated RTLIB namesDerek Schuff2018-01-181-976/+394
| | | | | | | | | | | | | | Remove the tight coupling between llvm/CodeGenRuntimeLibcalls.def and the table of supported singatures for wasm. This will allow adding new libcalls without changing wasm's signature table. Also, some cleanup: Use ManagedStatics instead of const tables to avoid memory/binary bloat. Use a StringMap instead of a linear search for name lookup. Differential Revision: https://reviews.llvm.org/D35592 llvm-svn: 322802
* Handle parsing AT(ADDR(.foo-bar)).Rafael Espindola2018-01-182-0/+13
| | | | | | | | The problem we had with it is that anything inside an AT is an expression, so we failed to parse the section name because of the - in it. llvm-svn: 322801
* Fix the failure caused by r322773Volkan Keles2018-01-182-8/+6
| | | | | | Do not run GlobalISel if `-fast-isel=0 -global-isel=false`. llvm-svn: 322800
* [analyzer] NFC: RetainCount: Protect from dumping raw region to path notes.Artem Dergachev2018-01-181-2/+8
| | | | | | | | | | | | | | | | | | MemRegion::getString() is a wrapper around MemRegion::dump(), which is not user-friendly and should never be used for diagnostic messages. Actual cases where raw dumps were reaching the user were unintentionally fixed in r315736; these were noticed accidentally and shouldn't be reproducible anymore. For now RetainCountChecker only tracks pointers through variable regions, and for those dumps are "fine". However, we should still use a less dangerous method for producing our path notes. This patch replaces the dump with printing a variable name, asserting that this is indeed a variable. Differential Revision: https://reviews.llvm.org/D42015 llvm-svn: 322799
* [analyzer] NFC: Use "= default" for default ProgramPoint constructors.Artem Dergachev2018-01-181-26/+26
| | | | | | Differential Revision: https://reviews.llvm.org/D41935 llvm-svn: 322798
* [analyzer] operator new: Fix callback order for CXXNewExpr.Artem Dergachev2018-01-185-2/+114
| | | | | | | | | | | | | | | | PreStmt<CXXNewExpr> was never called. Additionally, under c++-allocator-inlining=true, PostStmt<CXXNewExpr> was called twice when the allocator was inlined: once after evaluating the new-expression itself, once after evaluating the allocator call which, for the lack of better options, uses the new-expression as the call site. This patch fixes both problems. Differential Revision: https://reviews.llvm.org/D41934 rdar://problem/12180598 llvm-svn: 322797
* [analyzer] operator new: Add a new ProgramPoint for check::NewAllocator.Artem Dergachev2018-01-185-56/+70
| | | | | | | | | | | | | | Add PostAllocatorCall program point to represent the moment in the analysis between the operator new() call and the constructor call. Pointer cast from "void *" to the correct object pointer type has already happened by this point. The new program point, unlike the previously used PostImplicitCall, contains a reference to the new-expression, which allows adding path diagnostics over it. Differential Revision: https://reviews.llvm.org/D41800 rdar://problem/12180598 llvm-svn: 322796
* [analyzer] Suppress "this" pointer escape during construction.Artem Dergachev2018-01-182-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pointer escape event notifies checkers that a pointer can no longer be reliably tracked by the analyzer. For example, if a pointer is passed into a function that has no body available, or written into a global, MallocChecker would no longer report memory leaks for such pointer. In case of operator new() under -analyzer-config c++-allocator-inlining=true, MallocChecker would start tracking the pointer allocated by operator new() only to immediately meet a pointer escape event notifying the checker that the pointer has escaped into a constructor (assuming that the body of the constructor is not available) and immediately stop tracking it. Even though it is theoretically possible for such constructor to put "this" into a global container that would later be freed, we prefer to preserve the old behavior of MallocChecker, i.e. a memory leak warning, in order to be able to find any memory leaks in C++ at all. In fact, c++-allocator-inlining *reduces* the amount of false positives coming from this-pointers escaping in constructors, because it'd be able to inline constructors in some cases. With other checkers working similarly, we simply suppress the escape event for this-value of the constructor, regardless of analyzer options. Differential Revision: https://reviews.llvm.org/D41797 rdar://problem/12180598 llvm-svn: 322795
* libcxx: Define set_unexpected, _get_unexpected and __uncaught_exceptions ↵Peter Collingbourne2018-01-181-3/+3
| | | | | | | | | | | | without dllimport. It turns out that the MSVC headers define these functions without dllimport even when compiling with /MD. This change fixes the resulting compile-time error. Differential Revision: https://reviews.llvm.org/D42207 llvm-svn: 322794
* [Sanitizers] Changes in Hwasan allocator missed in D42198.Alex Shlyapnikov2018-01-181-5/+5
| | | | | | Converting a few failure handler calls missed in D42198. llvm-svn: 322793
* Use an enum value instead of a string.Rafael Espindola2018-01-184-24/+18
| | | | | | | | The old StringSwitch use was also broken. It assumed that a StringSwitch returns Optional<T> instead of T and was missing a .Default. llvm-svn: 322792
* [analyzer] operator new: Fix path diagnostics around the operator call.Artem Dergachev2018-01-182-5/+11
| | | | | | | | | | | | Implements finding appropriate source locations for intermediate diagnostic pieces in path-sensitive bug reports that need to descend into an inlined operator new() call that was called via new-expression. The diagnostics have worked correctly when operator new() was called "directly". Differential Revision: https://reviews.llvm.org/D41409 rdar://problem/12180598 llvm-svn: 322791
* [analyzer] NFC: operator new: Fix new(nothrow) definition in tests.Artem Dergachev2018-01-181-7/+4
| | | | | | | | | Fix the const qualifier so that the operator defined in the tests indeed does override the default global nothrow version of new. Differential Revision: https://reviews.llvm.org/D41408 llvm-svn: 322790
* [MachineOutliner] Add DISubprograms to outlined functions.Jessica Paquette2018-01-182-2/+266
| | | | | | | | | | Before, it wasn't possible to get backtraces inside outlined functions. This commit adds DISubprograms to the IR functions created by the outliner which makes this possible. Also attached a test that ensures that the produced debug information is correct. This is useful to users that want to debug outlined code. llvm-svn: 322789
* [CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64Reid Kleckner2018-01-178-191/+138
| | | | | | | | | | | Every known PE COFF target emits /EXPORT: linker flags into a .drective section. The AsmPrinter should handle this. While we're at it, use global_values() and emit each export flag with its own .ascii directive. This should make the .s file output more readable. llvm-svn: 322788
* [analyzer] operator new: Add a new checker callback, check::NewAllocator.Artem Dergachev2018-01-179-39/+198
| | | | | | | | | | | | | | | The callback runs after operator new() and before the construction and allows the checker to access the casted return value of operator new() (in the sense of r322780) which is not available in the PostCall callback for the allocator call. Update MallocChecker to use the new callback instead of PostStmt<CXXNewExpr>, which gets called after the constructor. Differential Revision: https://reviews.llvm.org/D41406 rdar://problem/12180598 llvm-svn: 322787
* [LangRef] Clarify Varargs forwarding for musttail calls.Florian Hahn2018-01-171-3/+5
| | | | | | | | | | | | | This clarification was suggested by @efriedma in D41335, which uses this behavior to inline musttail calls with varargs. Reviewers: hfinkel, efriedma, rnk Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D41861 llvm-svn: 322786
* [hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.Evgeniy Stepanov2018-01-172-7/+50
| | | | | | | | | | | | | | | | Summary: -hwasan-mapping-offset defines the non-zero shadow base address. -hwasan-kernel disables calls to __hwasan_init in module constructors. Unlike ASan, -hwasan-kernel does not force callback instrumentation. This is controlled separately with -hwasan-instrument-with-calls. Reviewers: kcc Subscribers: srhines, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D42141 llvm-svn: 322785
OpenPOWER on IntegriCloud