]> granicus.if.org Git - clang/log
clang
5 years ago[test] Use %clang_cc1 instead of %clang -cc1
Fangrui Song [Fri, 27 Sep 2019 05:37:06 +0000 (05:37 +0000)]
[test] Use %clang_cc1 instead of %clang -cc1

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373043 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix use-after-free found in Clang's testsuite.
Richard Smith [Fri, 27 Sep 2019 05:36:16 +0000 (05:36 +0000)]
Fix use-after-free found in Clang's testsuite.

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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373042 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r373034
Nicholas Allegra [Fri, 27 Sep 2019 01:58:31 +0000 (01:58 +0000)]
Revert r373034

It breaks the build on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373039 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFor P0784R7: add support for new (std::nothrow).
Richard Smith [Fri, 27 Sep 2019 01:26:49 +0000 (01:26 +0000)]
For P0784R7: add support for new (std::nothrow).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373037 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFor P0784R7: Add support for dynamic allocation with new / delete during
Richard Smith [Fri, 27 Sep 2019 01:26:47 +0000 (01:26 +0000)]
For P0784R7: Add support for dynamic allocation with new / delete during
constant evaluation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Consumed][NFC] Refactor handleCall to take function argument list.
Nicholas Allegra [Thu, 26 Sep 2019 23:47:18 +0000 (23:47 +0000)]
[Consumed][NFC] Refactor handleCall to take function argument list.

Differential Revision: https://reviews.llvm.org/D67569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373034 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP 5.0] Fix user-defined mapper lookup in sema
Michael Kruse [Thu, 26 Sep 2019 22:53:01 +0000 (22:53 +0000)]
[OpenMP 5.0] Fix user-defined mapper lookup in sema

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373023 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAlways rebuild a DeclRefExpr if its FoundDecl would change.
Richard Smith [Thu, 26 Sep 2019 22:28:32 +0000 (22:28 +0000)]
Always rebuild a DeclRefExpr if its FoundDecl would change.

Fixes a regression introduced by r369999.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373022 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP50]Emit warnings if the functions was defined/used before marked
Alexey Bataev [Thu, 26 Sep 2019 20:04:15 +0000 (20:04 +0000)]
[OPENMP50]Emit warnings if the functions was defined/used before marked
declare variant.

We can use the original function if it was used/emitted already. So,
just use warnings for these cases, not errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373010 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-scan-deps] Allow continuation line backslashes followed by whitespace
Alex Lorenz [Thu, 26 Sep 2019 19:28:51 +0000 (19:28 +0000)]
[clang-scan-deps] Allow continuation line backslashes followed by whitespace
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."
Artem Dergachev [Thu, 26 Sep 2019 18:52:00 +0000 (18:52 +0000)]
Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."

