summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Improved check for the linear dependency in the non-rectangularAlexey Bataev2019-04-253-6/+46
| | | | | | | | | loop nests. Added a checks that the initializer/condition expressions depend only only of the single previous loop iteration variable. llvm-svn: 359200
* [OPENMP][AARCH64]Fix the test for declare simd, NFC.Alexey Bataev2019-04-251-4/+4
| | | | | | | Renamed function a01 in the test to fix possible problems with the git hash match during testing. llvm-svn: 359193
* [Testing] Move clangd::Annotations to llvm testing supportIlya Biryukov2019-04-252-28/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: Annotations allow writing nice-looking unit test code when one needs access to locations from the source code, e.g. running code completion at particular offsets in a file. See comments in Annotations.cpp for more details on the API. Also got rid of a duplicate annotations parsing code in clang's code complete tests. Reviewers: gribozavr, sammccall Reviewed By: gribozavr Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D59814 llvm-svn: 359179
* [NFC] test commit removing excess lineNikolai Kosjar2019-04-251-1/+0
| | | | llvm-svn: 359172
* [PowerPC][NFC]Update licence to Apache 2Jinsong Ji2019-04-251-17/+3
| | | | llvm-svn: 359164
* Fix typo in comment in r312851.Richard Smith2019-04-251-2/+2
| | | | | | Thanks to Nico Weber for pointing this out! llvm-svn: 359158
* PR41427: This has apparently been fixed already, just add a regressionRichard Smith2019-04-241-0/+17
| | | | | | test. llvm-svn: 359155
* [codeview] Fix symbol names for dynamic initializers and atexit stubsReid Kleckner2019-04-245-15/+120
| | | | | | | | | | | | | | | | Summary: Add a new variant to GlobalDecl for these so that we can detect them more easily during debug info emission and handle them appropriately. Reviewers: rsmith, rjmccall, jyu2 Subscribers: aprantl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60930 llvm-svn: 359148
* [OPENMP]Initial support for non-rectangular loop nest.Alexey Bataev2019-04-243-14/+105
| | | | | | | Added basic semantic analysis for the non-rectangular loop nests for OpenMP 5.0 support. llvm-svn: 359132
* clang-cl: List valid values for /std: in /? outputNico Weber2019-04-241-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61029 llvm-svn: 359107
* Use llvm::stable_sortFangrui Song2019-04-2420-84/+58
| | | | llvm-svn: 359098
* Add 'REQUIRES: shell' to verbose-output-quoting.cHans Wennborg2019-04-241-0/+1
| | | | | | The lit shell couldn't handle these run lines. llvm-svn: 359081
* [clang][HeaderSuggestion] Handle the case of dotdot with an absolute pathKadir Cetinkaya2019-04-242-4/+10
| | | | | | | | | | | | | | | | | Summary: Include insertion in clangd was inserting absolute paths when the include directory was an absolute path with a double dot. This patch makes sure double dots are handled both with absolute and relative paths. Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60873 llvm-svn: 359078
* Fix unquoted spaces in args in clang --verbose outputHans Wennborg2019-04-242-1/+10
| | | | | | | | | | | The behaviour of not quoting spaces appears to have been introduced by mistake in r190620. Patch by Brad Moody! Differential revision: https://reviews.llvm.org/D60997 llvm-svn: 359077
* Revert r359048: C++ DR2387: a variable template declared wthiIlya Biryukov2019-04-2413-14404/+14242
| | | | | | | | | | | | | The change breaks libc++ with the follwing error: In file included from valarray:4: .../include/c++/v1/valarray:1062:60: error: explicit instantiation declaration of 'valarray<_Tp>' with internal linkage _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t)) ^ .../include/c++/v1/valarray:1063:60: error: explicit instantiation declaration of '~valarray<_Tp>' with internal linkage _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::~valarray()) llvm-svn: 359076
* [clang][HeaderSearch] Make sure there are no backslashes in suggestedPathKadir Cetinkaya2019-04-243-5/+16
| | | | | | | | Reviewers: sammccall Differential Revision: https://reviews.llvm.org/D60995 llvm-svn: 359075
* [Builtins] Implement __builtin_is_constant_evaluated for use in C++2aEric Fiselier2019-04-247-2/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements `__builtin_is_constant_evaluated` as specifier by [P0595R2](https://wg21.link/p0595r2). It is built on the back of Bill Wendling's work for `__builtin_constant_p()`. More tests to come, but early feedback is appreciated. I plan to implement warnings for common mis-usages like those belowe in a following patch: ``` void foo(int x) { if constexpr (std::is_constant_evaluated())) { // condition is always `true`. Should use plain `if` instead. foo_constexpr(x); } else { foo_runtime(x); } } ``` Reviewers: rsmith, MaskRay, bruno, void Reviewed By: rsmith Subscribers: dexonsmith, zoecarver, fdeazeve, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D55500 llvm-svn: 359067
* Revert r350917 "[Sema] If CheckPlaceholderExpr rewrites the initializerRichard Smith2019-04-246-29/+33
| | | | | | | | | | | | | | of an auto" This commit changed the initializer expression passed into initialization (stripping off an enclosing pair of parentheses or braces) and subtly changing the meaning of programs, typically by inserting bogus calls to copy constructors. See the added testcase in test/SemaCXX/cxx1y-init-captures.cpp for an example of the breakage. llvm-svn: 359066
* Fix interactions between __builtin_constant_p and constexpr to matchRichard Smith2019-04-244-29/+112
| | | | | | | | | | | | | | | | | | current trunk GCC. GCC permits information from outside the operand of __builtin_constant_p (but in the same constant evaluation context) to be used within that operand; clang now does so too. A few other minor deviations from GCC's behavior showed up in my testing and are also fixed (matching GCC): * Clang now supports nullptr_t as the argument type for __builtin_constant_p * Clang now returns true from __builtin_constant_p if called with a null pointer * Clang now returns true from __builtin_constant_p if called with an integer cast to pointer type llvm-svn: 359059
* Fix test after r359009 on platforms where %ms_abi_triple is 32-bitNico Weber2019-04-241-1/+1
| | | | llvm-svn: 359057
* Fixes in creduce-clang-crash.py for clang crash message parsing and reading ↵Amy Huang2019-04-241-4/+9
| | | | | | the command from the repro script. llvm-svn: 359054
* Add missing diagnostic for anonymous struct/union definitions that don'tRichard Smith2019-04-2412-27/+40
| | | | | | introduce any names. llvm-svn: 359051
* Improve -Wuninitialized warning under ARC for block variables that areAkira Hatanaka2019-04-233-6/+13
| | | | | | | | | | | recursively captured. Under ARC, a block variable is zero-initialized when it is recursively captured by the block literal initializer. rdar://problem/11022762 llvm-svn: 359049
* C++ DR2387: a variable template declared wtih (or instantiated with) aRichard Smith2019-04-2313-14242/+14404
| | | | | | | const-qualified type is not implicitly given internal linkage. But a variable template declared 'static' is. llvm-svn: 359048
* Move setTargetAttributes after setGVProperties in SetFunctionAttributesScott Linder2019-04-232-5/+56
| | | | | | | | | | | AMDGPU currently relies on global properties being set before setTargetProperties is called. Existing targets like MIPS which rely on setTargetProperties do not rely on the current behavior, so this patch moves the call later in SetFunctionAttributes. Differential Revision: https://reviews.llvm.org/D60967 llvm-svn: 359039
* [analyzer] Fix macro names in diagnostics within bigger macros.Artem Dergachev2019-04-232-37/+41
| | | | | | | | | If macro "CHECK_X(x)" expands to something like "if (x != NULL) ...", the "Assuming..." note no longer says "Assuming 'x' is equal to CHECK_X". Differential Revision: https://reviews.llvm.org/D59121 llvm-svn: 359037
* Re-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."Artem Dergachev2019-04-233-2/+25
| | | | | | | | | It now comes with a follow-up fix for the clients of this API in clangd and clang-tidy. Differential Revision: https://reviews.llvm.org/D59977 llvm-svn: 359035
* Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)Amy Huang2019-04-231-0/+1
| | | | | | | | | buildbot failure. This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and c774f687b6880484a126ed3e3d737e74c926f0ae. llvm-svn: 359034
* [clang-format] Fix bug in reflow of block comments containing CR/LFOwen Pan2019-04-235-5/+14
| | | | | | | | Fix PR36119 Differential Revision: https://reviews.llvm.org/D60996 llvm-svn: 359029
* [ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PMTeresa Johnson2019-04-233-6/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: The opt level was not being passed down to the ThinLTO backend when invoked via clang (for distributed ThinLTO). This exposed an issue where the new PM was asserting if the Thin or regular LTO backend pipelines were invoked with -O0 (not a new issue, could be provoked by invoking in-process *LTO backends via linker using new PM and -O0). Fix this similar to the old PM where -O0 only does the necessary lowering of type metadata (WPD and LowerTypeTest passes) and then quits, rather than asserting. Reviewers: xur Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61022 llvm-svn: 359025
* [APSInt][OpenMP] Fix isNegative, etc. for unsigned typesJoel E. Denny2019-04-2362-124/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, APSInt inherits APInt::isNegative, which merely checks the sign bit without regard to whether the type is actually signed. isNonNegative and isStrictlyPositive call isNegative and so are also affected. This patch adjusts APSInt to override isNegative, isNonNegative, and isStrictlyPositive with implementations that consider whether the type is signed. A large set of Clang OpenMP tests are affected. Without this patch, these tests assume that `true` is not a valid argument for clauses like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but not APSInt::isStrictlyPositive. This patch adjusts those tests to assume `true` should be accepted. This patch also adds tests revealing various other similar fixes due to APSInt::isNegative calls in Clang's ExprConstant.cpp and SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object size based on `alloc_size`, `<<` and `>>` shift count validation, and OpenMP array section validation. Reviewed By: lebedev.ri, ABataev, hfinkel Differential Revision: https://reviews.llvm.org/D59712 llvm-svn: 359012
* MS ABI: Support mangling op<=> now that MSVC 2019 has a manglingNico Weber2019-04-232-11/+8
| | | | llvm-svn: 359009
* Fix "-Wimplicit-fallthrough" warning. NFCI.Simon Pilgrim2019-04-231-0/+1
| | | | llvm-svn: 358973
* [Analyzer] Second fix for last commit for IteratorCheckerAdam Balogh2019-04-231-1/+1
| | | | | | | A variable was redeclared instead of assigned in an internal block, leaving the original uninitialized. This is fixed now. llvm-svn: 358971
* [analyzer][CrossTU] Extend CTU to VarDecls with initializerRafael Stahl2019-04-2310-87/+335
| | | | | | | | | | | | | | | | | | | | | | Summary: The existing CTU mechanism imports `FunctionDecl`s where the definition is available in another TU. This patch extends that to VarDecls, to bind more constants. - Add VarDecl importing functionality to CrossTranslationUnitContext - Import Decls while traversing them in AnalysisConsumer - Add VarDecls to CTU external mappings generator - Name changes from "external function map" to "external definition map" Reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov, martong Reviewed By: xazax.hun Subscribers: Charusso, baloghadamsoftware, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, george.karpenkov, mgorny, whisperity, szepet, rnkovacs, a.sidorin, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D46421 llvm-svn: 358968
* [Analyzer] Fix for previous commitAdam Balogh2019-04-231-2/+2
| | | | | | | | A compilation warning was in my previous commit which broke the buildbot because it is using `-Werror` for compilation. This patch fixes this issue. llvm-svn: 358955
* [PowerPC] Fix test with -fno-discard-value-names after rC358949Fangrui Song2019-04-231-4/+4
| | | | | | For the clang driver, -DLLVM_ENABLE_ASSERTIONS=off builds default to discard value names. llvm-svn: 358953
* [Analyzer] Instead of recording comparisons in interator checkers do an ↵Adam Balogh2019-04-231-258/+126
| | | | | | | | | | | | | | | | | | eager state split Currently iterator checkers record comparison of iterator positions and process them for keeping track the distance between them (e.g. whether a position is the same as the end position). However this makes some processing unnecessarily complex and it is not needed at all: we only need to keep track between the abstract symbols stored in these iterator positions. This patch changes this and opens the path to comparisons to the begin() and end() symbols between the container (e.g. size, emptiness) which are stored as symbols, not iterator positions. The functionality of the checker is unchanged. Differential Revision: https://reviews.llvm.org/D53701 llvm-svn: 358951
* [PowerPC] [Clang] Port MMX intrinsics and basic test cases to PowerQiu Chaofan2019-04-238-1/+1606
| | | | | | | | | | | | | | Port mmintrin.h which include x86 MMX intrinsics implementation to PowerPC platform (using Altivec). To make the include process correct, PowerPC's toolchain class is overrided to insert new headers directory (named ppc_wrappers) into the path. Basic test cases for several intrinsic functions are added. The header is mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu. Reviewed By: Jinsong Ji Differential Revision: https://reviews.llvm.org/D59924 llvm-svn: 358949
* [analyzer] Unbreak body farms in presence of multiple declarations.Artem Dergachev2019-04-233-9/+17
| | | | | | | | | | | | | | When growing a body on a body farm, it's essential to use the same redeclaration of the function that's going to be used during analysis. Otherwise our ParmVarDecls won't match the ones that are used to identify argument regions. This boils down to trusting the reasoning in AnalysisDeclContext. We shouldn't canonicalize the declaration before farming the body because it makes us not obey the sophisticated decision-making process of AnalysisDeclContext. Differential Revision: https://reviews.llvm.org/D60899 llvm-svn: 358946
* [analyzer] PR41335: Fix crash when no-store event is in a body-farmed function.Artem Dergachev2019-04-233-6/+31
| | | | | | | | | | | Stuffing invalid source locations (such as those in functions produced by body farms) into path diagnostics causes crashes. Fix a typo in a nearby function name. Differential Revision: https://reviews.llvm.org/D60808 llvm-svn: 358945
* [analyzer] PR41269: Add a bit of C++ smart pointer modeling.Artem Dergachev2019-04-238-6/+160
| | | | | | | | | | | | | Implement cplusplus.SmartPtrModeling, a new checker that doesn't emit any warnings but models methods of smart pointers more precisely. For now the only thing it does is make `(bool) P` return false when `P` is a freshly moved pointer. This addresses a false positive in the use-after-move-checker. Differential Revision: https://reviews.llvm.org/D60796 llvm-svn: 358944
* [CMake] Replace the sanitizer support in runtimes build with multilibPetr Hosek2019-04-221-2/+12
| | | | | | | | | | | | | | | This is a more generic solution; while the sanitizer support can be used only for sanitizer instrumented builds, the multilib support can be used to build other variants such as noexcept which is what we would like to use in Fuchsia. The name CMake target name uses the target name, same as for the regular runtimes build and the name of the multilib, concatenated with '+'. The libraries are installed in a subdirectory named after the multilib. Differential Revision: https://reviews.llvm.org/D60926 llvm-svn: 358935
* [c++2a] Implement semantic restrictions for 'export' declarations.Richard Smith2019-04-2219-59/+444
| | | | llvm-svn: 358932
* [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygenJoel E. Denny2019-04-221-1/+27
| | | | | | | | | | | Previously, it was only documented by `-cc1 -help`, so people weren't aware of it, as discussed in D60732. Reviewed By: Charusso, NoQ Differential Revision: https://reviews.llvm.org/D60845 llvm-svn: 358917
* [ASTMatchers] Introduce Objective-C matchers `isClassMessage`, ↵Ben Hamilton2019-04-224-2/+145
| | | | | | | | | | | | | | | | | | | | | | | `isClassMethod`, and `isInstanceMethod` Summary: isClassMessage is an equivalent to isInstanceMessage for ObjCMessageExpr, but matches message expressions to classes. isClassMethod and isInstanceMethod check whether a method declaration (or definition) is for a class method or instance method (respectively). Contributed by @mywman! Reviewers: benhamilton, klimek, mwyman Reviewed By: benhamilton, mwyman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60920 llvm-svn: 358904
* [sema][objc] Minor refactor to OverrideSearch. NFCI.Matt Davis2019-04-221-26/+22
| | | | | | | | | | | | | | | | | | Summary: * Removed a member that was only used during construction. * Use range-based for iteration when accessing the result of the search. * Require an `ObjCMethodDecl` reference upon construction of an * Constify. Reviewers: rjmccall Reviewed By: rjmccall Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D60850 llvm-svn: 358898
* [Sema] ADL: Associated namespaces for class types and enumeration types (CWG ↵Bruno Ricci2019-04-223-32/+96
| | | | | | | | | | | | | | | | | | | 1691) CWG 1691 changed the definition of the namespaces associated with a class type or enumeration type. For a class type, the associated namespaces are the innermost enclosing namespaces of the associated classes. For an enumeration type, the associated namespace is the innermost enclosing namespace of its declaration. This also fixes CWG 1690 and CWG 1692. Differential Revision: https://reviews.llvm.org/D60573 Reviewed By: rjmccall, rsmith llvm-svn: 358882
* [Sema][NFC] Add more tests for the behavior of argument-dependent name lookupBruno Ricci2019-04-225-0/+565
| | | | | | | | | | | | | | | | | | | | | | | The goal here is to exercise each rule in [basic.lookup.argdep] at least once. These new tests expose what I believe are 2 issues: 1. CWG 1691 needs to be implemented (p2: [...] Its associated namespaces are the innermost enclosing namespaces of its associated classes [...]) The corresponding tests are adl_class_type::X2 and adl_class_type::X5. 2. The end of paragraph 2 ([...] Additionally, if the aforementioned set of overloaded functions is named with a template-id, its associated classes and namespaces also include those of its type template-arguments and its template template-arguments.) is not implemented. Closely related, the restriction on non-dependent parameter types in this same paragraph needs to be removed. The corresponding tests are in adl_overload_set (both issues are from CWG 997). Differential Revision: https://reviews.llvm.org/D60570 Reviewed By: riccibruno, Quuxplusone llvm-svn: 358881
* [analyzer][www] Moving MoveChecker out of alpha is no longer an open project.Kristof Umann2019-04-221-10/+0
| | | | llvm-svn: 358877
OpenPOWER on IntegriCloud