]> granicus.if.org Git - clang/log
clang
5 years ago[WebAssembly] Add multivalue and tail-call target features
Thomas Lively [Thu, 23 May 2019 17:26:47 +0000 (17:26 +0000)]
[WebAssembly] Add multivalue and tail-call target features

Summary:
These features will both be implemented soon, so I thought I would
save time by adding the boilerplate for both of them at the same time.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[LibTooling] Fix dangling references in RangeSelector.
Yitzhak Mandelbaum [Thu, 23 May 2019 17:11:33 +0000 (17:11 +0000)]
[LibTooling] Fix dangling references in RangeSelector.

Summary:
RangeSelector had a number of cases of capturing a StringRef in a lambda, which
lead to dangling references. This change converts all uses in the API of
`StringRef` to `std::string` to avoid this problem. `std::string` in the API is
a reasonable choice, because the combinators are always storing the string
beyond the life of the combinator construction.

Reviewers: ilya-biryukov, gribozavr

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[Index] Fix reported references in presence of template type aliases
Ilya Biryukov [Thu, 23 May 2019 16:48:47 +0000 (16:48 +0000)]
[Index] Fix reported references in presence of template type aliases

Summary: See the added test for an example.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: jkorous, arphaman, cfe-commits

Tags: #clang

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

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

5 years ago[CodeComplete] Only show lambda completions if patterns are requested
Ilya Biryukov [Thu, 23 May 2019 16:39:26 +0000 (16:39 +0000)]
[CodeComplete] Only show lambda completions if patterns are requested

This is a trivial follow-up to r361461, so sending without review.

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

5 years agoEnsure builtins use the target default Calling Convention
Erich Keane [Thu, 23 May 2019 16:05:21 +0000 (16:05 +0000)]
Ensure builtins use the target default Calling Convention

r355317 changed builtins/allocation functions to use the default calling
convention in order to support platforms that use non-cdecl calling
conventions by default.

However the default calling convention is overridable on Windows 32 bit
implementations with some of the /G options. The intent is to permit the
user to set the calling convention of normal functions, however it
should NOT apply to builtins and C++ allocation functions.

This patch ensures that the builtin/allocation functions always use the
Target specific Calling Convention, ignoring the user overridden version
of said default.

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

5 years ago[analyzer][NFC] Prettify some RUN: lines in test files.
Kristof Umann [Thu, 23 May 2019 15:49:04 +0000 (15:49 +0000)]
[analyzer][NFC] Prettify some RUN: lines in test files.

This is a test commit in disguise.

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

5 years ago[Driver] Try normalized triple when looking for C++ libraries
Petr Hosek [Thu, 23 May 2019 15:23:16 +0000 (15:23 +0000)]
[Driver] Try normalized triple when looking for C++ libraries

This addresses the issue introduced in r361432 where we would only
try effective triple but not the normalized one as we do for other
runtimes.

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

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

5 years agoWork around a Visual C++ bug.
Paul Robinson [Thu, 23 May 2019 15:07:46 +0000 (15:07 +0000)]
Work around a Visual C++ bug.

Using a static function as a template parameter gets a bogus compile-time
error with Visual Studio 2017, prior to version 15.8. Our current
minimum-version requirement is a particular update to VS2015, and we
assume all Visual Studio 2017 versions are usable. This patch makes the
code buildable with older versions of VS2017, and can be reverted after
we upgrade the minimum version sometime in the future.

Description of the Microsoft bug:
https://developercommunity.visualstudio.com/content/problem/25334/error-code-c2971-when-specifying-a-function-as-the.html

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

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

5 years agoDelete default constructors, copy constructors, move constructors, copy assignment...
Dmitri Gribenko [Thu, 23 May 2019 09:22:43 +0000 (09:22 +0000)]
Delete default constructors, copy constructors, move constructors, copy assignment, move assignment operators on Expr, Stmt and Decl

Reviewers: ilya-biryukov, rsmith

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoEnable queue_t and clk_event_t comparisons in C++ mode
Sven van Haastregt [Thu, 23 May 2019 09:20:08 +0000 (09:20 +0000)]
Enable queue_t and clk_event_t comparisons in C++ mode

Support queue_t and clk_event_t comparisons in C++ for OpenCL mode, to
preserve backwards compatibility with OpenCL C.

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

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

5 years ago[CodeComplete] Complete a lambda when preferred type is a function
Ilya Biryukov [Thu, 23 May 2019 07:45:35 +0000 (07:45 +0000)]
[CodeComplete] Complete a lambda when preferred type is a function

Summary: Uses a heuristic to detect std::function and friends.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[CMake][Fuchsia] Use cannonical triples for runtimes
Petr Hosek [Thu, 23 May 2019 02:35:12 +0000 (02:35 +0000)]
[CMake][Fuchsia] Use cannonical triples for runtimes

This ensures that whether the user uses short or cannonical version
of the triple, Clang will still find the runtimes under the cannonical
triple name.

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

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