This reverts commit r372940 which was an overreaction to a flaky buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373005 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOnly pass -coverage-notes-file when emitting coverage
Reid Kleckner [Thu, 26 Sep 2019 18:13:19 +0000 (18:13 +0000)]
Only pass -coverage-notes-file when emitting coverage

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373004 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove normalization of `\` in #includes from -fms-compatibility to -fms-extensions
Reid Kleckner [Thu, 26 Sep 2019 17:19:22 +0000 (17:19 +0000)]
Move normalization of `\` in #includes from -fms-compatibility to -fms-extensions

Handling backslashes in include paths in the implementation isn't
non-conforming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372999 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUn-XFAIL coverage_no_integrated_as.c test on Windows
Reid Kleckner [Thu, 26 Sep 2019 16:56:25 +0000 (16:56 +0000)]
Un-XFAIL coverage_no_integrated_as.c test on Windows

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372994 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Add -Wconversion to fdeclare-opencl-builtins test
Sven van Haastregt [Thu, 26 Sep 2019 13:31:36 +0000 (13:31 +0000)]
[OpenCL] Add -Wconversion to fdeclare-opencl-builtins test

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372975 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Testing] Workaround libcxx bug when OS is "none"
David Zarzycki [Thu, 26 Sep 2019 08:19:44 +0000 (08:19 +0000)]
[Testing] Workaround libcxx bug when OS is "none"

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.
Artem Dergachev [Thu, 26 Sep 2019 07:01:31 +0000 (07:01 +0000)]
[analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SortIncludesTest] Add SortPriority fields to fix -Wmissing-field-initializers after...
Mikael Holmen [Thu, 26 Sep 2019 06:49:37 +0000 (06:49 +0000)]
[SortIncludesTest] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372944 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Avoid small vectors of non-default-constructibles.
Artem Dergachev [Thu, 26 Sep 2019 06:33:21 +0000 (06:33 +0000)]
[analyzer] Avoid small vectors of non-default-constructibles.

Unconfuses certain compilers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after...
Fangrui Song [Thu, 26 Sep 2019 02:02:17 +0000 (02:02 +0000)]
[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372939 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libTooling] Add `run` combinator to Stencils.
Yitzhak Mandelbaum [Thu, 26 Sep 2019 00:53:56 +0000 (00:53 +0000)]
[libTooling] Add `run` combinator to Stencils.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSimplify -fms-compatibility include lookup logic, NFC
Reid Kleckner [Wed, 25 Sep 2019 22:50:50 +0000 (22:50 +0000)]
Simplify -fms-compatibility include lookup logic, NFC

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372926 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix memory leak in DeclTest.
Evgeniy Stepanov [Wed, 25 Sep 2019 22:38:20 +0000 (22:38 +0000)]
Fix memory leak in DeclTest.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] Modified SortIncludes and IncludeCategories to priority for sorting...
Paul Hoad [Wed, 25 Sep 2019 20:33:01 +0000 (20:33 +0000)]
[clang-format] Modified SortIncludes and IncludeCategories to priority for 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372919 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTED
Yitzhak Mandelbaum [Wed, 25 Sep 2019 20:04:25 +0000 (20:04 +0000)]
[libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTED

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372918 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP50]Parsing/sema support for 'implementation/vendor' context
Alexey Bataev [Wed, 25 Sep 2019 19:43:37 +0000 (19:43 +0000)]
[OPENMP50]Parsing/sema support for 'implementation/vendor' context
selector.

Added basic parsing/semantic support for
'implementation={vendor(<vendor>)}' context selector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372917 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Mangle] Add flag to asm labels to disable '\01' prefixing
Vedant Kumar [Wed, 25 Sep 2019 18:00:31 +0000 (18:00 +0000)]
[Mangle] Add flag to asm labels to disable '\01' prefixing

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372903 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA][HIP] Enable kernel function return type deduction.
Michael Liao [Wed, 25 Sep 2019 16:51:45 +0000 (16:51 +0000)]
[CUDA][HIP] Enable kernel function return type deduction.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372898 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::print...
Ilya Biryukov [Wed, 25 Sep 2019 15:46:04 +0000 (15:46 +0000)]
Re-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fix typo in `getPreviousDecl` comment.
Yitzhak Mandelbaum [Wed, 25 Sep 2019 14:58:39 +0000 (14:58 +0000)]
[NFC] Fix typo in `getPreviousDecl` comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372884 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQ...
Ilya Biryukov [Wed, 25 Sep 2019 14:50:12 +0000 (14:50 +0000)]
Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName

Reason: causes a test failure, will investigate and re-land with a fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372880 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libTooling] Introduce the MatchConsumer abstraction
Yitzhak Mandelbaum [Wed, 25 Sep 2019 13:34:04 +0000 (13:34 +0000)]
[libTooling] Introduce the MatchConsumer abstraction

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Ilya Biryukov [Wed, 25 Sep 2019 13:09:10 +0000 (13:09 +0000)]
[AST] Extract Decl::printNestedNameSpecifier helper from 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372863 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd a release note for r372844
Hans Wennborg [Wed, 25 Sep 2019 11:53:17 +0000 (11:53 +0000)]
Add a release note for r372844

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372846 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template specializ...
Hans Wennborg [Wed, 25 Sep 2019 11:09:46 +0000 (11:09 +0000)]
Revert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372844 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Add image query builtin functions
Sven van Haastregt [Wed, 25 Sep 2019 09:12:59 +0000 (09:12 +0000)]
[OpenCL] Add image query builtin functions

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372833 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Driver] Always use -z separate-loadable-segments with lld on Fuchsia
Fangrui Song [Wed, 25 Sep 2019 07:06:50 +0000 (07:06 +0000)]
[Driver] Always use -z separate-loadable-segments with lld on Fuchsia

The option was added to lld in D67481/372807.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D68009

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372814 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago [x86] Adding support for some missing intrinsics: _castf32_u32, _castf64_u64, _castu...
Pengfei Wang [Wed, 25 Sep 2019 02:24:05 +0000 (02:24 +0000)]
 [x86] Adding support for some missing intrinsics: _castf32_u32, _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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372802 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Strenghten preconditions for warning
David Bolvansky [Tue, 24 Sep 2019 20:10:57 +0000 (20:10 +0000)]
[NFC] Strenghten preconditions for warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372775 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HIP] Support new kernel launching API
Yaxun Liu [Tue, 24 Sep 2019 19:16:40 +0000 (19:16 +0000)]
[HIP] Support new kernel launching API

Differential Revision: https://reviews.llvm.org/D67947

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372773 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] [PR36858] Add missing .hh and .cs extensions from python support utilities
Paul Hoad [Tue, 24 Sep 2019 14:00:06 +0000 (14:00 +0000)]
[clang-format] [PR36858] Add missing .hh and .cs extensions from python 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372760 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Handle tautological left shifts in boolean context
David Bolvansky [Tue, 24 Sep 2019 13:14:18 +0000 (13:14 +0000)]
[Diagnostics] Handle tautological left shifts in boolean context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372749 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Update test after r372708
David Bolvansky [Tue, 24 Sep 2019 09:24:48 +0000 (09:24 +0000)]
[NFC] Update test after r372708

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372709 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Do not diagnose unsigned shifts in boolean context (-Wint-in-bool-context)
David Bolvansky [Tue, 24 Sep 2019 09:14:33 +0000 (09:14 +0000)]
[Diagnostics] Do not diagnose unsigned shifts in boolean context (-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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372708 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] 4th attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 09:00:46 +0000 (09:00 +0000)]
[ASTImporter] 4th attempt to fix Windows buildbot test errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372705 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] NFC clang-format the clang-format unit tests
Paul Hoad [Tue, 24 Sep 2019 06:35:37 +0000 (06:35 +0000)]
[clang-format] NFC clang-format the clang-format unit tests

Summary:
It is annoying that the clang-format tests aren't themselves clang-formatted, if you use a format on save option in VS or vim this file gets massively changed then you have to `git difftool` all the other changes back out, which is risky.

I know people don't like mass clang-format changes but sometimes it becomes unmanageable to not. There are no other changes here other than just the reformat.

clang-format tests all pass.

```
[==========] 691 tests from 21 test cases ran. (55990 ms total)
[  PASSED  ] 691 tests.
```

Reviewers: klimek, owenpan, timwoj

Reviewed By: owenpan

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D67888

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372689 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] 3rd attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 05:50:02 +0000 (05:50 +0000)]
[ASTImporter] 3rd attempt to fix Windows buildbot test errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372688 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[static analyzer] Define __clang_analyzer__ macro in driver"
Jan Korous [Tue, 24 Sep 2019 03:21:22 +0000 (03:21 +0000)]
Revert "[static analyzer] Define __clang_analyzer__ macro in driver"

This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372687 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"
Jan Korous [Tue, 24 Sep 2019 03:19:20 +0000 (03:19 +0000)]
Revert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"

This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372685 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[static analyzer][test] Test directly that driver sets D__clang_analyzer__
Jan Korous [Tue, 24 Sep 2019 02:06:59 +0000 (02:06 +0000)]
[static analyzer][test] Test directly that driver sets D__clang_analyzer__

Follow-up to fbd13570b0d

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372683 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Tue, 24 Sep 2019 00:38:49 +0000 (00:38 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

Reapplies r372663 after adapting a failing test in the LLDB testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372681 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[static analyzer] Remove --analyze-auto
Jan Korous [Tue, 24 Sep 2019 00:37:25 +0000 (00:37 +0000)]
[static analyzer] Remove --analyze-auto

Differential Revision: https://reviews.llvm.org/D67934

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372680 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[static analyzer] Define __clang_analyzer__ macro in driver
Jan Korous [Tue, 24 Sep 2019 00:33:47 +0000 (00:33 +0000)]
[static analyzer] Define __clang_analyzer__ macro in driver

Differential Revision: https://reviews.llvm.org/D67938

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372679 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Support for DWARF-5 C++ language tags."
Jonas Devlieghere [Mon, 23 Sep 2019 23:49:36 +0000 (23:49 +0000)]
Revert "Support for DWARF-5 C++ language tags."

This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372672 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFCI] Return PathSensitiveBugReport where appropriate
Alex Langford [Mon, 23 Sep 2019 22:24:47 +0000 (22:24 +0000)]
[NFCI] Return PathSensitiveBugReport where appropriate

Some compilers have trouble converting unique_ptr<PathSensitiveBugReport> to
unique_ptr<BugReport> causing some functions to fail to compile.
Changing the return type of the functions that fail to compile does not
appear to have any issues.
I ran into this issue building with clang 3.8 on Ubuntu 16.04.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372668 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC...
David Bolvansky [Mon, 23 Sep 2019 22:09:49 +0000 (22:09 +0000)]
[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC compatibility)

Extracted from D63082.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372664 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Mon, 23 Sep 2019 22:01:49 +0000 (22:01 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372663 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] 2nd attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 19:49:45 +0000 (19:49 +0000)]
[ASTImporter] 2nd attempt to fix Windows buildbot test errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372646 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema] Fix the atomic expr rebuilding order.
Michael Liao [Mon, 23 Sep 2019 18:48:06 +0000 (18:48 +0000)]
[Sema] Fix the atomic expr rebuilding order.

Summary:
- Rearrange the atomic expr order to the API order when rebuilding
  atomic expr during template instantiation.

Reviewers: erichkeane

Subscribers: jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67924

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372640 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Use standard parsing for 'match' clause, NFC.
Alexey Bataev [Mon, 23 Sep 2019 18:13:31 +0000 (18:13 +0000)]
[OPENMP]Use standard parsing for 'match' clause, NFC.

Reused standard clauses parsing scheme for parsing/matching 'match'
clause in 'declare variant' directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372635 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter] Attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 17:29:08 +0000 (17:29 +0000)]
[ASTImporter] Attempt to fix Windows buildbot test errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372633 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Fix a poorly-written test
Erik Pilkington [Mon, 23 Sep 2019 17:16:55 +0000 (17:16 +0000)]
NFC: Fix a poorly-written test

The author of r364954 foolishly forgot that == binds tighter than ?:

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372631 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago Fix __is_fundamental to accept nullptr_t
Zoe Carver [Mon, 23 Sep 2019 16:02:46 +0000 (16:02 +0000)]
Fix __is_fundamental to accept nullptr_t

    Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t.

    Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67899

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372624 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
Alexey Bataev [Mon, 23 Sep 2019 15:53:51 +0000 (15:53 +0000)]
[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
is not provided.

We should not emit any target-dependent code if only -fopenmp flag is
used and device targets are not provided to prevent compiler crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372623 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago Fix __is_signed builtin
Zoe Carver [Mon, 23 Sep 2019 15:41:20 +0000 (15:41 +0000)]
Fix __is_signed builtin

    Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type.

    Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma

    Subscribers: cfe-commits

    Tags: #clang

    Differential Revision: https://reviews.llvm.org/D67897

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372621 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Fix some typos in InternalsManual
Sven van Haastregt [Mon, 23 Sep 2019 14:24:29 +0000 (14:24 +0000)]
[docs] Fix some typos in InternalsManual

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372614 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility)
David Bolvansky [Mon, 23 Sep 2019 14:21:08 +0000 (14:21 +0000)]
[Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility)

Extracted from D63082, addressed review comments related to a warning message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372612 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix test atomic-expr.cpp after R372422
Erich Keane [Mon, 23 Sep 2019 14:12:13 +0000 (14:12 +0000)]
Fix test atomic-expr.cpp after R372422

The test tried to match a path in a printout by doing '^:' which failed
on windows, since C:\... is a path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372611 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Call __kmpc_push_tripcount in task context.
Alexey Bataev [Mon, 23 Sep 2019 14:06:51 +0000 (14:06 +0000)]
[OPENMP]Call __kmpc_push_tripcount in task context.

Runtime function __kmpc_push_tripcount better to call inside of the task
context for target regions. Otherwise, the libomptarget is unable to
link the provided tripcount value for nowait target regions and
completely looses this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372609 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libTooling] Add `access` and `ifBound` combinators to Stencil library.
Yitzhak Mandelbaum [Mon, 23 Sep 2019 13:21:42 +0000 (13:21 +0000)]
[libTooling] Add `access` and `ifBound` combinators to Stencil library.

Summary:
This revision add the `access` and `ifBound` combinators to the Stencil library:
* `access` -- constructs an idiomatic expression for accessing a member (a
  `MemberExpr`).
* `ifBound` -- chooses between two `StencilParts` based on the whether an id is
  bound in the match (corresponds to the combinator of the same name in
  RangeSelector).

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67633

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372605 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested array by...
David Bolvansky [Mon, 23 Sep 2019 12:54:35 +0000 (12:54 +0000)]
[Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested array by the size of the deepest base type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372600 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[libTooling] Introduce new library of source-code builders.
Yitzhak Mandelbaum [Mon, 23 Sep 2019 12:40:10 +0000 (12:40 +0000)]
[libTooling] Introduce new library of source-code builders.

Summary:
Introduces facilities for easily building source-code strings, including
idiomatic use of parentheses and the address-of, dereference and member-access
operators (dot and arrow) and queries about need for parentheses.

Reviewers: gribozavr

Subscribers: mgorny, cfe-commits, ilya-biryukov

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67632

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372595 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemoved dead code from Stencil.h
Dmitri Gribenko [Mon, 23 Sep 2019 12:15:48 +0000 (12:15 +0000)]
Removed dead code from Stencil.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372594 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fixed clang wasm test after rL372573
David Bolvansky [Mon, 23 Sep 2019 10:14:07 +0000 (10:14 +0000)]
[NFC] Fixed clang wasm test after rL372573

These tests should not depend on -O1..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372575 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies
Gabor Marton [Mon, 23 Sep 2019 09:32:07 +0000 (09:32 +0000)]
[ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies

Summary:
In this patch we provide additional and comprehensive tests for the ODR
handling strategies. This is the continuation of
https://reviews.llvm.org/D59692.

Reviewers: shafik, a_sidorin, balazske, a.sidorin

Subscribers: mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66951

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372564 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment] fix build
Guillaume Chatelet [Mon, 23 Sep 2019 09:04:12 +0000 (09:04 +0000)]
[Alignment] fix build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372562 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFor P0784R7: add further testing of requirements on constexpr
Richard Smith [Mon, 23 Sep 2019 05:08:55 +0000 (05:08 +0000)]
For P0784R7: add further testing of requirements on constexpr
destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372541 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFor P0784R7: add support for constexpr destructors, and call them as
Richard Smith [Mon, 23 Sep 2019 03:48:44 +0000 (03:48 +0000)]
For P0784R7: add support for constexpr destructors, and call them as
appropriate during constant evaluation.

Note that the evaluator is sometimes invoked on incomplete expressions.
In such cases, if an object is constructed but we never reach the point
where it would be destroyed (and it has non-trivial destruction), we
treat the expression as having an unmodeled side-effect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372538 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Require last argument to LWPINS/LWPVAL builtins to be an ICE. Add ImmArg to...
Craig Topper [Sun, 22 Sep 2019 23:48:50 +0000 (23:48 +0000)]
[X86] Require last argument to LWPINS/LWPVAL builtins to be an ICE. Add ImmArg to the llvm intrinsics.

Update the isel patterns to use timm instead of imm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372534 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Fixed failed test
David Bolvansky [Sun, 22 Sep 2019 22:15:11 +0000 (22:15 +0000)]
[NFC] Fixed failed test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372533 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Diagnostics] Warn if ?: with integer constants always evaluates to true
David Bolvansky [Sun, 22 Sep 2019 22:00:48 +0000 (22:00 +0000)]
[Diagnostics] Warn if ?: with integer constants always evaluates to true

Extracted from D63082. GCC has this warning under -Wint-in-bool-context, but as noted in the D63082's review, we should put it under TautologicalConstantCompare.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372531 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] fixing conditional explicit for out-of-line definition PR42980
Gauthier Harnisch [Sun, 22 Sep 2019 21:59:10 +0000 (21:59 +0000)]
[clang] fixing conditional explicit for out-of-line definition PR42980

Summary: not every read in CXXConstructorDecl::getExplicitSpecifierInternal() was made on the canonical declaration.

Reviewers: rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67889

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372530 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] [Basic] Enable __has_feature(leak_sanitizer)
Michal Gorny [Sun, 22 Sep 2019 20:55:01 +0000 (20:55 +0000)]
[clang] [Basic] Enable __has_feature(leak_sanitizer)

Add a 'leak_sanitizer' feature akin to existing '*_sanitizer' features
to let programmers switch code paths accounting for leak sanitizers
being enabled.

Differential Revision: https://reviews.llvm.org/D67719

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372527 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CLANG][BPF] permit any argument type for __builtin_preserve_access_index()
Yonghong Song [Sun, 22 Sep 2019 17:33:48 +0000 (17:33 +0000)]
[CLANG][BPF] permit any argument type for __builtin_preserve_access_index()

Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index()
signature") changed the builtin function signature to
  PointerT __builtin_preserve_access_index(PointerT ptr)
with a pointer type as the argument/return type, where argument and
return types must be the same.

There is really no reason for this constraint. The builtin just
presented a code region so that IR builtins
  __builtin_{array, struct, union}_preserve_access_index
can be applied.

This patch removed the pointer type restriction to permit any
argument type as long as it is permitted by the compiler.

Differential Revision: https://reviews.llvm.org/D67883

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372516 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoClang-format: Add Whitesmiths indentation style
Paul Hoad [Sun, 22 Sep 2019 12:00:34 +0000 (12:00 +0000)]
Clang-format: Add Whitesmiths indentation style

Summary:
This patch adds support for the Whitesmiths indentation style to clang-format. It’s an update to a patch submitted in 2015 (D6833), but reworks it to use the newer API.

There are still some issues with this patch, primarily around `switch` and `case` support. The added unit test won’t currently pass because of the remaining issues.

Reviewers: mboehme, MyDeveloperDay, djasper

Reviewed By: MyDeveloperDay

Subscribers: krasimir, MyDeveloperDay, echristo, cfe-commits

Patch By: @timwoj (Tim Wojtulewicz)

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67627

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372497 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove classes into anonymous namespaces. NFC.
Benjamin Kramer [Sun, 22 Sep 2019 09:28:47 +0000 (09:28 +0000)]
Move classes into anonymous namespaces. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372495 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Change ObjCQualified*TypesAreCompatible to take
James Y Knight [Sat, 21 Sep 2019 22:31:28 +0000 (22:31 +0000)]
NFC: Change ObjCQualified*TypesAreCompatible to take
ObjCObjectPointerType arguments.

All callers already had one, just creating a QualType to pass, after
which the function cast it right back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372492 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAttempt to fix a windows buildbot failure
Kristof Umann [Sat, 21 Sep 2019 07:56:40 +0000 (07:56 +0000)]
Attempt to fix a windows buildbot failure

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372462 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Clang Interpreter] Fixed Bug 43362, build failure on GCC
Nandor Licker [Sat, 21 Sep 2019 05:29:18 +0000 (05:29 +0000)]
[Clang Interpreter] Fixed Bug 43362, build failure on GCC

free() was not directly included in InterpStack.cpp, added include now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372455 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix bad APInt compare.
Richard Trieu [Sat, 21 Sep 2019 04:18:54 +0000 (04:18 +0000)]
Fix bad APInt compare.

APInt comparison require both to have the same bitwidth.  Since only the value
is needed, use the compare function APInt::isSameValue instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372454 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMerge and improve code that detects same value in comparisons.
Richard Trieu [Sat, 21 Sep 2019 03:02:26 +0000 (03:02 +0000)]
Merge and improve code that detects same value in comparisons.

-Wtautological-overlap-compare and self-comparison from -Wtautological-compare
relay on detecting the same operand in different locations.  Previously, each
warning had it's own operand checker.  Now, both are merged together into
one function that each can call.  The function also now looks through member
access and array accesses.

Differential Revision: https://reviews.llvm.org/D66045

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372453 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert assertion added by r372394
Yaxun Liu [Sat, 21 Sep 2019 02:51:44 +0000 (02:51 +0000)]
Revert assertion added by r372394

The assertion added by r372394 causes CUDA test in test-suite to assert.

The assertion was not there originally, so revert it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372452 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoImprove -Wtautological-overlap-compare
Richard Trieu [Sat, 21 Sep 2019 02:37:10 +0000 (02:37 +0000)]
Improve -Wtautological-overlap-compare

Allow this warning to detect a larger number of constant values, including
negative numbers, and handle non-int types better.

Differential Revision: https://reviews.llvm.org/D66044

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372448 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-scan-deps] strip the --serialize-diagnostics argument
Alex Lorenz [Sat, 21 Sep 2019 00:17:26 +0000 (00:17 +0000)]
[clang-scan-deps] strip the --serialize-diagnostics argument

This ensures that clang-scan-deps won't write out diagnostics when
scanning dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372444 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove outdated FIXME.
Richard Smith [Fri, 20 Sep 2019 23:12:51 +0000 (23:12 +0000)]
Remove outdated FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372438 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix assertion failure when constant evaluation of a switch jumps over an
Richard Smith [Fri, 20 Sep 2019 23:08:59 +0000 (23:08 +0000)]
Fix assertion failure when constant evaluation of a switch jumps over an
uninitialized variable in an init-statement of a 'for' or 'if'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372437 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Support z15 processor name
Ulrich Weigand [Fri, 20 Sep 2019 23:06:03 +0000 (23:06 +0000)]
[SystemZ] Support z15 processor name

The recently announced IBM z15 processor implements the architecture
already supported as "arch13" in LLVM.  This patch adds support for
"z15" as an alternate architecture name for arch13.

Corrsponding LLVM support was committed as rev. 372435.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372436 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoEnsure AtomicExpr goes through SEMA checking after TreeTransform
Erich Keane [Fri, 20 Sep 2019 19:17:31 +0000 (19:17 +0000)]
Ensure AtomicExpr goes through SEMA checking after TreeTransform

RebuildAtomicExpr was skipping doing semantic analysis which broke in
the cases where the expressions were not dependent. This resulted in the
ImplicitCastExpr from an array to a pointer being lost, causing a crash
in IR CodeGen.

Differential Revision: https://reviews.llvm.org/D67854

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372422 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix a documentation error
Kristof Umann [Fri, 20 Sep 2019 18:28:04 +0000 (18:28 +0000)]
Fix a documentation error

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372419 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[www] Turn 'Clang 9' boxes green in C++ status pages now Clang 9 is
Richard Smith [Fri, 20 Sep 2019 18:09:05 +0000 (18:09 +0000)]
[www] Turn 'Clang 9' boxes green in C++ status pages now Clang 9 is
released.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372415 91177308-0d34-0410-b5e6-96231b3b80d8