]> granicus.if.org Git - clang/log
clang
5 years agoAMDGPU: Fix target builtins for gfx10
Matt Arsenault [Sat, 22 Jun 2019 01:30:00 +0000 (01:30 +0000)]
AMDGPU: Fix target builtins for gfx10

This wasn't setting some of the features from older generations.

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

5 years ago[ODRHash] Skip some typedef types.
Richard Trieu [Sat, 22 Jun 2019 00:32:19 +0000 (00:32 +0000)]
[ODRHash] Skip some typedef types.

In some cases, a typedef only strips aways a keyword for a type, keeping the
same name as the root record type.  This causes some confusion when the type
is defined in one modules but only forward declared in another.  Skipping the
typedef and going straight to the record will avoid this issue.

typedef struct S {} S;
S* s;  // S is TypedefType here

struct S;
S* s;  // S is RecordType here

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

5 years agoRemove binary finally accidentially committed in r364109
Erich Keane [Fri, 21 Jun 2019 22:31:59 +0000 (22:31 +0000)]
Remove binary finally accidentially committed in r364109

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

5 years agoEnsure Target Features always_inline error happens in C++ cases.
Erich Keane [Fri, 21 Jun 2019 22:29:32 +0000 (22:29 +0000)]
Ensure Target Features always_inline error happens in C++ cases.

A handful of C++ cases as reported in PR42352 didn't actually give an
error when always_inlining with a different target feature list. This
resulted in broken IR.

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

5 years agoFix has_attribute.cpp test on Windows after r364102
Reid Kleckner [Fri, 21 Jun 2019 22:28:52 +0000 (22:28 +0000)]
Fix has_attribute.cpp test on Windows after r364102

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

5 years agoclang-format a block; NFC
George Burgess IV [Fri, 21 Jun 2019 20:49:47 +0000 (20:49 +0000)]
clang-format a block; NFC

The indentation of the return here was off, and confusing as a result.
Cleaned up a bit extra while I was in the area.

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

5 years agoPR42301: Abort cleanly if we encounter a huge source file rather than
Richard Smith [Fri, 21 Jun 2019 20:46:22 +0000 (20:46 +0000)]
PR42301: Abort cleanly if we encounter a huge source file rather than
crashing.

Ideally we wouldn't care about the size of a file so long as it fits in
memory, but in practice we have lots of hardocded assumptions that
unsigned can be used to index files, string literals, and so on.

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