5 years agoFix r361428 for Windows buildbots/mangling
David Blaikie [Wed, 22 May 2019 21:58:17 +0000 (21:58 +0000)]
Fix r361428 for Windows buildbots/mangling

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

5 years agoFix new enum-codegen.cpp test
Reid Kleckner [Wed, 22 May 2019 21:52:12 +0000 (21:52 +0000)]
Fix new enum-codegen.cpp test

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

5 years agoAdd some notes on immutability and faithfulness to the internals manual.
Richard Smith [Wed, 22 May 2019 21:20:09 +0000 (21:20 +0000)]
Add some notes on immutability and faithfulness to the internals manual.

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

5 years ago[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++
Petr Hosek [Wed, 22 May 2019 21:08:33 +0000 (21:08 +0000)]
[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++

This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory. Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/$target/c++ and include/c++ directories, leaving resource directory
only for compiler-rt runtimes and Clang builtin headers.

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

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

5 years agoAdd back --sysroot support for darwin header search.
James Y Knight [Wed, 22 May 2019 20:39:51 +0000 (20:39 +0000)]
Add back --sysroot support for darwin header search.

Before e97b5f5cf37e ([clang][Darwin] Refactor header search path logic
into the driver), both --sysroot and -isysroot worked to specify where
to look for system and C++ headers on Darwin. However, that change
caused clang to start ignoring --sysroot.

This fixes the regression, and adds tests.

(I also note that on all other platforms, clang seems to almost
completely ignore -isysroot, but that's another issue...)

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

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

5 years agoModules: Code generation of enum constants for merged enum definitions
David Blaikie [Wed, 22 May 2019 20:36:06 +0000 (20:36 +0000)]
Modules: Code generation of enum constants for merged enum definitions

Found in a bootstrap of LLVM with implicit modules, resulting in a
deadlock of some Orc unit tests with libstdc++ 8.1. An enum was used as
part of the implementation of std::recursive_mutex and this bug resulted
in the constant initialization of zero instead of the desired non-zero
value. => Badness.

Richard Smith tells me neither of these fields are necessarily canonical
& so using declaresSamEntity is the right solution here (rather than
changing both of these Fields to be canonical by construction/from their
source)

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

5 years agoPart of P1091R3: permit structured bindings to be declared 'static' and
Richard Smith [Wed, 22 May 2019 19:52:55 +0000 (19:52 +0000)]
Part of P1091R3: permit structured bindings to be declared 'static' and
'thread_local' in C++20.

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

5 years ago[LibTooling] Update Stencil to use RangeSelector
Yitzhak Mandelbaum [Wed, 22 May 2019 18:03:00 +0000 (18:03 +0000)]
[LibTooling] Update Stencil to use RangeSelector

Add support for creating a `StencilPart` from any `RangeSelector`, which
broadens the scope of `Stencil`.

Correspondingly, deprecate Stencil's specialized combinators `node` and `sNode`
in favor of using the new `selection` combinator directly (with the appropriate
range selector).

Reviewers: sbenza

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoFixed a -Wunused-variable warning when assertions are disabled
Dmitri Gribenko [Wed, 22 May 2019 17:45:24 +0000 (17:45 +0000)]
Fixed a -Wunused-variable warning when assertions are disabled

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

5 years agoCombine two if cases because the second one is never reached.
Amy Huang [Wed, 22 May 2019 15:48:59 +0000 (15:48 +0000)]
Combine two if cases because the second one is never reached.

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.
Yitzhak Mandelbaum [Wed, 22 May 2019 14:48:19 +0000 (14:48 +0000)]
[LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

Transformer provides an enum to indicate the range of source text to be edited.
That support is now redundant with the new (and more general) RangeSelector
library, so we remove the custom enum support in favor of supporting any
RangeSelector.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoReland r361148 with a fix to the buildbot failure.
Ilya Biryukov [Wed, 22 May 2019 14:44:45 +0000 (14:44 +0000)]
Reland r361148 with a fix to the buildbot failure.

Reverted in r361377.
Also reland the '.gn' files (reverted in r361389).

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

5 years ago[OpenCL] Support pipe keyword in C++ mode
Sven van Haastregt [Wed, 22 May 2019 13:12:20 +0000 (13:12 +0000)]
[OpenCL] Support pipe keyword in C++ mode

Support the OpenCL C pipe feature in C++ for OpenCL mode, to preserve
backwards compatibility with OpenCL C.

Various changes had to be made in Parse and Sema to enable
pipe-specific diagnostics, so enable a SemaOpenCL test for C++.

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

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

5 years ago[CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not zero...
Simon Pilgrim [Wed, 22 May 2019 13:02:19 +0000 (13:02 +0000)]
[CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not zero. NFCI.

Fixes scan-build division by zero warning.

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

5 years agoClang-formatting the header in advance of other planned changes; NFC.
Aaron Ballman [Wed, 22 May 2019 13:01:28 +0000 (13:01 +0000)]
Clang-formatting the header in advance of other planned changes; NFC.

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

5 years agoRevert r361148 "[Syntax] Introduce TokenBuffer, start clangToolingSyntax library"
Russell Gallop [Wed, 22 May 2019 12:50:52 +0000 (12:50 +0000)]
Revert r361148 "[Syntax] Introduce TokenBuffer, start clangToolingSyntax library"

Also reverted r361264 "[Syntax] Rename TokensTest to SyntaxTests. NFC"
which built on it. This is because there were hitting an assert on bots

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

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

5 years ago[Frontend] Return an error on bad inputs to PrecompiledPreabmle
Ilya Biryukov [Wed, 22 May 2019 12:50:01 +0000 (12:50 +0000)]
[Frontend] Return an error on bad inputs to PrecompiledPreabmle

Summary:
Instead of failing with assertions. Fixes a crash found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12865

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoMark tests from r361278 as unsupported on Windows.
Russell Gallop [Wed, 22 May 2019 12:07:52 +0000 (12:07 +0000)]
Mark tests from r361278 as unsupported on Windows.

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

5 years ago[ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation
John Brawn [Wed, 22 May 2019 11:42:54 +0000 (11:42 +0000)]
[ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation

Overaligned and underaligned types (i.e. types where the alignment has been
increased or decreased using the aligned and packed attributes) weren't being
correctly handled in all cases, as the unadjusted alignment should be used.

This patch also adjusts getTypeUnadjustedAlign to correctly handle typedefs of
non-aggregate types, which it appears it never had to handle before.

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

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

5 years ago[Driver][Windows] Add dependent lib argument for -fprofile-generate and -fcs-profile...
Russell Gallop [Wed, 22 May 2019 10:06:49 +0000 (10:06 +0000)]
[Driver][Windows] Add dependent lib argument for -fprofile-generate and -fcs-profile-generate

Follows on from r360674 which added it for -fprofile-instr-generate.

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

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

5 years ago[PPC64] Fix PPC64TargetInfo ABI on clang side after D61950
Fangrui Song [Wed, 22 May 2019 09:26:46 +0000 (09:26 +0000)]
[PPC64] Fix PPC64TargetInfo ABI on clang side after D61950

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

5 years ago[PPC64] Fix PPC64TargetInfo after D61950
Fangrui Song [Wed, 22 May 2019 09:17:21 +0000 (09:17 +0000)]
[PPC64] Fix PPC64TargetInfo after D61950

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

5 years ago[PPC64] Parse -elfv1 -elfv2 when specified on target triple
Fangrui Song [Wed, 22 May 2019 07:29:59 +0000 (07:29 +0000)]
[PPC64] Parse -elfv1 -elfv2 when specified on target triple

Summary:
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress[1]. This patch adds an alternative way to specify ELFv2 ABI on target triple [2].

The following results are expected:

ELFv1 when using:
-target powerpc64-unknown-freebsd12.0
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
-target powerpc64-unknown-freebsd12.0-elfv1

ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
-target powerpc64-unknown-freebsd12.0-elfv2

[1] https://wiki.freebsd.org/powerpc/llvm-elfv2
[2] https://clang.llvm.org/docs/CrossCompilation.html

Patch by Alfredo Dal'Ava JĂșnior!

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

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

5 years agoFixed a -Wunused-variable warning when assertions are disabled
Dmitri Gribenko [Wed, 22 May 2019 06:57:23 +0000 (06:57 +0000)]
Fixed a -Wunused-variable warning when assertions are disabled

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

5 years ago[Docs] Increase Doxygen cache size
Don Hinton [Wed, 22 May 2019 00:56:42 +0000 (00:56 +0000)]
[Docs] Increase Doxygen cache size

Summary:
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.

By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
number.

Reviewed By: hintonda

Patch by J. Ryan Stinnett!

Tags: #clang, #llvm

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

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

5 years ago[Analysis] Link library dependencies to Analysis plugins
Petr Hosek [Wed, 22 May 2019 00:47:37 +0000 (00:47 +0000)]
[Analysis] Link library dependencies to Analysis plugins

These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.

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

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

5 years ago[PragmaHandler] Expose `#pragma` location
Joel E. Denny [Tue, 21 May 2019 23:51:38 +0000 (23:51 +0000)]
[PragmaHandler] Expose `#pragma` location

Currently, a pragma AST node's recorded location starts at the
namespace token (such as `omp` in the case of OpenMP) after the
`#pragma` token, and the `#pragma` location isn't available.  However,
the `#pragma` location can be useful when, for example, rewriting a
directive using Clang's Rewrite facility.

This patch makes `#pragma` locations available in any `PragmaHandler`
but it doesn't yet make use of them.

This patch also uses the new `struct PragmaIntroducer` to simplify
`Preprocessor::HandlePragmaDirective`.  It doesn't do the same for
`PPCallbacks::PragmaDirective` because that changes the API documented
in `clang-tools-extra/docs/pp-trace.rst`, and I'm not sure about
backward compatibility guarantees there.

Reviewed By: ABataev, lebedev.ri, aaron.ballman

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

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

5 years agoFix target property to make BUILD_SHARED_LIBS work
Chris Bieneman [Tue, 21 May 2019 23:50:15 +0000 (23:50 +0000)]
Fix target property to make BUILD_SHARED_LIBS work

Public and Private link libraries get merged in the LINK_LIBRARIES property instead of being kept separate.

With any luck this will get `BUILD_SHARED_LIBS` working again on Linux.

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

5 years ago[c++20] P1330R0: permit simple-assignments that change the active member
Richard Smith [Tue, 21 May 2019 23:15:20 +0000 (23:15 +0000)]
[c++20] P1330R0: permit simple-assignments that change the active member
of a union within constant expression evaluation.

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

5 years agoRefactor: split Uninitialized state on APValue into an "Absent" state
Richard Smith [Tue, 21 May 2019 23:15:18 +0000 (23:15 +0000)]
Refactor: split Uninitialized state on APValue into an "Absent" state
representing no such object, and an "Indeterminate" state representing
an uninitialized object. The latter is not yet used, but soon will be.

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

5 years agoRename identifiers to spell out analyze; NFC.
Aaron Ballman [Tue, 21 May 2019 22:43:48 +0000 (22:43 +0000)]
Rename identifiers to spell out analyze; NFC.

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

5 years ago[Driver] Verify GCCInstallation is valid
Nick Desaulniers [Tue, 21 May 2019 21:21:35 +0000 (21:21 +0000)]
[Driver] Verify GCCInstallation is valid

Summary:
Values returned by GCCInstallation.getParentLibPath() and
GCCInstallation.getTriple() are not valid unless
GCCInstallation.isValid() returns true. This has previously been
ignored, and the former two values were used without checking whether
GCCInstallation is valid. This led to the bad path "/../bin" being added
to the list of program paths.

author: danielmentz "Daniel Mentz <danielmentz@google.com>"

Reviewers: #clang, tstellar, srhines

Reviewed By: srhines

Subscribers: danielmentz, ormris, nickdesaulniers, srhines, cfe-commits

Tags: #clang

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

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

5 years agoLet -static-pie win if it is specified along with -pie or -static.
Siva Chandra [Tue, 21 May 2019 21:09:05 +0000 (21:09 +0000)]
Let -static-pie win if it is specified along with -pie or -static.

Also, disallow specifying -no-pie/-nopie along with -static-pie.

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

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

5 years agoRemove unicode character from test
Leonard Chan [Tue, 21 May 2019 20:12:00 +0000 (20:12 +0000)]
Remove unicode character from test

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

5 years agoFix test failures after r361278 on non-Darwin platforms and when
Richard Smith [Tue, 21 May 2019 20:10:52 +0000 (20:10 +0000)]
Fix test failures after r361278 on non-Darwin platforms and when
CLANG_DEFAULT_STDLIB is defined to libstdc++.

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

5 years ago[c++20] P0780R2: Support pack-expansion of init-captures.
Richard Smith [Tue, 21 May 2019 20:10:50 +0000 (20:10 +0000)]
[c++20] P0780R2: Support pack-expansion of init-captures.

This permits an init-capture to introduce a new pack:

  template<typename ...T> auto x = [...a = T()] { /* a is a pack */ };

To support this, the mechanism for allowing ParmVarDecls to be packs has
been extended to support arbitrary local VarDecls.

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

5 years ago[OpenMP] Add support for registering requires directives with the runtime
Gheorghe-Teodor Bercea [Tue, 21 May 2019 19:42:01 +0000 (19:42 +0000)]
[OpenMP] Add support for registering requires directives with the runtime

Summary:
This patch adds support for the registration of the requires directives with the runtime.

Each requires directive clause will enable a particular flag to be set.

The set of flags is passed to the runtime to be checked for compatibility with other such flags coming from other object files.

The registration function is called whenever OpenMP is present even if a requires directive is not present. This helps detect cases in which requires directives are used inconsistently.

Reviewers: ABataev, AlexEichenberger, caomhin

Reviewed By: ABataev, AlexEichenberger

Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years ago[DebugInfo] Don't emit checksums when compiling a preprocessed CPP
Alexandre Ganea [Tue, 21 May 2019 19:40:28 +0000 (19:40 +0000)]
[DebugInfo] Don't emit checksums when compiling a preprocessed CPP

Fixes PR41215

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

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

5 years ago[LibTooling] Address post-commit feedback for r361152
Yitzhak Mandelbaum [Tue, 21 May 2019 18:48:58 +0000 (18:48 +0000)]
[LibTooling] Address post-commit feedback for r361152

Fixes a redundant dependency and moves another to its proper place.

Reviewers: thakis

Subscribers: mgorny, cfe-commits

Tags: #clang

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

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

5 years ago[OPENMP]Use the attributes for dso locality when building for device.
Alexey Bataev [Tue, 21 May 2019 18:20:08 +0000 (18:20 +0000)]
[OPENMP]Use the attributes for dso locality when building for device.

Currently, we ignore all dso locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds.

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

5 years ago[clang][Darwin] Refactor header search path logic into the driver
Louis Dionne [Tue, 21 May 2019 17:48:04 +0000 (17:48 +0000)]
[clang][Darwin] Refactor header search path logic into the driver

Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.

This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.

Reviewers: jfb, arphaman

Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits

Tags: #clang

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

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

5 years ago[CMake] One more stab at fixing BUILD_SHARED_LIBS
Chris Bieneman [Tue, 21 May 2019 17:30:59 +0000 (17:30 +0000)]
[CMake] One more stab at fixing BUILD_SHARED_LIBS

If clang's libraries are build SHARED, we need to grab their `PRIVATE_LINK_LIBRARIES` properties and add those to clang_shared's interface.

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

5 years agoDo not use the incorrect attribute spelling list index when translating a no_sanitize...
Aaron Ballman [Tue, 21 May 2019 17:24:49 +0000 (17:24 +0000)]
Do not use the incorrect attribute spelling list index when translating a no_sanitize_foo attribute into a no_sanitize("foo") attribute.

This fixes a crash when AST pretty printing declarations marked with no_sanitize_memory.

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

5 years agoFix BUILD_SHARED_LIBS for clang which broke in D61909
Chris Bieneman [Tue, 21 May 2019 15:56:17 +0000 (15:56 +0000)]
Fix BUILD_SHARED_LIBS for clang which broke in D61909

llvm_add_library ignores `BUILD_SHARED_LIBS` `STATIC` is explicitly specified. This restores the `BUILD_SHARED_LIBS` behavior to the clang build.

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

5 years ago[OPENMP][NVPTX]Mark more functions as always_inline for better
Alexey Bataev [Tue, 21 May 2019 15:11:58 +0000 (15:11 +0000)]
[OPENMP][NVPTX]Mark more functions as always_inline for better
performance.

Internally generated functions must be marked as always_inlines in most
cases. Patch marks some extra reduction function + outlined parallel
functions as always_inline for better performance, but only if the
optimization is requested.

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

5 years agoAdd support for dumping AST comment nodes to JSON.
Aaron Ballman [Tue, 21 May 2019 14:38:29 +0000 (14:38 +0000)]
Add support for dumping AST comment nodes to JSON.

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

5 years ago[Syntax] Rename TokensTest to SyntaxTests. NFC
Ilya Biryukov [Tue, 21 May 2019 14:37:41 +0000 (14:37 +0000)]
[Syntax] Rename TokensTest to SyntaxTests. NFC

To be more consistent with conventions used in the codebase. The new
name will be a better fit when more bits of the syntax library land.

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

5 years ago[ARM][CMSE] Add commandline option and feature macro
Javed Absar [Tue, 21 May 2019 14:21:26 +0000 (14:21 +0000)]
[ARM][CMSE] Add commandline option and feature macro

Defines macro ARM_FEATURE_CMSE to 1 for v8-M targets and introduces
-mcmse option which for v8-M targets sets ARM_FEATURE_CMSE to 3.
A diagnostic is produced when the option is given on architectures
without support for Security Extensions.
Reviewed By: dmgreen, snidertm
Differential Revision: https://reviews.llvm.org/D59879

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

5 years ago[CodeGenModule] BlockByrefHelpers - add missing uninitialized variables to constructo...
Simon Pilgrim [Tue, 21 May 2019 11:37:54 +0000 (11:37 +0000)]
[CodeGenModule] BlockByrefHelpers - add missing uninitialized variables to constructor. NFCI.

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

5 years ago[CGBuiltin] dumpRecord - remove unused field offset. NFCI.
Simon Pilgrim [Tue, 21 May 2019 10:48:42 +0000 (10:48 +0000)]
[CGBuiltin] dumpRecord - remove unused field offset. NFCI.

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

5 years ago[libclang] visit c++14 lambda capture init expressions
Nikolai Kosjar [Tue, 21 May 2019 09:21:35 +0000 (09:21 +0000)]
[libclang] visit c++14 lambda capture init expressions

Patch by Milian Wolff.

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

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

5 years ago[Preamble] Reuse preamble even if an unsaved file does not exist
Nikolai Kosjar [Tue, 21 May 2019 07:26:59 +0000 (07:26 +0000)]
[Preamble] Reuse preamble even if an unsaved file does not exist

When a preamble is created an unsaved file not existing on disk is
already part of PrecompiledPreamble::FilesInPreamble. However, when
checking whether the preamble can be re-used, a failed stat of such an
unsaved file invalidated the preamble, which led to pointless and time
consuming preamble regenerations on subsequent reparses.

Do not require anymore that unsaved files should exist on disk.

This avoids costly preamble invalidations depending on timing issues for
the cases where the file on disk might be removed just to be regenerated
a bit later.

It also allows an IDE to provide in-memory files that might not exist on
disk, e.g. because the build system hasn't generated those yet.

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

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

5 years agoTry to fix build with older gccs after r361152
Nico Weber [Tue, 21 May 2019 00:27:26 +0000 (00:27 +0000)]
Try to fix build with older gccs after r361152

Also merge the cmake change there to the gn build.

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

5 years agoGive 'fixit-cxx0x.cpp' a more modern name.
Richard Smith [Mon, 20 May 2019 23:37:18 +0000 (23:37 +0000)]
Give 'fixit-cxx0x.cpp' a more modern name.

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

5 years ago[Sema] Fix for build on some iOS programs.
Leonard Chan [Mon, 20 May 2019 22:42:19 +0000 (22:42 +0000)]
[Sema] Fix for build on some iOS programs.

Nullability attributes weren't being stripped for AttributedTypes that
were wrapped in a MacroQualifiedType. This fix adds a check for this
type and a test.

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

5 years agoAdd more tests for AST JSON output; NFC.
Aaron Ballman [Mon, 20 May 2019 20:01:45 +0000 (20:01 +0000)]
Add more tests for AST JSON output; NFC.

This adds tests for dumping expressions in C. It also updates a comment to note an issue to be fixed with printing character literals discovered as part of this testing.

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

5 years ago[X86] Check the alignment argument for the masked.load/store for the _mm_mask_store_s...
Craig Topper [Mon, 20 May 2019 18:48:31 +0000 (18:48 +0000)]
[X86] Check the alignment argument for the masked.load/store for the _mm_mask_store_ss/sd and _mm_mask(z)_load_ss/sd intrinsics.

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

5 years ago[CMake] Update DistributionExample for mono repo
Chris Bieneman [Mon, 20 May 2019 18:10:20 +0000 (18:10 +0000)]
[CMake] Update DistributionExample for mono repo

This just updates the DistributionExamples from my 2016 Dev Meeting talk to work more seamlessly with the monorepo.

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

5 years agoRearrange and clean up how we disambiguate lambda-introducers from ObjC
Richard Smith [Mon, 20 May 2019 18:01:54 +0000 (18:01 +0000)]
Rearrange and clean up how we disambiguate lambda-introducers from ObjC
message sends, designators, and attributes.

Instead of having the tentative parsing phase sometimes return an
indicator to say what diagnostic to produce if parsing fails and
sometimes ask the caller to run it again, consistently ask the caller to
try parsing again if tentative parsing would fail or is otherwise unable
to completely parse the lambda-introducer without producing an
irreversible semantic effect.

Mostly NFC, but we should recover marginally better in some error cases
(avoiding duplicate diagnostics).

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

5 years agoDump macro expansion information as needed when outputting the AST to JSON.
Aaron Ballman [Mon, 20 May 2019 16:46:44 +0000 (16:46 +0000)]
Dump macro expansion information as needed when outputting the AST to JSON.

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

5 years agoRenamed `apply` to `select` to avoid ADL conflict with `std::apply`
Dmitri Gribenko [Mon, 20 May 2019 16:30:49 +0000 (16:30 +0000)]
Renamed `apply` to `select` to avoid ADL conflict with `std::apply`

Summary:
`std::apply` in C++14 and above is defined with two unrestricted arguments, and
it wins overload resolution in this case.

Reviewers: ilya-biryukov

Subscribers: cfe-commits, ymandel

Tags: #clang

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

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

5 years ago[Intrinsics] Merge lround.i32 and lround.i64 into a single intrinsic with overloaded...
Craig Topper [Mon, 20 May 2019 16:27:09 +0000 (16:27 +0000)]
[Intrinsics] Merge lround.i32 and lround.i64 into a single intrinsic with overloaded result type. Make result type for llvm.llround overloaded instead of fixing to i64

We shouldn't really make assumptions about possible sizes for long and long long. And longer term we should probably support vectorizing these intrinsics. By making the result types not fixed we can support vectors as well.

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

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

5 years agoFix test not to use UNSUPPORTED as a FileCheck prefix.
Paul Robinson [Mon, 20 May 2019 14:57:18 +0000 (14:57 +0000)]
Fix test not to use UNSUPPORTED as a FileCheck prefix.
It was not causing a problem but it's not good practice.

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

5 years ago[LibTooling] Fix build break in test after r361152.
Yitzhak Mandelbaum [Mon, 20 May 2019 14:44:40 +0000 (14:44 +0000)]
[LibTooling] Fix build break in test after r361152.

r361152 broke gcc builds.

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

5 years ago[LibTooling] Add RangeSelector library for defining source ranges based on bound...
Yitzhak Mandelbaum [Mon, 20 May 2019 13:15:14 +0000 (13:15 +0000)]
[LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

Summary:

The RangeSelector library defines a combinator language for specifying source
ranges based on bound ids for AST nodes.  The combinator approach follows the
design of the AST matchers.  The RangeSelectors defined here will be used in
both RewriteRule, for specifying source affected by edit, and in Stencil for
specifying source to use constructively in a replacement.

Reviewers: ilya-biryukov

Subscribers: mgorny, cfe-commits

Tags: #clang

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

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

5 years ago[Syntax] Introduce TokenBuffer, start clangToolingSyntax library
Ilya Biryukov [Mon, 20 May 2019 13:00:42 +0000 (13:00 +0000)]
[Syntax] Introduce TokenBuffer, start clangToolingSyntax library

Summary:
TokenBuffer stores the list of tokens for a file obtained after
preprocessing. This is a base building block for syntax trees,
see [1] for the full proposal on syntax trees.

This commits also starts a new sub-library of ClangTooling, which
would be the home for the syntax trees and syntax-tree-based refactoring
utilities.

[1]: https://lists.llvm.org/pipermail/cfe-dev/2019-February/061414.html

Reviewers: gribozavr, sammccall

Reviewed By: sammccall

Subscribers: mgrang, riccibruno, Eugene.Zelenko, mgorny, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years agoFix compilation warning about unused variable [NFC]
Mikael Holmen [Mon, 20 May 2019 11:38:33 +0000 (11:38 +0000)]
Fix compilation warning about unused variable [NFC]

Without the fix at least clang 3.6 complains with

../tools/clang/lib/AST/ExprConstant.cpp:90:24: error: unused variable 'TI' [-Werror,-Wunused-variable]
    if (TypeInfoLValue TI = B.dyn_cast<TypeInfoLValue>())
                       ^
1 error generated.

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

5 years ago[Analyzer] Refactor begin and end symbol creation
Adam Balogh [Mon, 20 May 2019 11:04:27 +0000 (11:04 +0000)]
[Analyzer] Refactor begin and end symbol creation

This patch refactors begin and end symbol creation by moving symbol
conjuration into the `create...` functions. This way the functions'
responsibilities are clearer and makes possible to add more functions
handling these symbols (e.g. functions for handling the container's
size) without code multiplication.

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

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

5 years ago[ASTImporter] Enable disabled but passing tests
Gabor Marton [Mon, 20 May 2019 10:38:14 +0000 (10:38 +0000)]
[ASTImporter] Enable disabled but passing tests

Reviewers: a_sidorin, a.sidorin, shafik

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

Tags: #clang

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

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

5 years agoFix buildbot: Use correct Consume*() for braces.
Nicolas Lesser [Sun, 19 May 2019 15:30:00 +0000 (15:30 +0000)]
Fix buildbot: Use correct Consume*() for braces.

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

5 years agoAdded a better diagnostic when using the delete operator with lambdas
Nicolas Lesser [Sun, 19 May 2019 15:07:58 +0000 (15:07 +0000)]
Added a better diagnostic when using the delete operator with lambdas

Summary:
This adds a new error for missing parentheses around lambdas in delete operators.

```
int main() {
  delete []() { return new int(); }();
}
```

This will result in:

```
test.cpp:2:3: error: '[]' after delete interpreted as 'delete[]'
  delete []() { return new int(); }();
  ^~~~~~~~~
test.cpp:2:9: note: add parentheses around the lambda
  delete []() { return new int(); }();
        ^
        (                          )
```

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: riccibruno, cfe-commits

Tags: #clang

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

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

5 years agoAdd a Visit overload for DynTypedNode to ASTNodeTraverser
Stephen Kelly [Sun, 19 May 2019 13:03:48 +0000 (13:03 +0000)]
Add a Visit overload for DynTypedNode to ASTNodeTraverser

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[AVR] Automatically link CRT and libgcc from the system avr-gcc
Dylan McKay [Sun, 19 May 2019 09:54:14 +0000 (09:54 +0000)]
[AVR] Automatically link CRT and libgcc from the system avr-gcc

Summary:
This patch modifies the AVR toolchain so that if avr-gcc and avr-libc
are detected during compilation, the CRT, libgcc, libm, and libc anre
linked.

This matches avr-gcc's default behaviour, and the expected behaviour of
all C compilers - including the C runtime.

avr-gcc also needs a -mmcu specified in order to link runtime libraries.

The difference betwen this patch and avr-gcc is that this patch will
warn users whenever they compile without a runtime, as opposed to GCC,
which silently trims the runtime libs from the linker arguments when no
-mmcu is specified.

Reviewers: aaron.ballman, kparzysz, asb, hfinkel, brucehoult, TimNN

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[X86] Remove semicolons at the end of intrinsics implemented as macros so they can...
Craig Topper [Sun, 19 May 2019 01:01:52 +0000 (01:01 +0000)]
[X86] Remove semicolons at the end of intrinsics implemented as macros so they can be used as arguments to other intrinsics.

Also fix one intrinsic that was using variable names without underscores.

Fixes PR41932

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

5 years ago[analyzer] PR41753: Include complex integer types in NonLoc::isCompoundType
Kristof Umann [Sat, 18 May 2019 12:34:08 +0000 (12:34 +0000)]
[analyzer] PR41753: Include complex integer types in NonLoc::isCompoundType

https://bugs.llvm.org/show_bug.cgi?id=41753

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

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

5 years agoScalarExprEmitter::EmitCompoundAssign - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Sat, 18 May 2019 12:17:15 +0000 (12:17 +0000)]
ScalarExprEmitter::EmitCompoundAssign - fix uninitialized variable warning. NFCI.

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

5 years agoMIGChecker - assert we have a non-null LocationContext. NFCI.
Simon Pilgrim [Sat, 18 May 2019 11:42:19 +0000 (11:42 +0000)]
MIGChecker - assert we have a non-null LocationContext. NFCI.

Fixes scan-build warning.

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

5 years agoASTNodeImporter - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sat, 18 May 2019 11:33:27 +0000 (11:33 +0000)]
ASTNodeImporter - fix uninitialized variable warnings. NFCI.

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

5 years ago[c++20] P1327R1: Support for typeid applied to objects of polymorphic
Richard Smith [Fri, 17 May 2019 19:19:28 +0000 (19:19 +0000)]
[c++20] P1327R1: Support for typeid applied to objects of polymorphic
class type in constant evaluation.

This reinstates r360977, reverted in r360987, now that its rerequisite
patch is reinstated and fixed.

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

5 years ago[OpenMP][bugfix] Add missing math functions variants for log and abs.
Gheorghe-Teodor Bercea [Fri, 17 May 2019 19:15:53 +0000 (19:15 +0000)]
[OpenMP][bugfix] Add missing math functions variants for log and abs.

Summary: When including the random header in C++, some of the math functions it relies on are not present in the CUDA headers. We include this variants in this case.

Reviewers: jdoerfert, hfinkel, tra, caomhin

Reviewed By: tra

Subscribers: efriedma, guansong, cfe-commits

Tags: #clang

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

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

5 years agoAdd more tests for AST JSON output; NFC.
Aaron Ballman [Fri, 17 May 2019 19:14:01 +0000 (19:14 +0000)]
Add more tests for AST JSON output; NFC.

This adds tests for dumping records and statements.

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

5 years agoRevert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"
Nico Weber [Fri, 17 May 2019 18:31:24 +0000 (18:31 +0000)]
Revert r361033 "Add a Visit overload for DynTypedNode to ASTNodeTraverser"

It fails to build on some bots.

Also revert follow-up r361055.

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

5 years agoAttempt to fix test on Windows after r360998
Nico Weber [Fri, 17 May 2019 17:33:54 +0000 (17:33 +0000)]
Attempt to fix test on Windows after r360998

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

5 years agoAdded an assertion to constant evaluation enty points that prohibits dependent expres...
Dmitri Gribenko [Fri, 17 May 2019 17:16:53 +0000 (17:16 +0000)]
Added an assertion to constant evaluation enty points that prohibits dependent expressions

Summary:
Constant evaluator does not work on value-dependent or type-dependent
expressions.

Also fixed bugs uncovered by these assertions.

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[analyzer] Remove the default value arg from getChecker*Option
Kristof Umann [Fri, 17 May 2019 15:52:13 +0000 (15:52 +0000)]
[analyzer] Remove the default value arg from getChecker*Option

Since D57922, the config table contains every checker option, and it's default
value, so having it as an argument for getChecker*Option is redundant.

By the time any of the getChecker*Option function is called, we verified the
value in CheckerRegistry (after D57860), so we can confidently assert here, as
any irregularities detected at this point must be a programmer error. However,
in compatibility mode, verification won't happen, so the default value must be
restored.

This implies something else, other than adding removing one more potential point
of failure -- debug.ConfigDumper will always contain valid values for
checker/package options!

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

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

5 years ago[LibTooling] Add support to Transformer for composing rules as an ordered choice.
Yitzhak Mandelbaum [Fri, 17 May 2019 14:23:33 +0000 (14:23 +0000)]
[LibTooling] Add support to Transformer for composing rules as an ordered choice.

This revision updates `RewriteRule` to support multiple subrules that are
interpreted as an ordered-choice (apply the first one that matches). With this
feature, users can write the rules that appear later in the list of subrules
knowing that previous rules' patterns *have not matched*, freeing them from
reasoning about those cases in the current pattern.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoExtract ASTDumper to a header file
Stephen Kelly [Fri, 17 May 2019 13:59:15 +0000 (13:59 +0000)]
Extract ASTDumper to a header file

Summary:
This class has member APIs which are useful to clients.  Make it
possible to use those APIs without adding them to dump() member
functions.  Doing so does not scale.  The optional arguments to dump()
should be designed to be useful in a debugging context.

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoAdd a Visit overload for DynTypedNode to ASTNodeTraverser
Stephen Kelly [Fri, 17 May 2019 13:55:28 +0000 (13:55 +0000)]
Add a Visit overload for DynTypedNode to ASTNodeTraverser

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

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