summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ↵Raphael Isemann2019-09-301-4/+8
| | | | | | | | | | | | | | | | | | ExternalASTMerger Summary: The ExternalASTMerger should use the ASTImporterSharedState. This allows it to handle std::pair in LLDB (but the rest of libc++ is still work in progress). Reviewers: martong, shafik, a.sidorin Subscribers: rnkovacs, christof, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68140 llvm-svn: 373193
* Don't crash if a variable with a constexpr destructor has aRichard Smith2019-09-291-1/+2
| | | | | | value-dependent initializer. llvm-svn: 373173
* [clang-format] Reference qualifiers in member templates causing extra ↵Paul Hoad2019-09-291-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indentation. Summary: The following code ``` struct f { template <class T> void bar() && noexcept {} }; ``` will be formatted to the following with LLVM style, and `AlwaysBreakTemplateDeclarations: Yes` ``` struct f { template <class T> void bar() && noexcept {} }; ``` The indentation of the `void bar()` line is wrong. Reviewers: klimek, owenpan, krasimir, timwoj, MyDeveloperDay Reviewed By: klimek, MyDeveloperDay Subscribers: MyDeveloperDay, ilya-biryukov, llvm-commits, cfe-commits Patch By: AndWass Tags: #clang-format, #clang, #llvm Differential Revision: https://reviews.llvm.org/D68072 llvm-svn: 373165
* For now, disallow lifetime-extended temporaries with non-trivial (butRichard Smith2019-09-291-1/+9
| | | | | | | | | | | | constexpr) destructors from being used in the values of constexpr variables. The standard rules here are unclear at best, so rejecting the problematic cases seems prudent. Prior to this change, we would fail to run the destructors for these temporaries, even if they had side-effects, which is certainly not the right behavior. llvm-svn: 373161
* Fix checking for permitted results of constant expressions.Richard Smith2019-09-291-25/+54
| | | | | | | | | In the presence of mutable state, we need to check whether temporaries involved in a constant expression have permissible values at the end of the overall evaluation, rather than at the end of the evaluation of the initializer of the temporary. llvm-svn: 373160
* For P0784R7: compute whether a variable has constant destruction if itRichard Smith2019-09-2914-61/+158
| | | | | | | | | | has a constexpr destructor. For constexpr variables, reject if the variable does not have constant destruction. In all cases, do not emit runtime calls to the destructor for variables with constant destruction. llvm-svn: 373159
* SemaExpr - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-09-281-30/+30
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 373150
* Don't install example analyzer pluginsAaron Puchert2019-09-283-3/+3
| | | | | | | | | | | | Summary: Fixes PR43430. Reviewers: hintonda, NoQ, Szelethus, lebedev.ri Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D68172 llvm-svn: 373148
* [TimeProfiler] Fix "OptModule" section and add new "Backend" sectionsAnton Afanasyev2019-09-281-0/+3
| | | | | | | Remove unnecessary "OptModule" section. Add "PerFunctionPasses", "PerModulePasses" and "CodeGenPasses" sections under "Backend" section. llvm-svn: 373142
* For P0784R7: add support for explicit destructor calls andRichard Smith2019-09-272-30/+99
| | | | | | pseudo-destructor calls in constant evaluation. llvm-svn: 373122
* [Clang][OpenMP Offload] Create start/end symbols for the offloading entry ↵Sergey Dmitriev2019-09-272-20/+8
| | | | | | | | | | | | table with a help of a linker Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature. This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68070 llvm-svn: 373118
* [libTooling] Transformer: refine `SourceLocation` specified as anchor of ↵Yitzhak Mandelbaum2019-09-271-12/+21
| | | | | | | | | | | | | | | | | | | | | | | changes. Summary: Every change triggered by a rewrite rule is anchored at a particular location in the source code. This patch refines how that location is chosen and defines it as an explicit function so it can be shared by other Transformer implementations. This patch was inspired by a bug found by a clang tidy, wherein two changes were anchored at the same location (the expansion loc of the macro) resulting in the discarding of the second change. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66652 llvm-svn: 373093
* [clang] [AST] Treat "inline gnu_inline" the same way as "extern inline ↵Martin Storsjo2019-09-272-3/+8
| | | | | | | | | | | | | | | | | gnu_inline" in C++ mode This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl. GCC documents the gnu_inline attribute with "In C++, this attribute does not depend on extern in any way, but it still requires the inline keyword to enable its special behavior." The previous behaviour of gnu_inline in C++, without the extern keyword, can be traced back to the original commit that added support for gnu_inline, SVN r69045. Differential Revision: https://reviews.llvm.org/D67414 llvm-svn: 373078
* Revert r373056: [clang-format] Reference qualifiers in member templates ↵Ilya Biryukov2019-09-271-12/+4
| | | | | | | causing extra indentation Reason: this breaks unit tests. llvm-svn: 373059
* [clang-format] Reference qualifiers in member templates causing extra ↵Ilya Biryukov2019-09-271-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indentation The following code ``` struct f { template <class T> void bar() && noexcept {} }; ``` will be formatted to the following with LLVM style, and `AlwaysBreakTemplateDeclarations: Yes` ``` struct f { template <class T> void bar() && noexcept {} }; ``` The indentation of the `void bar()` line is wrong. Patch by Andreas Wass (AndWass)! Differential Revision: https://reviews.llvm.org/D68072 llvm-svn: 373056
* Fix the 'directory' field in DumpCompilationDatabase and add testHans Wennborg2019-09-271-1/+1
| | | | | | | This broke in r371027 due to a missing negation (llvm::sys::fs::current_path returns false on success). llvm-svn: 373049
* Fix use-after-free found in Clang's testsuite.Richard Smith2019-09-271-3/+6
| | | | | | | | | We need to discard all remaining cleanups if an earlier cleanup failed, otherwise we may try to rerun the remaining cleanups later, potentially after the scope containing the object is destroyed. (This can happen when checking a potential constant expression.) llvm-svn: 373042
* Revert r373034Nicholas Allegra2019-09-271-23/+20
| | | | | | It breaks the build on MSVC. llvm-svn: 373039
* For P0784R7: add support for new (std::nothrow).Richard Smith2019-09-273-13/+43
| | | | llvm-svn: 373037
* For P0784R7: Add support for dynamic allocation with new / delete duringRichard Smith2019-09-274-55/+480
| | | | | | constant evaluation. llvm-svn: 373036
* [Consumed][NFC] Refactor handleCall to take function argument list.Nicholas Allegra2019-09-261-20/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D67569 llvm-svn: 373034
* [OpenMP 5.0] Fix user-defined mapper lookup in semaMichael Kruse2019-09-261-3/+11
| | | | | | | | | | | | This patches fixes the case when a user-defined mapper is attached to the elements of an array, and to report error when a mapper is used for types other than struct, class, and union. Patch by Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D67978 llvm-svn: 373023
* Always rebuild a DeclRefExpr if its FoundDecl would change.Richard Smith2019-09-261-0/+1
| | | | | | Fixes a regression introduced by r369999. llvm-svn: 373022
* [OPENMP50]Emit warnings if the functions was defined/used before markedAlexey Bataev2019-09-261-4/+8
| | | | | | | | | declare variant. We can use the original function if it was used/emitted already. So, just use warnings for these cases, not errors. llvm-svn: 373010
* [clang-scan-deps] Allow continuation line backslashes followed by whitespaceAlex Lorenz2019-09-261-11/+22
| | | | | | | | | | | | in the dependency source minimizer Clang allows continuations that have whitespace between the backslash and the newline. This patch ensures that the dependency source minimizer can handle the whitespace between the backslash and the newline when looking for a line continuation. Differential Revision: https://reviews.llvm.org/D68052 llvm-svn: 373007
* Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."Artem Dergachev2019-09-261-5/+2
| | | | | | This reverts commit r372940 which was an overreaction to a flaky buildbot. llvm-svn: 373005
* Only pass -coverage-notes-file when emitting coverageReid Kleckner2019-09-261-36/+46
| | | | | | | | | | | | | | | | The only functional change here is that -coverage-notes-file is not passed to -cc1 in some situations. This code appears to be trying to put the gcno and gcda output next to the final object file, but it's doing that in a really convoluted way that needs to be re-examined. It looks for -c or -S in the original command, and then looks at the -o argument if present in order to handle the -fno-integrated-as case. However, this doesn't work if this is a link command with multiple inputs. I looked into fixing this, but the check-profile test suite has a lot of dependencies on this behavior, so I left it all alone. llvm-svn: 373004
* Move normalization of `\` in #includes from -fms-compatibility to ↵Reid Kleckner2019-09-261-15/+21
| | | | | | | | | -fms-extensions Handling backslashes in include paths in the implementation isn't non-conforming. llvm-svn: 372999
* [analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.Artem Dergachev2019-09-261-2/+5
| | | | llvm-svn: 372945
* [analyzer] Avoid small vectors of non-default-constructibles.Artem Dergachev2019-09-261-1/+1
| | | | | | Unconfuses certain compilers. llvm-svn: 372942
* [clang-format] Add SortPriority fields to fix -Wmissing-field-initializers ↵Fangrui Song2019-09-261-5/+7
| | | | | | after D64695/r372919 llvm-svn: 372939
* [libTooling] Add `run` combinator to Stencils.Yitzhak Mandelbaum2019-09-261-0/+22
| | | | | | | | | | | | | | | | Summary: This revision adds `run`, a StencilPart that runs a user-defined function that computes a result over `MatchFinder::MatchResult`. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67969 llvm-svn: 372936
* Simplify -fms-compatibility include lookup logic, NFCReid Kleckner2019-09-251-10/+11
| | | | | | | | | | | This include search logic has an extra parameter to deal with Windows includes with backslashes, which get normalized to forward slashes on non-Windows under -fms-compatibility. Hoist the conditional operator out of LookupHeaderIncludeOrImport and pass the result in instead of repeating the ?: expression everywhere. llvm-svn: 372926
* [clang-format] Modified SortIncludes and IncludeCategories to priority for ↵Paul Hoad2019-09-253-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | sorting #includes within the Group Category. Summary: This new Style rule is made as a part of adding support for NetBSD KNF in clang-format. NetBSD have it's own priority of includes which should be followed while formatting NetBSD code. This style sorts the Cpp Includes according to the priorities of NetBSD, as mentioned in the [Style Guide](http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&content-type=text/x-cvsweb-markup) The working of this Style rule shown below: **Configuration:** This revision introduces a new field under IncludeCategories named `SortPriority` which defines the priority of ordering the `#includes` and the `Priority` will define the categories for grouping the `#include blocks`. Reviewers: cfe-commits, mgorny, christos, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: lebedev.ri, rdwampler, christos, mgorny, krytarowski Patch By: Manikishan Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D64695 llvm-svn: 372919
* [OPENMP50]Parsing/sema support for 'implementation/vendor' contextAlexey Bataev2019-09-253-18/+100
| | | | | | | | | selector. Added basic parsing/semantic support for 'implementation={vendor(<vendor>)}' context selector. llvm-svn: 372917
* [Mangle] Add flag to asm labels to disable '\01' prefixingVedant Kumar2019-09-252-10/+17
| | | | | | | | | | | | | | LLDB synthesizes decls using asm labels. These decls cannot have a mangle different than the one specified in the label name. I.e., the '\01' prefix should not be added. Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS. rdar://45827323 Differential Revision: https://reviews.llvm.org/D67774 llvm-svn: 372903
* [CUDA][HIP] Enable kernel function return type deduction.Michael Liao2019-09-254-2/+21
| | | | | | | | | | | | | | | | | Summary: - Even though only `void` is still accepted as the deduced return type, enabling deduction/instantiation on the return type allows more consistent coding. Reviewers: tra, jlebar Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D68031 llvm-svn: 372898
* Re-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-251-8/+19
| | | | | | | | | | Decl::printQualifiedName Reverted in r372880 due to the test failure. Also contains a fix that adjusts printQualifiedName to return the same results as before in case of anonymous function locals and parameters. llvm-svn: 372889
* Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-251-14/+8
| | | | | | | Decl::printQualifiedName Reason: causes a test failure, will investigate and re-land with a fix. llvm-svn: 372880
* [libTooling] Introduce the MatchConsumer abstractionYitzhak Mandelbaum2019-09-251-8/+0
| | | | | | | | | | | | | | | | | Summary: This revision introduces a separate (small) library for the `MatchConsumer` abstraction: computations over AST match results. This abstraction is central to the Transformer framework, and there deserves being defined explicitly. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67961 llvm-svn: 372870
* [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-251-8/+14
| | | | | | | | | | | | | | | | | | | | | Decl::printQualifiedName Summary: To be used in clangd, e.g. in D66647. Currently the alternative to this function is doing string manipulation on results of `printQualifiedName`, which is hard-to-impossible to get right in presence of template arguments. Reviewers: kadircet, aaron.ballman Reviewed By: kadircet, aaron.ballman Subscribers: aaron.ballman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67825 llvm-svn: 372863
* Revert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template ↵Hans Wennborg2019-09-251-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specializations are inline"" This work-around was necessary to handle standard library headers in Visual Studio 2019 16.2. Now that 16.3 has shipped to stable, we can remove it. > Re-commit r363191 "[MS] Pretend constexpr variable template specializations are inline" > > While the next Visual Studio update (16.3) will fix this issue, that hasn't > shipped yet. Until then Clang wouldn't work with MSVC's headers which seems > unfortunate. Let's keep this in until VS 16.3 ships. (See also PR42843.) > >> Fixes link errors with clang and the latest Visual C++ 14.21.27702 >> headers, which was reported as PR42027. >> >> I chose to intentionally make these things linkonce_odr, i.e. >> discardable, so that we don't emit definitions of these things in every >> translation unit that includes STL headers. >> >> Note that this is *not* what MSVC does: MSVC has not yet implemented C++ >> DR2387, so they emit fully specialized constexpr variable templates with >> static / internal linkage. >> >> Reviewers: rsmith >> >> Differential Revision: https://reviews.llvm.org/D63175 llvm-svn: 372844
* [OpenCL] Add image query builtin functionsSven van Haastregt2019-09-251-0/+25
| | | | | | | | | | Add the image query builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D67713 llvm-svn: 372833
* [Driver] Always use -z separate-loadable-segments with lld on FuchsiaFangrui Song2019-09-251-1/+1
| | | | | | | | | | The option was added to lld in D67481/372807. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D68009 llvm-svn: 372814
* [x86] Adding support for some missing intrinsics: _castf32_u32, ↵Pengfei Wang2019-09-251-0/+68
| | | | | | | | | | | | | | | | | | | | _castf64_u64, _castu32_f32, _castu64_f64 Summary: Adding support for some missing intrinsics: _castf32_u32, _castf64_u64, _castu32_f32, _castu64_f64 Reviewers: craig.topper, LuoYuanke, RKSimon, pengfei Reviewed By: RKSimon Subscribers: llvm-commits Patch by yubing (Bing Yu) Differential Revision: https://reviews.llvm.org/D67212 llvm-svn: 372802
* [NFC] Strenghten preconditions for warningDavid Bolvansky2019-09-241-1/+2
| | | | llvm-svn: 372775
* [HIP] Support new kernel launching APIYaxun Liu2019-09-244-7/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D67947 llvm-svn: 372773
* [Diagnostics] Handle tautological left shifts in boolean context David Bolvansky2019-09-241-5/+14
| | | | llvm-svn: 372749
* [Diagnostics] Do not diagnose unsigned shifts in boolean context ↵David Bolvansky2019-09-241-26/+21
| | | | | | | | (-Wint-in-bool-context) I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts. llvm-svn: 372708
* Revert "[static analyzer] Define __clang_analyzer__ macro in driver"Jan Korous2019-09-242-3/+5
| | | | | | This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187. llvm-svn: 372687
OpenPOWER on IntegriCloud