5 years agoFix __has_cpp_attribute expansion to produce trailing L and (where
Richard Smith [Fri, 21 Jun 2019 20:20:21 +0000 (20:20 +0000)]
Fix __has_cpp_attribute expansion to produce trailing L and (where
necessary) leading whitespace.

Simplify unit test and extend to cover no_unique_address attribute.

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

5 years agoDevirtualize destructor of final class.
Hiroshi Yamauchi [Fri, 21 Jun 2019 20:04:29 +0000 (20:04 +0000)]
Devirtualize destructor of final class.

Summary:
Take advantage of the final keyword to devirtualize destructor calls.

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

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: davidxl, Prazek, cfe-commits

Tags: #clang

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

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

5 years agoRevert [test][Driver] Fix Clang :: Driver/cl-response-file.c
Reid Kleckner [Fri, 21 Jun 2019 18:33:20 +0000 (18:33 +0000)]
Revert [test][Driver] Fix Clang :: Driver/cl-response-file.c

This reverts r363985 (git commit d5f16d6cfccc4b0b13b6c01d16c673886d53e695)

This test can't use printf on Windows because the path contains
backslashes which must not be interpreted as escapes by printf.

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

5 years ago[clang-scan-deps] print the dependencies to stdout
Alex Lorenz [Fri, 21 Jun 2019 18:24:55 +0000 (18:24 +0000)]
[clang-scan-deps] print the dependencies to stdout
and remove the need to use -MD options in the CDB

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

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

5 years agoFix ARM buildbot.
Richard Smith [Fri, 21 Jun 2019 17:41:20 +0000 (17:41 +0000)]
Fix ARM buildbot.

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

5 years ago[OPENMP]Fix PR42068: Vla type is not captured.
Alexey Bataev [Fri, 21 Jun 2019 17:28:41 +0000 (17:28 +0000)]
[OPENMP]Fix PR42068: Vla type is not captured.

If the variably modified type is declared outside of the captured region
and then used in the cast expression along with array subscript
expression, the type is not captured and it leads to the compiler crash.

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

5 years agoEnsure that top-level QualType objects also have a "kind" field when dumping the...
Aaron Ballman [Fri, 21 Jun 2019 17:14:25 +0000 (17:14 +0000)]
Ensure that top-level QualType objects also have a "kind" field when dumping the AST to JSON.

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

5 years ago[OpenCL][PR41963] Add generic addr space to old atomics in C++ mode
Anastasia Stulova [Fri, 21 Jun 2019 16:19:16 +0000 (16:19 +0000)]
[OpenCL][PR41963] Add generic addr space to old atomics in C++ mode

Add overloads with generic address space pointer to old atomics.
This is currently only added for C++ compilation mode.

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

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

5 years agoPrint more type node information when dumping the AST to JSON.
Aaron Ballman [Fri, 21 Jun 2019 16:06:09 +0000 (16:06 +0000)]
Print more type node information when dumping the AST to JSON.

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

5 years ago[clang][NewPM] Add -fno-experimental-new-pass-manager to tests
Leonard Chan [Fri, 21 Jun 2019 16:03:06 +0000 (16:03 +0000)]
[clang][NewPM] Add -fno-experimental-new-pass-manager to tests

As per the discussion on D58375, we disable test that have optimizations under
the new PM. This patch adds -fno-experimental-new-pass-manager to RUNS that:

- Already run with optimizations (-O1 or higher) that were missed in D58375.
- Explicitly test new PM behavior along side some new PM RUNS, but are missing
  this flag if new PM is enabled by default.
- Specify -O without the number. Based on getOptimizationLevel(), it seems the
  default is 2, and the IR appears to be the same when changed to -O2, so
  update the test to explicitly say -O2 and provide -fno-experimental-new-pass-manager`.

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

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

5 years ago[OPENMP]Fix PR42159: do not capture threadprivate variables.
Alexey Bataev [Fri, 21 Jun 2019 15:08:30 +0000 (15:08 +0000)]
[OPENMP]Fix PR42159: do not capture threadprivate variables.

The threadprivate variables should not be captured in the outlined
regions, otherwise it leads to the compiler crash.

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

5 years agoAdd an automated note to files produced by gen_ast_dump_json_test.py.
Aaron Ballman [Fri, 21 Jun 2019 14:37:39 +0000 (14:37 +0000)]
Add an automated note to files produced by gen_ast_dump_json_test.py.

This also details what filters, if any, were used to generate the test output. Updates all the current JSON testing files to include the automated note.

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

5 years agoPrint information about various type nodes when dumping the AST to JSON.
Aaron Ballman [Fri, 21 Jun 2019 13:22:35 +0000 (13:22 +0000)]
Print information about various type nodes when dumping the AST to JSON.

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

5 years agoFix test/AST/ast-dump-records-json.cpp after ConstantExpr change in D63376
Fangrui Song [Fri, 21 Jun 2019 11:39:41 +0000 (11:39 +0000)]
Fix test/AST/ast-dump-records-json.cpp after ConstantExpr change in D63376

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

5 years ago[Sema] Fix diagnostic for addr spaces in reference binding
Anastasia Stulova [Fri, 21 Jun 2019 11:36:15 +0000 (11:36 +0000)]
[Sema] Fix diagnostic for addr spaces in reference binding

Extend reference binding behavior to account for address spaces.

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

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

5 years ago[Sema] Improved diagnostic for qualifiers in reference binding
Anastasia Stulova [Fri, 21 Jun 2019 10:50:02 +0000 (10:50 +0000)]
[Sema] Improved diagnostic for qualifiers in reference binding

Improved wording and also simplified by using printing
method from qualifiers.

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

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

5 years ago[cmake] Add llvm-dwarfdump to clang test dependencies
Sven van Haastregt [Fri, 21 Jun 2019 10:26:20 +0000 (10:26 +0000)]
[cmake] Add llvm-dwarfdump to clang test dependencies

Commit r363496 ("[Clang] Harmonize Split DWARF options with llc",
2019-06-15) introduced the use of llvm-dwarfdump in the clang tests,
so ensure the clang tests are dependent on llvm-dwarfdump.

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

5 years ago[OpenCL] Remove duplicate read_image declarations
Sven van Haastregt [Fri, 21 Jun 2019 10:26:10 +0000 (10:26 +0000)]
[OpenCL] Remove duplicate read_image declarations

Patch by Pierre Gondois.

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

5 years ago[RISC-V] Add -msave-restore and -mno-save-restore to clang driver
Sam Elliott [Fri, 21 Jun 2019 10:03:31 +0000 (10:03 +0000)]
[RISC-V] Add -msave-restore and -mno-save-restore to clang driver

Summary:
The GCC RISC-V toolchain accepts `-msave-restore` and `-mno-save-restore`
to control whether libcalls are used for saving and restoring the stack within
prologues and epilogues.

Clang currently errors if someone passes -msave-restore or -mno-save-restore.
This means that people need to change build configurations to use clang. This
patch adds these flags, so that clang invocations can now match gcc.

As the RISC-V backend does not currently have a `save-restore` target feature,
we emit a warning if someone requests `-msave-restore`. LLVM does not error if
we pass the (unimplemented) target features `+save-restore` or `-save-restore`.

Reviewers: asb, luismarques

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, cfe-commits

Tags: #clang

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

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

5 years ago[git-clang-format] recognize hxx as a C++ file
Miklos Vajna [Fri, 21 Jun 2019 09:49:38 +0000 (09:49 +0000)]
[git-clang-format] recognize hxx as a C++ file

clangd, clang-tidy, etc does that already, no reason why
git-clang-format should skip hxx files.

Reviewed By: ilya-biryukov

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

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

5 years ago[clang] Small improvments after Adding APValue to ConstantExpr
Gauthier Harnisch [Fri, 21 Jun 2019 08:26:21 +0000 (08:26 +0000)]
[clang] Small improvments after Adding APValue to ConstantExpr

Summary:
this patch has multiple small improvements related to the APValue in ConstantExpr.

changes:
 - APValue in ConstantExpr are now cleaned up using ASTContext::addDestruction instead of there own system.
 - ConstantExprBits Stores the ValueKind of the result beaing stored.
 - VerifyIntegerConstantExpression now stores the evaluated value in ConstantExpr.
 - the Constant Evaluator uses the stored value of ConstantExpr when available.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[CodeGen][test] Use FileCheck variable matchers for better test support
Jordan Rupprecht [Thu, 20 Jun 2019 22:35:52 +0000 (22:35 +0000)]
[CodeGen][test] Use FileCheck variable matchers for better test support

Summary: Depending on how clang is built, it may discard the IR names and use names like `%2` instead of `%result.ptr`, causing tests that rely on the IR name to fail. Using FileCheck matchers makes the test work regardless of how clang is built.

This test passes with both `-fno-discard-value-names` and `-fdiscard-value-names` to make sure it passes regardless of the build mode.

Reviewers: rnk, akhuang, aprantl, lebedev.ri

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[analyzer] DeadStores: Update the crude suppression for files generated by IIG.
Artem Dergachev [Thu, 20 Jun 2019 22:29:40 +0000 (22:29 +0000)]
[analyzer] DeadStores: Update the crude suppression for files generated by IIG.

They changed the comments that we were looking for.

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

5 years ago[X86] Change LL to O in the definitions for the vp2intersect builtins.
Craig Topper [Thu, 20 Jun 2019 22:19:16 +0000 (22:19 +0000)]
[X86] Change LL to O in the definitions for the vp2intersect builtins.

This is needed to support OpenCL where long long is 128 bits.

This was done for the other builtins already, but I think
vp2intersect was in phabricator at the time.

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

5 years agoPrint information about various ObjC expression nodes when dumping the AST to JSON.
Aaron Ballman [Thu, 20 Jun 2019 21:45:31 +0000 (21:45 +0000)]
Print information about various ObjC expression nodes when dumping the AST to JSON.

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

5 years agoAMDGPU: Add DS GWS sema builtins
Matt Arsenault [Thu, 20 Jun 2019 21:33:57 +0000 (21:33 +0000)]
AMDGPU: Add DS GWS sema builtins

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

5 years ago[test][Driver] Fix Clang :: Driver/cl-response-file.c
Rainer Orth [Thu, 20 Jun 2019 21:33:09 +0000 (21:33 +0000)]
[test][Driver] Fix Clang :: Driver/cl-response-file.c

Clang :: Driver/cl-response-file.c currently FAILs on Solaris:

  Command Output (stderr):
  --
  /vol/llvm/src/clang/dist/test/Driver/cl-response-file.c:10:11: error: CHECK: expected string not found in input
  // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"
            ^

Looking at the generated response file reveals that this is no surprise:

  /I/vol/llvm/src/clang/dist/test/Driver\Inputs

with no newline at the end.  The echo command used to create it boils down to

  echo 'a\cb'

However, one cannot expect \c to be emitted literally: e.g. bash's builtin
echo has

  \c        suppress further output

I've tried various combinations of builtin echo, /usr/bin/echo, GNU echo if
different, the same for printf, and the backslash unescaped and quoted
(a\cb and a\\cb).  The only combination that worked reliably on Solaris,
Linux, and macOS was

  printf 'a\\cb'

so this is what this patch uses.  Tested on amd64-pc-solaris2.11 and
x86_64-pc-linux-gnu.

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

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

5 years agoRename CodeGenFunction::overlapFor* to getOverlapFor*.
Richard Smith [Thu, 20 Jun 2019 20:56:20 +0000 (20:56 +0000)]
Rename CodeGenFunction::overlapFor* to getOverlapFor*.

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

5 years agoP0840R2: support for [[no_unique_address]] attribute
Richard Smith [Thu, 20 Jun 2019 20:44:45 +0000 (20:44 +0000)]
P0840R2: support for [[no_unique_address]] attribute

Summary:
Add support for the C++2a [[no_unique_address]] attribute for targets using the Itanium C++ ABI.

This depends on D63371.

Reviewers: rjmccall, aaron.ballman

Subscribers: dschuff, aheejin, cfe-commits

Tags: #clang

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

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

5 years ago[clang-tidy] Fail gracefully upon empty database fields
Serge Guelton [Thu, 20 Jun 2019 20:25:59 +0000 (20:25 +0000)]
[clang-tidy] Fail gracefully upon empty database fields

Fix bz#42281

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

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

5 years agoFix passing structs and AVX vectors through sysv_abi
Reid Kleckner [Thu, 20 Jun 2019 20:07:20 +0000 (20:07 +0000)]
Fix passing structs and AVX vectors through sysv_abi

Do this the same way we did it for ms_abi in r324594.

Fixes PR36806.

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

5 years agoFix crash and rejects-valid when a later template parameter or default
Richard Smith [Thu, 20 Jun 2019 19:49:13 +0000 (19:49 +0000)]
Fix crash and rejects-valid when a later template parameter or default
template argument contains a backreference to a dependently-typed
earlier parameter.

In a case like:
  template<typename T, T A, decltype(A) = A> struct X {};
  template<typename U> auto Y = X<U, 0>();
we previously treated both references to `A` in the third parameter as
being of type `int` when checking the template-id in `Y`. That`s wrong;
the type of `A` in these contexts is the dependent type `U`.

When we encounter a non-type template argument that we can't convert to
the parameter type because of type-dependence, we now insert a dependent
conversion node so that the SubstNonTypeTemplateParmExpr for the
template argument will have the parameter's type rather than whatever
type the argument had.

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

5 years ago[clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs
Leonard Chan [Thu, 20 Jun 2019 19:44:51 +0000 (19:44 +0000)]
[clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs

This fixes CodeGen/available-externally-suppress.c when the new pass manager is
turned on by default. available_externally was not emitted during -O2 -flto
runs when it should still be retained for link time inlining purposes. This can
be fixed by checking that we aren't LTOPrelinking when adding the
EliminateAvailableExternallyPass.

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

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

5 years ago[clang][NewPM] Move EntryExitInstrumenterPass to the start of the pipeline
Leonard Chan [Thu, 20 Jun 2019 19:35:25 +0000 (19:35 +0000)]
[clang][NewPM] Move EntryExitInstrumenterPass to the start of the pipeline

This fixes CodeGen/x86_64-instrument-functions.c when running under the new
pass manager. The pass should go before any other pass to prevent
`__cyg_profile_func_enter/exit()` from not being emitted by inlined functions.

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

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

5 years agoPrint additional information about @encode expressions when dumping the AST to JSON.
Aaron Ballman [Thu, 20 Jun 2019 19:11:35 +0000 (19:11 +0000)]
Print additional information about @encode expressions when dumping the AST to JSON.

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

5 years agoPrint additional information on dependent scopes when dumping the AST to JSON.
Aaron Ballman [Thu, 20 Jun 2019 18:55:53 +0000 (18:55 +0000)]
Print additional information on dependent scopes when dumping the AST to JSON.

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

5 years ago[NFC] Fix for InterfaceStubs tests (adding REQUIRES: x86-registered-target).
Puyan Lotfi [Thu, 20 Jun 2019 18:28:21 +0000 (18:28 +0000)]
[NFC] Fix for InterfaceStubs tests (adding REQUIRES: x86-registered-target).

clang-hexagon-elf bot was failing with:

'No available targets are compatible with triple "x86_64-unknown-linux-gnu"'

Adding a "// REQUIRES: x86-registered-target" to these tests to quiet the bot.

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

5 years ago[X86] Make _mm_mask_cvtps_ph, _mm_maskz_cvtps_ph, _mm256_mask_cvtps_ph, and _mm256_ma...
Craig Topper [Thu, 20 Jun 2019 18:24:29 +0000 (18:24 +0000)]
[X86] Make _mm_mask_cvtps_ph, _mm_maskz_cvtps_ph, _mm256_mask_cvtps_ph, and _mm256_maskz_cvtps_ph aliases for their corresponding cvt_roundps_ph intrinsic.

These intrinsics should always take an immediate for the rounding mode.
The base instruction comes from before EVEX embdedded rounding. The
user should always provide the immediate rather than us assuming
CUR_DIRECTION.

Make the 512-bit versions also explicit aliases instead of copy
pasting the code.

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

5 years ago[OpenMP] Add support for handling declare target to clause when unified memory is...
Gheorghe-Teodor Bercea [Thu, 20 Jun 2019 18:04:47 +0000 (18:04 +0000)]
[OpenMP] Add support for handling declare target to clause when unified memory is required

Summary:
This patch adds support for the handling of the variables under the declare target to clause.

The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer.

Reviewers: ABataev, AlexEichenberger, caomhin

Reviewed By: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years agoStore a pointer to the return value in a static alloca and let the debugger use that
Amy Huang [Thu, 20 Jun 2019 17:15:21 +0000 (17:15 +0000)]
Store a pointer to the return value in a static alloca and let the debugger use that
as the variable address for NRVO variables.

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[clang-ifs] Clang Interface Stubs, first version (second landing attempt).
Puyan Lotfi [Thu, 20 Jun 2019 16:59:48 +0000 (16:59 +0000)]
[clang-ifs] Clang Interface Stubs, first version (second landing attempt).

This change reverts r363649; effectively re-landing r363626. At this point
clang::Index::CodegenNameGeneratorImpl has been refactored into
clang::AST::ASTNameGenerator. This makes it so that the previous circular link
dependency no longer exists, fixing the previous share lib
(-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649.

Clang interface stubs (previously referred to as clang-ifsos) is a new frontend
action in clang that allows the generation of stub files that contain mangled
name info that can be used to produce a stub library. These stub libraries can
be useful for breaking up build dependencies and controlling access to a
library's internal symbols. Generation of these stubs can be invoked by:

clang -fvisibility=<visibility> -emit-interface-stubs \
                                -interface-stub-version=<interface format>

Notice that -fvisibility (along with use of visibility attributes) can be used
to control what symbols get generated. Currently the interface format is
experimental but there are a wide range of possibilities here.

Currently clang-ifs produces .ifs files that can be thought of as analogous to
object (.o) files, but just for the mangled symbol info. In a subsequent patch
I intend to add support for merging the .ifs files into one .ifs/.ifso file
that can be the input to something like llvm-elfabi to produce something like a
.so file or .dll (but without any of the code, just symbols).

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

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

5 years ago[Sema] Diagnose addr space mismatch while constructing objects
Anastasia Stulova [Thu, 20 Jun 2019 16:23:28 +0000 (16:23 +0000)]
[Sema] Diagnose addr space mismatch while constructing objects

If we construct an object in some arbitrary non-default addr space
it should fail unless either:
- There is an implicit conversion from the address space to default
/generic address space.
- There is a matching ctor qualified with an address space that is
either exactly matching or convertible to the address space of an
object.

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

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

5 years agoDump more information about expressions involving temporaries when dumping the AST...
Aaron Ballman [Thu, 20 Jun 2019 16:22:35 +0000 (16:22 +0000)]
Dump more information about expressions involving temporaries when dumping the AST to JSON.

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

5 years agoAIX system headers need stdint.h and inttypes.h to be re-enterable
Xing Xue [Thu, 20 Jun 2019 15:36:32 +0000 (15:36 +0000)]
AIX system headers need stdint.h and inttypes.h to be re-enterable

Summary:
AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX.

Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF

Reviewed by: hubert.reinterpretcast, mclow.lists

Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits

Tags: #LLVM, #clang, #libc++

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

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

5 years agoRemoving a helper function that was trivial to inline into its only use; NFC.
Aaron Ballman [Thu, 20 Jun 2019 15:10:45 +0000 (15:10 +0000)]
Removing a helper function that was trivial to inline into its only use; NFC.

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

5 years agoAdd test cases for explicit casts when dumping the AST to JSON; NFC.
Aaron Ballman [Thu, 20 Jun 2019 15:04:24 +0000 (15:04 +0000)]
Add test cases for explicit casts when dumping the AST to JSON; NFC.

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

5 years agoDump more information about construct expressions (resolved and unresolved) when...
Aaron Ballman [Thu, 20 Jun 2019 13:19:41 +0000 (13:19 +0000)]
Dump more information about construct expressions (resolved and unresolved) when dumping the AST to JSON.

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

5 years agoRevert "[clang] Fixing windows buildbot after D61552"
Gauthier Harnisch [Thu, 20 Jun 2019 10:34:02 +0000 (10:34 +0000)]
Revert "[clang] Fixing windows buildbot after D61552"

This reverts commit 5d5d2ca69e2b29b36db1a7dd1993ead7b7d2680f.

has already been fixed by c230eea2f349533468e14672eee94c2016476784

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

5 years ago[clang] Fixing windows buildbot after D61552
Gauthier Harnisch [Thu, 20 Jun 2019 10:27:14 +0000 (10:27 +0000)]
[clang] Fixing windows buildbot after D61552

Summary:
original review : https://reviews.llvm.org/D61552

build bot faillure : http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/110

this adds a missing definition of cxxDeductionGuideDecl.
surprisingly it was still working on linux with out it.

Reviewers: aaron.ballman

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

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

5 years ago[clang][ASTMatchers] Add definition for cxxDeductionGuideDecl introduced in rL363855
Kadir Cetinkaya [Thu, 20 Jun 2019 10:13:58 +0000 (10:13 +0000)]
[clang][ASTMatchers] Add definition for cxxDeductionGuideDecl introduced in rL363855

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

5 years ago[Testing] Dumping the graph requires assertions be enabled
David Zarzycki [Thu, 20 Jun 2019 09:58:58 +0000 (09:58 +0000)]
[Testing] Dumping the graph requires assertions be enabled

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

5 years ago[clang][AST] Refactoring ASTNameGenerator to use pimpl pattern (NFC).
Puyan Lotfi [Thu, 20 Jun 2019 06:01:06 +0000 (06:01 +0000)]
[clang][AST] Refactoring ASTNameGenerator to use pimpl pattern (NFC).

The original pimpl pattern used between CodegenNameGenerator and
CodegenNameGeneratorImpl did a good job of hiding DataLayout making it so that
users of CodegenNameGenerator did not need to link with llvm core.  This is an
NFC change to neatly wrap ASTNameGenerator in a pimpl.

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

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

5 years ago[analyzer] exploded-graph-rewriter: Implement a --diff mode.
Artem Dergachev [Wed, 19 Jun 2019 23:33:59 +0000 (23:33 +0000)]
[analyzer] exploded-graph-rewriter: Implement a --diff mode.

In this mode the tool would avoid duplicating the contents of the
program state on every node, replacing them with a diff-like dump
of changes that happened on that node.

This is useful because most of the time we only interested in whether
the effect of the statement was modeled correctly. A diffed graph would
also be much faster to load and navigate, being much smaller than
the original graph.

The diffs are computed "semantically" as opposed to plain text diffs.
I.e., the diff algorithm is hand-crafted separately for every state trait,
taking the underlying data structures into account. This is especially nice
for Environment because textual diffs would have been terrible.
On the other hand, it requires some boilerplate to implement.

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

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

5 years ago[analyzer] exploded-graph-rewriter: Fix escaping StringRegions.
Artem Dergachev [Wed, 19 Jun 2019 23:33:55 +0000 (23:33 +0000)]
[analyzer] exploded-graph-rewriter: Fix escaping StringRegions.

Quotes around StringRegions are now escaped and unescaped correctly,
producing valid JSON.

Additionally, add a forgotten escape for Store values.

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

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

5 years ago[analyzer] Fix JSON dumps for store clusters.
Artem Dergachev [Wed, 19 Jun 2019 23:33:51 +0000 (23:33 +0000)]
[analyzer] Fix JSON dumps for store clusters.

Include a unique pointer so that it was possible to figure out if it's
the same cluster in different program states. This allows comparing
dumps of different states against each other.

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

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

5 years ago[analyzer] Fix JSON dumps for location contexts.
Artem Dergachev [Wed, 19 Jun 2019 23:33:48 +0000 (23:33 +0000)]
[analyzer] Fix JSON dumps for location contexts.

Location context ID is a property of the location context, not of an item
within it. It's useful to know the id even when there are no items
in the context, eg. for the purposes of figuring out how did contents
of the Environment for the same location context changed across states.

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

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

5 years ago[analyzer] Fix JSON dumps for dynamic type information.
Artem Dergachev [Wed, 19 Jun 2019 23:33:45 +0000 (23:33 +0000)]
[analyzer] Fix JSON dumps for dynamic type information.

They're now valid JSON.

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

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

5 years ago[analyzer] NFC: Change evalCall() to provide a CallEvent.
Artem Dergachev [Wed, 19 Jun 2019 23:33:42 +0000 (23:33 +0000)]
[analyzer] NFC: Change evalCall() to provide a CallEvent.

This changes the checker callback signature to use the modern, easy to
use interface. Additionally, this unblocks future work on allowing
checkers to implement evalCall() for calls that don't correspond to any
call-expression or require additional information that's only available
as part of the CallEvent, such as C++ constructors and destructors.

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

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

5 years ago[analyzer] DeadStores: Add a crude suppression files generated by DriverKit IIG.
Artem Dergachev [Wed, 19 Jun 2019 23:33:39 +0000 (23:33 +0000)]
[analyzer] DeadStores: Add a crude suppression files generated by DriverKit IIG.

IIG is a replacement for MIG in DriverKit: IIG is autogenerating C++ code.
Suppress dead store warnings on such code, as the tool seems to be producing
them regularly, and the users of IIG are not in position to address these
warnings, as they don't control the autogenerated code. IIG-generated code
is identified by looking at the comments at the top of the file.

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

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

5 years ago[analyzer] RetainCount: Add support for OSRequiredCast().
Artem Dergachev [Wed, 19 Jun 2019 23:33:34 +0000 (23:33 +0000)]
[analyzer] RetainCount: Add support for OSRequiredCast().

It's a new API for custom RTTI in Apple IOKit/DriverKit framework that is
similar to OSDynamicCast() that's already supported, but crashes instead of
returning null (and therefore causing UB when the cast fails unexpectedly).
Kind of like cast_or_null<> as opposed to dyn_cast_or_null<> in LLVM's RTTI.

Historically, RetainCountChecker was responsible for modeling OSDynamicCast.
This is simply an extension of the same functionality.

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

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

5 years ago[X86] Correct the __min_vector_width__ attribute on a few intrinsics.
Craig Topper [Wed, 19 Jun 2019 23:27:04 +0000 (23:27 +0000)]
[X86] Correct the __min_vector_width__ attribute on a few intrinsics.

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

5 years ago[clang][AST] ASTNameGenerator: A refactoring of CodegenNameGeneratorImpl (NFC).
Puyan Lotfi [Wed, 19 Jun 2019 20:51:35 +0000 (20:51 +0000)]
[clang][AST] ASTNameGenerator: A refactoring of CodegenNameGeneratorImpl (NFC).

This is a NFC refactor move of CodegenNameGeneratorImpl from clang::Index to
clang:AST (and rename to ASTNameGenerator). The purpose is to make the
highlevel mangling code more reusable inside of clang (say in places like clang
FrontendAction). This does not affect anything in CodegenNameGenerator, except
that CodegenNameGenerator will now use ASTNameGenerator (in AST).

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

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

5 years agoPrint whether a generic selection expression is result dependent when dumping the...
Aaron Ballman [Wed, 19 Jun 2019 20:16:55 +0000 (20:16 +0000)]
Print whether a generic selection expression is result dependent when dumping the AST to JSON.

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

5 years agoReapply "r363684: AMDGPU: Add GWS instruction builtins"
Matt Arsenault [Wed, 19 Jun 2019 19:55:49 +0000 (19:55 +0000)]
Reapply "r363684: AMDGPU: Add GWS instruction builtins"

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

5 years agoPrint out the union field being initialized by an InitListExpr when dumping the AST...
Aaron Ballman [Wed, 19 Jun 2019 19:40:07 +0000 (19:40 +0000)]
Print out the union field being initialized by an InitListExpr when dumping the AST to JSON.

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

5 years agoDump the value calculated by a constant expression when dumping the AST to JSON.
Aaron Ballman [Wed, 19 Jun 2019 19:12:22 +0000 (19:12 +0000)]
Dump the value calculated by a constant expression when dumping the AST to JSON.

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

5 years agoSwitching this test to use output generated by script; NFC.
Aaron Ballman [Wed, 19 Jun 2019 19:07:52 +0000 (19:07 +0000)]
Switching this test to use output generated by script; NFC.

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

5 years ago[AST] Fixed extraneous warnings for binary conditional operator
Nathan Huckleberry [Wed, 19 Jun 2019 18:37:01 +0000 (18:37 +0000)]
[AST] Fixed extraneous warnings for binary conditional operator

Summary:
Binary conditional operator gave warnings where ternary operators
did not. They have been fixed to warn similarly to ternary operators.

Link: https://bugs.llvm.org/show_bug.cgi?id=42239
Reviewers: rsmith, aaron.ballman, nickdesaulniers

Reviewed By: rsmith, nickdesaulniers

Subscribers: srhines, cfe-commits

Tags: #clang

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

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

5 years ago[clang] Adapt ASTMatcher to explicit(bool) specifier
Gauthier Harnisch [Wed, 19 Jun 2019 18:27:56 +0000 (18:27 +0000)]
[clang] Adapt ASTMatcher to explicit(bool) specifier

Summary:
Changes:
 - add an ast matcher for deductiong guide.
 - allow isExplicit matcher for deductiong guide.
 - add hasExplicitSpecifier matcher which give access to the expression of the explicit specifier if present.

Reviewers: klimek, rsmith, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, cfe-commits

Tags: #clang

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

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

5 years agoAdd test cases for dumping record definition data to JSON; NFC.
Aaron Ballman [Wed, 19 Jun 2019 17:49:25 +0000 (17:49 +0000)]
Add test cases for dumping record definition data to JSON; NFC.

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

5 years ago[clang][test] Add missing LambdaTemplateParams test and migrate from getLocStart
Jordan Rupprecht [Wed, 19 Jun 2019 17:43:58 +0000 (17:43 +0000)]
[clang][test] Add missing LambdaTemplateParams test and migrate from getLocStart

These were removed a long time ago in r341573, but this test was missed because it was not in cmake

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

5 years ago[clang][NewPM] Fixing remaining -O0 tests that are broken under new PM
Leonard Chan [Wed, 19 Jun 2019 17:41:30 +0000 (17:41 +0000)]
[clang][NewPM] Fixing remaining -O0 tests that are broken under new PM

- CodeGen/flatten.c will fail under new PM becausec the new PM AlwaysInliner
  seems to intentionally inline functions but not call sites marked with
  alwaysinline (D23299)
- Tests that check remarks happen to check them for the inliner which is not
  turned on at O0. These tests just check that remarks work, but we can make
  separate tests for the new PM with -O1 so we can turn on the inliner and
  check the remarks with minimal changes.

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

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

5 years agoUnify DependencyFileGenerator class and DependencyCollector interface (NFCI)
Alex Lorenz [Wed, 19 Jun 2019 17:07:36 +0000 (17:07 +0000)]
Unify DependencyFileGenerator class and DependencyCollector interface (NFCI)

Make DependencyFileGenerator a DependencyCollector as it was intended when
DependencyCollector was introduced. The missing PPCallbacks overrides are added to
the DependencyCollector as well.

This change will allow clang-scan-deps to access the produced dependencies without
writing them out to .d files to disk, so that it will be able collate them and
report them to the user.

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

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

5 years ago[NFC][codeview] Avoid undefined grep in debug-info-codeview-display-name.cpp
Hubert Tong [Wed, 19 Jun 2019 15:48:12 +0000 (15:48 +0000)]
[NFC][codeview] Avoid undefined grep in debug-info-codeview-display-name.cpp

vertical-line is not a BRE special character.

POSIX.1-2017 XBD Section 9.3.2 indicates that the interpretation of `\|`
is undefined. This patch uses an ERE instead.

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

5 years agoRevert rL363684 : AMDGPU: Add GWS instruction builtins
Simon Pilgrim [Wed, 19 Jun 2019 15:35:45 +0000 (15:35 +0000)]
Revert rL363684 : AMDGPU: Add GWS instruction builtins
........
Depends on rL363678 which was reverted at rL363797

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

5 years ago[analyzer] SARIF: Add EOF newline; replace diff_sarif
Hubert Tong [Wed, 19 Jun 2019 15:27:35 +0000 (15:27 +0000)]
[analyzer] SARIF: Add EOF newline; replace diff_sarif

Summary:
This patch applies a change similar to rC363069, but for SARIF files.

The `%diff_sarif` lit substitution invokes `diff` with a non-portable
`-I` option. The intended effect can be achieved by normalizing the
inputs to `diff` beforehand. Such normalization can be done with
`grep -Ev`, which is also used by other tests.

Additionally, this patch updates the SARIF output to have a newline at
the end of the file. This makes it so that the SARIF file qualifies as a
POSIX text file, which increases the consumability of the generated file
in relation to various tools.

Reviewers: NoQ, sfertile, xingxue, jasonliu, daltenty, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, jsji, cfe-commits

Tags: #clang

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

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

5 years agoAdd a script to help generate expected test output for dumping the AST to JSON.
Aaron Ballman [Wed, 19 Jun 2019 15:25:24 +0000 (15:25 +0000)]
Add a script to help generate expected test output for dumping the AST to JSON.

Patch by Abhishek Bhaskar.

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

5 years agoChange the way we output templates for JSON AST dumping and dump information about...
Aaron Ballman [Wed, 19 Jun 2019 15:24:06 +0000 (15:24 +0000)]
Change the way we output templates for JSON AST dumping and dump information about template arguments.

Previously, we attempted to write out template parameters and specializations to their own array, but due to the architecture of the ASTNodeTraverser, this meant that other nodes were not being written out. This now follows the same behavior as the regular AST dumper and puts all the (correct) information into the "inner" array. When we correct the AST node traverser itself, we can revisit splitting this information into separate arrays again.

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

5 years ago[OpenMP] Strengthen regression tests for task allocation under nowait depend clauses NFC
Gheorghe-Teodor Bercea [Wed, 19 Jun 2019 14:26:43 +0000 (14:26 +0000)]
[OpenMP] Strengthen regression tests for task allocation under nowait depend clauses NFC

Summary:
This patch strengthens the tests introduced in D63009 by:
- adding new test for default device ID.
- modifying existing tests to pass device ID local variable to the task allocation function.

Reviewers: ABataev, Hahnfeld, caomhin, jdoerfert

Reviewed By: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

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

5 years agoAllow copy/move assignment operator to be coroutine as per N4775
Vivek Pandya [Wed, 19 Jun 2019 14:12:19 +0000 (14:12 +0000)]
Allow copy/move assignment operator to be coroutine as per N4775

This change fixes https://bugs.llvm.org/show_bug.cgi?id=40997.

Reviewers: GorNishanov, rsmith
Reviewed by: GorNishanov
Subscribers: cfe-commits, lewissbaker, modocache, llvm-commits

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

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

5 years ago[Syntax] Fix a crash when dumping empty token buffer
Ilya Biryukov [Wed, 19 Jun 2019 13:56:36 +0000 (13:56 +0000)]
[Syntax] Fix a crash when dumping empty token buffer

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

5 years ago[OpenCL] Split type and macro definitions into opencl-c-base.h
Sven van Haastregt [Wed, 19 Jun 2019 12:48:22 +0000 (12:48 +0000)]
[OpenCL] Split type and macro definitions into opencl-c-base.h

Using the -fdeclare-opencl-builtins option will require a way to
predefine types and macros such as `int4`, `CLK_GLOBAL_MEM_FENCE`,
etc.  Move these out of opencl-c.h into opencl-c-base.h such that the
latter can be shared by -fdeclare-opencl-builtins and
-finclude-default-header.

This changes the behaviour of -finclude-default-header when
-fdeclare-opencl-builtins is specified: instead of including the full
header, it will include the header with only the base definitions.

Differential revision: https://reviews.llvm.org/D63256

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

5 years agoRevert r363116 "[X86] [ABI] Fix i386 ABI "__m64" type bug"
Hans Wennborg [Wed, 19 Jun 2019 11:34:08 +0000 (11:34 +0000)]
Revert r363116 "[X86] [ABI] Fix i386 ABI "__m64" type bug"

This introduced MMX instructions in code that wasn't previously using
them, breaking programs using 64-bit vectors and x87 floating-point in
the same application. See discussion on the code review for more
details.

> According to System V i386 ABI: the  __m64 type paramater and return
> value are passed by MMX registers. But current implementation treats
> __m64 as i64 which results in parameter passing by stack and returning
> by EDX and EAX.
>
> This patch fixes the bug (https://bugs.llvm.org/show_bug.cgi?id=41029)
> for Linux and NetBSD.
>
> Patch by Wei Xiao (wxiao3)
>
> Differential Revision: https://reviews.llvm.org/D59744

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

5 years ago[analyzer][NFC][tests] Pre-normalize expected-sarif files
Hubert Tong [Wed, 19 Jun 2019 11:19:51 +0000 (11:19 +0000)]
[analyzer][NFC][tests] Pre-normalize expected-sarif files

As discussed in the review for D62952, this patch pre-normalizes the
reference expected output sarif files by removing lines containing
fields for which we expect differences that should be ignored.

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

5 years ago[RISCV] Mark TLS as supported
Lewis Revill [Wed, 19 Jun 2019 08:53:46 +0000 (08:53 +0000)]
[RISCV] Mark TLS as supported

Inform Clang that TLS is implemented by LLVM for RISC-V

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

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

5 years agogit-clang-format: Remove trailing whitespace in docstring. NFC.
Sam Clegg [Wed, 19 Jun 2019 01:52:41 +0000 (01:52 +0000)]
git-clang-format: Remove trailing whitespace in docstring. NFC.

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

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

5 years agoFix tests after r363749
Aaron Puchert [Tue, 18 Jun 2019 23:40:17 +0000 (23:40 +0000)]
Fix tests after r363749

We changed -Wmissing-prototypes there, which was used in these tests via
-Weverything.

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

5 years agoSuggestions to fix -Wmissing-{prototypes,variable-declarations}
Aaron Puchert [Tue, 18 Jun 2019 22:57:08 +0000 (22:57 +0000)]
Suggestions to fix -Wmissing-{prototypes,variable-declarations}

Summary:
I've found that most often the proper way to fix this warning is to add
`static`, because if the code otherwise compiles and links, the function
or variable is apparently not needed outside of the TU.

We can't provide a fix-it hint for variable declarations, because
multiple VarDecls can share the same type, and if we put static in front
of that, we affect all declared variables, some of which might have
previous declarations.

We also provide no fix-it hint for the rare case of an `extern` function
definition, because that would require removing `extern` and I have no
idea how to get the source location of the storage class specifier from
a FunctionDecl. I believe this information is only available earlier in
the AST construction from DeclSpec::getStorageClassSpecLoc(), but we
don't have that here.

Reviewed By: aaron.ballman

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

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

5 years agoShow note for -Wmissing-prototypes for functions with parameters
Aaron Puchert [Tue, 18 Jun 2019 22:52:39 +0000 (22:52 +0000)]
Show note for -Wmissing-prototypes for functions with parameters

Summary:
There was a search for non-prototype declarations for the function, but
we only showed the results for zero-parameter functions. Now we show the
note for functions with parameters as well, but we omit the fix-it hint
suggesting to add `void`.

Reviewed By: aaron.ballman

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

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

5 years ago[test] NFC, udpate clang-scan-deps tests to not use -c to avoid driver issues when...
Alex Lorenz [Tue, 18 Jun 2019 21:36:30 +0000 (21:36 +0000)]
[test] NFC, udpate clang-scan-deps tests to not use -c to avoid driver issues when no integrated assembler is present

Caught by Douglas Yung.

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

5 years ago[OPENMP]Use host's mangling for 128 bit float types on the device.
Alexey Bataev [Tue, 18 Jun 2019 20:29:06 +0000 (20:29 +0000)]
[OPENMP]Use host's mangling for 128 bit float types on the device.

Device have to use the same mangling as the host for 128bit float types. Otherwise, the codegen for the device is unable to find the parent function when it tries to generate the outlined function for the target region and it leads to incorrect compilation and crash at the runtime.

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

5 years ago[OPENMP][NVPTX]Correct codegen for 128 bit long double.
Alexey Bataev [Tue, 18 Jun 2019 19:04:27 +0000 (19:04 +0000)]
[OPENMP][NVPTX]Correct codegen for 128 bit long double.

If the host uses 128 bit long doubles, the compiler should generate correct code for NVPTX devices. If the return type has 128 bit long doubles, in LLVM IR this type must be coerced to int array instead.

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

5 years ago[OPENMP]Use host's long double when compiling the code for device.
Alexey Bataev [Tue, 18 Jun 2019 18:39:26 +0000 (18:39 +0000)]
[OPENMP]Use host's long double when compiling the code for device.

The device code must use the same long double type as the host.
Otherwise the code cannot be linked and executed properly. Patch adds
only basic support and checks for supporting of the host long double
double on the device.

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