summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [libTooling] Transformer: refine `SourceLocation` specified as anchor of ↵Yitzhak Mandelbaum2019-09-273-12/+78
| | | | | | | | | | | | | | | | | | | | | | | 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
* [OpenCL] Pass LangOptions as const refSven van Haastregt2019-09-271-3/+3
| | | | llvm-svn: 373088
* [clang] [AST] Treat "inline gnu_inline" the same way as "extern inline ↵Martin Storsjo2019-09-278-9/+31
| | | | | | | | | | | | | | | | | 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-272-47/+4
| | | | | | | causing extra indentation Reason: this breaks unit tests. llvm-svn: 373059
* [clang-format] Reference qualifiers in member templates causing extra ↵Ilya Biryukov2019-09-272-4/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-272-3/+3
| | | | | | | This broke in r371027 due to a missing negation (llvm::sys::fs::current_path returns false on success). llvm-svn: 373049
* [test] Use %clang_cc1 instead of %clang -cc1Fangrui Song2019-09-279-12/+12
| | | | llvm-svn: 373043
* 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-272-25/+21
| | | | | | It breaks the build on MSVC. llvm-svn: 373039
* For P0784R7: add support for new (std::nothrow).Richard Smith2019-09-275-13/+62
| | | | llvm-svn: 373037
* For P0784R7: Add support for dynamic allocation with new / delete duringRichard Smith2019-09-2710-73/+901
| | | | | | constant evaluation. llvm-svn: 373036
* [Consumed][NFC] Refactor handleCall to take function argument list.Nicholas Allegra2019-09-262-21/+25
| | | | | | Differential Revision: https://reviews.llvm.org/D67569 llvm-svn: 373034
* [OpenMP 5.0] Fix user-defined mapper lookup in semaMichael Kruse2019-09-263-9/+33
| | | | | | | | | | | | 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-262-0/+17
| | | | | | Fixes a regression introduced by r369999. llvm-svn: 373022
* [OPENMP50]Emit warnings if the functions was defined/used before markedAlexey Bataev2019-09-265-13/+22
| | | | | | | | | 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-262-15/+37
| | | | | | | | | | | | 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-262-36/+52
| | | | | | | | | | | | | | | | 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-263-23/+27
| | | | | | | | | -fms-extensions Handling backslashes in include paths in the implementation isn't non-conforming. llvm-svn: 372999
* Un-XFAIL coverage_no_integrated_as.c test on WindowsReid Kleckner2019-09-261-7/+6
| | | | | | | | | | | You can't use -fno-integrated-as for *-msvc triples because no usable standalone assembler exists. Perhaps we could teach clang to emit a .s and then reinvoke itself, but that's a bit silly. Anyway, fix the test by using an Itanium ABI triple, which will become mingw, which will assume gnu as is a usable assembler. llvm-svn: 372994
* [OpenCL] Add -Wconversion to fdeclare-opencl-builtins testSven van Haastregt2019-09-261-6/+7
| | | | | | | | | | | Add the -Wconversion -Werror options to check no unexpected conversion is done. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D67714 llvm-svn: 372975
* [Testing] Workaround libcxx bug when OS is "none"David Zarzycki2019-09-262-16/+16
| | | | | | | | | | | | If clang is configured to use libcxx as the default C++ standard library, then using "none" for the OS in the target triple will cause libcxx to #error needlessly. Passing -nostdinc++ is a workaround for these tests. See also: https://reviews.llvm.org/D68075 Please note: this workaround will probably exist for a few years until the installed version of libcxx is updated. llvm-svn: 372949
* [analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.Artem Dergachev2019-09-261-2/+5
| | | | llvm-svn: 372945
* [SortIncludesTest] Add SortPriority fields to fix ↵Mikael Holmen2019-09-261-2/+2
| | | | | | -Wmissing-field-initializers after D64695/r372919 llvm-svn: 372944
* [analyzer] Avoid small vectors of non-default-constructibles.Artem Dergachev2019-09-262-2/+2
| | | | | | Unconfuses certain compilers. llvm-svn: 372942
* [clang-format] Add SortPriority fields to fix -Wmissing-field-initializers ↵Fangrui Song2019-09-262-6/+8
| | | | | | after D64695/r372919 llvm-svn: 372939
* [libTooling] Add `run` combinator to Stencils.Yitzhak Mandelbaum2019-09-263-0/+45
| | | | | | | | | | | | | | | | 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-252-11/+12
| | | | | | | | | | | 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
* Fix memory leak in DeclTest.Evgeniy Stepanov2019-09-251-1/+2
| | | | | | | | | | | | Fixes a leak introduced in r372903, detected on the ASan bot. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35430/steps/check-clang%20asan/logs/stdio Direct leak of 192 byte(s) in 1 object(s) allocated from: #0 0x561d88 in operator new(unsigned long) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:105 #1 0x1a48779 in clang::ItaniumMangleContext::create(clang::ASTContext&, clang::DiagnosticsEngine&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/AST/ItaniumMangle.cpp:5134:10 #2 0xdff000 in Decl_AsmLabelAttr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/unittests/AST/DeclTest.cpp:97:23 llvm-svn: 372925
* [clang-format] Modified SortIncludes and IncludeCategories to priority for ↵Paul Hoad2019-09-257-4/+108
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTEDYitzhak Mandelbaum2019-09-251-21/+4
| | | | | | | | | | | | | | | | Summary: Currently, some tests use homegrown matchers to handle `llvm::Expected` values. This revision standardizes on EXPECT_THAT_EXPECTED and `HasValue`. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67973 llvm-svn: 372918
* [OPENMP50]Parsing/sema support for 'implementation/vendor' contextAlexey Bataev2019-09-2512-57/+237
| | | | | | | | | 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-255-12/+108
| | | | | | | | | | | | | | 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-255-2/+65
| | | | | | | | | | | | | | | | | 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-253-20/+85
| | | | | | | | | | 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
* [NFC] Fix typo in `getPreviousDecl` comment.Yitzhak Mandelbaum2019-09-251-1/+1
| | | | llvm-svn: 372884
* Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-253-80/+20
| | | | | | | 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-254-20/+62
| | | | | | | | | | | | | | | | | 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-253-20/+80
| | | | | | | | | | | | | | | | | | | | | 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
* Add a release note for r372844Hans Wennborg2019-09-251-1/+12
| | | | llvm-svn: 372846
* Revert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template ↵Hans Wennborg2019-09-252-30/+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-252-0/+29
| | | | | | | | | | 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-252-2/+2
| | | | | | | | | | 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-252-0/+113
| | | | | | | | | | | | | | | | | | | | _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-248-15/+44
| | | | | | Differential Revision: https://reviews.llvm.org/D67947 llvm-svn: 372773
* [clang-format] [PR36858] Add missing .hh and .cs extensions from python ↵Paul Hoad2019-09-242-3/+4
| | | | | | | | | | | | | | | | | | support utilities Summary: https://bugs.llvm.org/show_bug.cgi?id=36858 identifies .hh as a missing C++ header extension file while making this change I realized there was no support for .cs files which were added recently Reviewers: pseyfert, klimek, owenpan Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67949 llvm-svn: 372760
* [Diagnostics] Handle tautological left shifts in boolean context David Bolvansky2019-09-243-12/+30
| | | | llvm-svn: 372749
* [NFC] Update test after r372708David Bolvansky2019-09-241-1/+1
| | | | llvm-svn: 372709
* [Diagnostics] Do not diagnose unsigned shifts in boolean context ↵David Bolvansky2019-09-243-32/+39
| | | | | | | | (-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
OpenPOWER on IntegriCloud