clang
8 years agoOpenCL release notes
Anastasia Stulova [Mon, 15 Aug 2016 16:28:10 +0000 (16:28 +0000)]
OpenCL release notes

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

8 years agoMerge r278393 and r278395.
Ed Schouten [Sat, 13 Aug 2016 20:43:56 +0000 (20:43 +0000)]
Merge r278393 and r278395.

LLVM/Clang 3.8 is directly usable as a cross compiler for CloudABI/i686.
In 3.9rc1 there are a couple of regressions in the driver that cause it
to be less usable:

- PIE was enabled unconditionally, even though it's only available for
  x86-64 and aarch64.
- Some inline assembly fails to build, due to a shortage of registers,
  as frame pointers are not omitted.

Both these changes are fairly low risk (read: they don't affect other
targets), so go ahead and merge them into 3.9, so we can use an
unmodified compiler on all architectures.

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

8 years agoMerging r278471:
George Burgess IV [Fri, 12 Aug 2016 05:11:46 +0000 (05:11 +0000)]
Merging r278471:
------------------------------------------------------------------------
r278471 | gbiv | 2016-08-11 21:12:31 -0700 (Thu, 11 Aug 2016) | 11 lines

[Sema] Fix a crash on variadic enable_if functions.

Currently, when trying to evaluate an enable_if condition, we try to
evaluate all arguments a user passes to a function. Given that we can't
use variadic arguments from said condition anyway, not converting them
is a reasonable thing to do. So, this patch makes us ignore any varargs
when attempting to check an enable_if condition.

We'd crash because, in order to convert an argument, we need its
ParmVarDecl. Variadic arguments don't have ParmVarDecls.

------------------------------------------------------------------------

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

8 years agoUpdate release notes for new warnings.
Richard Trieu [Fri, 12 Aug 2016 00:00:21 +0000 (00:00 +0000)]
Update release notes for new warnings.

Document -Wcomma, -Wfloat-zero-conversion, and -Wfloat-overflow-conversion

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

8 years agoMerging r277522:
Hans Wennborg [Thu, 11 Aug 2016 18:16:47 +0000 (18:16 +0000)]
Merging r277522:
------------------------------------------------------------------------
r277522 | dcoughlin | 2016-08-02 14:07:23 -0700 (Tue, 02 Aug 2016) | 8 lines

[CFG] Fix crash finding destructor of lifetime-extended temporary.

Fix a crash under -Wthread-safety when finding the destructor for a
lifetime-extending reference.

A patch by Nandor Licker!

Differential Revision: https://reviews.llvm.org/D22419
------------------------------------------------------------------------

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

8 years agoMerging r276900:
Hans Wennborg [Thu, 11 Aug 2016 18:13:48 +0000 (18:13 +0000)]
Merging r276900:
------------------------------------------------------------------------
r276900 | epilk | 2016-07-27 11:25:10 -0700 (Wed, 27 Jul 2016) | 5 lines

[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer

Fixes PR27994, a crash on valid.

Differential revision: https://reviews.llvm.org/D21145
------------------------------------------------------------------------

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

8 years agoMerging r278234 and r278235:
Hans Wennborg [Wed, 10 Aug 2016 17:34:17 +0000 (17:34 +0000)]
Merging r278234 and r278235:
------------------------------------------------------------------------
r278234 | joey | 2016-08-10 08:57:02 -0700 (Wed, 10 Aug 2016) | 5 lines

[OpenCL] Change block descriptor address space to constant.

The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be
in the private address space.

------------------------------------------------------------------------

------------------------------------------------------------------------
r278235 | joey | 2016-08-10 09:04:14 -0700 (Wed, 10 Aug 2016) | 2 lines

[OpenCL] Fix typo in test that I accidentally introduced in my previous commit.

------------------------------------------------------------------------

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

8 years agoMerging r278139:
Hans Wennborg [Wed, 10 Aug 2016 16:36:05 +0000 (16:36 +0000)]
Merging r278139:
------------------------------------------------------------------------
r278139 | rnk | 2016-08-09 10:23:56 -0700 (Tue, 09 Aug 2016) | 6 lines

[clang-cl] Make -gline-tables-only imply -gcodeview

It's surprising that you have to pass /Z7 in addition to -gcodeview to
get debug info. The sanitizer runtime, for example, expects that if the
compiler supports the -gline-tables-only flag, then it will emit debug
info.
------------------------------------------------------------------------

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

8 years ago[docs] Update 3.9 release notes for the static analyzer.
Devin Coughlin [Tue, 9 Aug 2016 23:01:43 +0000 (23:01 +0000)]
[docs] Update 3.9 release notes for the static analyzer.

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

8 years agoMerging r277796, r277797, r277866, r277889 and r277900:
Hans Wennborg [Mon, 8 Aug 2016 16:37:00 +0000 (16:37 +0000)]
Merging r277796, r277797, r277866, r277889 and r277900:

------------------------------------------------------------------------
r277796 | rtrieu | 2016-08-04 19:39:30 -0700 (Thu, 04 Aug 2016) | 6 lines

Allow -1 to assign max value to unsigned bitfields.

Silence the -Wbitfield-constant-conversion warning for when -1 or other
negative values are assigned to unsigned bitfields, provided that the bitfield
is wider than the minimum number of bits needed to encode the negative value.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277797 | rtrieu | 2016-08-04 20:16:36 -0700 (Thu, 04 Aug 2016) | 7 lines

Fix crash in template type diffing.

When the type being diffed is a type alias, and the orginal type is not a
templated type, then there will be no unsugared TemplateSpecializationType.
When this happens, exit early from the constructor.  Also add assertions to
the other iterator accessor to prevent the iterator from being used.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277866 | rtrieu | 2016-08-05 14:02:34 -0700 (Fri, 05 Aug 2016) | 12 lines

Fix false positive in -Wunsequenced and templates.

For builtin logical operators, there is a well-defined ordering of argument
evaluation.  For overloaded operator of the same type, there is no argument
evaluation order, similar to other function calls.  When both are present,
uninstantiated templates with an operator&& is treated as an unresolved
function call.  Unresolved function calls are treated as normal function calls,
and may result in false positives when the builtin logical operator is used.
Have the unsequenced checker ignore dependent expressions to avoid this
false positive.  The check also happens in template instantiations to catch
when the overloaded operator is used.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277889 | rtrieu | 2016-08-05 16:24:47 -0700 (Fri, 05 Aug 2016) | 9 lines

Fix two false positives in -Wreturn-stack-address

If the return type is a pointer and the function returns the reference to a
pointer, don't warn since only the value is returned, not the reference.

If a reference function parameter appears in the reference chain, don't warn
since binding happens at the caller scope, so addresses returned are not
to local stack.  This includes default arguments as well.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277900 | rtrieu | 2016-08-05 18:44:06 -0700 (Fri, 05 Aug 2016) | 2 lines

Fix typos from r277797 and unused variable from r277889.

------------------------------------------------------------------------

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

8 years agoMerging r277743:
Hans Wennborg [Mon, 8 Aug 2016 16:32:10 +0000 (16:32 +0000)]
Merging r277743:
------------------------------------------------------------------------
r277743 | bader | 2016-08-04 11:06:27 -0700 (Thu, 04 Aug 2016) | 12 lines

[OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.

Summary:
In order to re-define OpenCL built-in functions
'to_{private,local,global}' in OpenCL run-time library LLVM names must
be different from the clang built-in function names.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23120
------------------------------------------------------------------------

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

8 years ago[docs] Add 3.9 release notes for the static analyzer.
Devin Coughlin [Thu, 4 Aug 2016 21:27:47 +0000 (21:27 +0000)]
[docs] Add 3.9 release notes for the static analyzer.

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

8 years agoAdd a note about clang-cl pch support to the 3.9 release notes.
Nico Weber [Thu, 4 Aug 2016 18:55:57 +0000 (18:55 +0000)]
Add a note about clang-cl pch support to the 3.9 release notes.

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

8 years agogrammar fix
Nico Weber [Thu, 4 Aug 2016 18:52:17 +0000 (18:52 +0000)]
grammar fix

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

8 years agoMerging r277095:
Hans Wennborg [Tue, 2 Aug 2016 21:29:54 +0000 (21:29 +0000)]
Merging r277095:
------------------------------------------------------------------------
r277095 | epilk | 2016-07-28 17:55:40 -0700 (Thu, 28 Jul 2016) | 5 lines

[Parser] Fix bug where delayed typo in conditional expression was corrected twice

Patch by David Tarditi!

Differential revision: https://reviews.llvm.org/D22930
------------------------------------------------------------------------

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

8 years agoMerging r277457
Diana Picus [Tue, 2 Aug 2016 14:34:15 +0000 (14:34 +0000)]
Merging r277457

[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

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

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

8 years agoMerging r277307:
Dimitry Andric [Tue, 2 Aug 2016 06:46:09 +0000 (06:46 +0000)]
Merging r277307:

------------------------------------------------------------------------
r277307 | dim | 2016-07-31 22:23:23 +0200 (Sun, 31 Jul 2016) | 23 lines

Add more gcc compatibility names to clang's cpuid.h

Summary:
Some cpuid bit defines are named slightly different from how gcc's
cpuid.h calls them.

Define a few more compatibility names to appease software built for gcc:

* `bit_PCLMUL`      alias of `bit_PCLMULQDQ`
* `bit_SSE4_1`      alias of `bit_SSE41`
* `bit_SSE4_2`      alias of `bit_SSE42`
* `bit_AES`         alias of `bit_AESNI`
* `bit_CMPXCHG8B`   alias of `bit_CX8`

While here, add the misssing 29th bit, `bit_F16C` (which is how gcc
calls this bit).

Reviewers: joerg, rsmith

Subscribers: bruno, cfe-commits

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

------------------------------------------------------------------------

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

8 years agoMerging r277221:
Hans Wennborg [Mon, 1 Aug 2016 20:33:18 +0000 (20:33 +0000)]
Merging r277221:
------------------------------------------------------------------------
r277221 | echristo | 2016-07-29 15:11:11 -0700 (Fri, 29 Jul 2016) | 3 lines

Remove unused variable.

Fixes PR28761.
------------------------------------------------------------------------

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

8 years agoDelete offloading-interoperability.c
Hans Wennborg [Fri, 29 Jul 2016 20:02:38 +0000 (20:02 +0000)]
Delete offloading-interoperability.c

The test is now failing on Windows. This is causing too much pain,
let's just drop it from the branch.

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

8 years agoMerging r276983, r277138 and r277141:
Hans Wennborg [Fri, 29 Jul 2016 18:36:36 +0000 (18:36 +0000)]
Merging r276983, r277138 and r277141:
------------------------------------------------------------------------
r276983 | sfantao | 2016-07-28 07:56:19 -0700 (Thu, 28 Jul 2016) | 5 lines

[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277138 | d0k | 2016-07-29 06:07:09 -0700 (Fri, 29 Jul 2016) | 4 lines

Make test not fail on hosts where the default omp library is gomp.

This is the case on some linuxes, just force libomp so we get the
desired results.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277141 | djasper | 2016-07-29 06:45:03 -0700 (Fri, 29 Jul 2016) | 1 line

Add missing '-no-canonical-prefixes' in test.
------------------------------------------------------------------------

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

8 years agoMerging r276653:
Hans Wennborg [Thu, 28 Jul 2016 23:06:58 +0000 (23:06 +0000)]
Merging r276653:
------------------------------------------------------------------------
r276653 | ssrivastava | 2016-07-25 10:17:06 -0700 (Mon, 25 Jul 2016) | 11 lines

Support '#pragma once' in headers when using PCH

The '#pragma once' directive was erroneously ignored when encountered
in the header-file specified in generate-PCH-mode. This resulted in
compile-time errors in some cases with legal code, and also a misleading
warning being produced.

Patch by Warren Ristow!

Differential Revision: http://reviews.llvm.org/D19815

------------------------------------------------------------------------

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

8 years agoMerging r276979:
Hans Wennborg [Thu, 28 Jul 2016 17:11:02 +0000 (17:11 +0000)]
Merging r276979:
------------------------------------------------------------------------
r276979 | sfantao | 2016-07-28 07:29:18 -0700 (Thu, 28 Jul 2016) | 12 lines

[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.

Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.

This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev

Subscribers: caomhin, cfe-commits

Differential Revision: https://reviews.llvm.org/D22895
------------------------------------------------------------------------

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

8 years agoMention of proper support for "__unaligned" type qualifier in 3.9 clang release notes
Hans Wennborg [Thu, 28 Jul 2016 15:59:18 +0000 (15:59 +0000)]
Mention of proper support for "__unaligned" type qualifier in 3.9 clang release notes

Patch by: Andrey Bokhanko <andreybokhanko@gmail.com>

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

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

8 years agoMerging r276102:
Hans Wennborg [Thu, 28 Jul 2016 15:41:25 +0000 (15:41 +0000)]
Merging r276102:
------------------------------------------------------------------------
r276102 | rksimon | 2016-07-20 03:18:01 -0700 (Wed, 20 Jul 2016) | 11 lines

[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR

D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

Differential Revision: https://reviews.llvm.org/D22105
------------------------------------------------------------------------

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

8 years agoMerging r276350:
Hans Wennborg [Thu, 28 Jul 2016 15:18:14 +0000 (15:18 +0000)]
Merging r276350:
------------------------------------------------------------------------
r276350 | epilk | 2016-07-21 15:31:40 -0700 (Thu, 21 Jul 2016) | 3 lines

[CodeGen] Fix a crash when constant folding switch statement

Differential revision: https://reviews.llvm.org/D22542
------------------------------------------------------------------------

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

8 years agoMerging r276887:
Hans Wennborg [Wed, 27 Jul 2016 16:56:35 +0000 (16:56 +0000)]
Merging r276887:
------------------------------------------------------------------------
r276887 | hans | 2016-07-27 09:39:45 -0700 (Wed, 27 Jul 2016) | 1 line

Update cxx_dr_Status after 3.9 branch
------------------------------------------------------------------------

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

8 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 27 Jul 2016 16:48:23 +0000 (16:48 +0000)]
Generate docs/AttributeReference.rst

$ bin/clang-tblgen -gen-attr-docs -I../cfe.src/include \
    ../cfe.src/include/clang/Basic/Attr.td \
    -o ../cfe.src/docs/AttributeReference.rst

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

8 years agoMerging r276887:
Hans Wennborg [Wed, 27 Jul 2016 16:41:01 +0000 (16:41 +0000)]
Merging r276887:
------------------------------------------------------------------------
r276887 | hans | 2016-07-27 09:39:45 -0700 (Wed, 27 Jul 2016) | 1 line

Update cxx_dr_Status after 3.9 branch
------------------------------------------------------------------------

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

8 years agoMerging r276716:
Hans Wennborg [Tue, 26 Jul 2016 20:47:37 +0000 (20:47 +0000)]
Merging r276716:
------------------------------------------------------------------------
r276716 | vedantk | 2016-07-25 17:24:59 -0700 (Mon, 25 Jul 2016) | 10 lines

[Coverage] Do not write out coverage mappings with zero entries

After r275121, we stopped mapping regions from system headers. Lambdas
declared in regions belonging to system headers started producing empty
coverage mappings, since the files corresponding to their spelling locs
were being ignored.

The coverage reader doesn't know what to do with these empty mappings.
This commit makes sure that we don't produce them and adds a test. I'll
make the reader stricter in a follow-up commit.
------------------------------------------------------------------------

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

8 years agoMerging r276473:
Hans Wennborg [Tue, 26 Jul 2016 15:57:30 +0000 (15:57 +0000)]
Merging r276473:
------------------------------------------------------------------------
r276473 | vvassilev | 2016-07-22 14:08:24 -0700 (Fri, 22 Jul 2016) | 13 lines

[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.

Processing update records (and loading a module, in general) might trigger
unexpected calls to the ASTWriter (being a mutation listener). Now we have a
mechanism to suppress those calls to the ASTWriter but notify other possible
mutation listeners.

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

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith (D21800).

------------------------------------------------------------------------

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

8 years agoMerging r276361:
Hans Wennborg [Mon, 25 Jul 2016 17:19:19 +0000 (17:19 +0000)]
Merging r276361:
------------------------------------------------------------------------
r276361 | wolfgangp | 2016-07-21 16:28:18 -0700 (Thu, 21 Jul 2016) | 5 lines

Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

------------------------------------------------------------------------

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

8 years agoMerging Clang-side of r275967: (the LLVM side already merged in r276561)
Hans Wennborg [Mon, 25 Jul 2016 16:21:28 +0000 (16:21 +0000)]
Merging Clang-side of r275967: (the LLVM side already merged in r276561)
------------------------------------------------------------------------
r275967 | dsanders | 2016-07-19 03:49:03 -0700 (Tue, 19 Jul 2016) | 16 lines

[mips] Correct label prefixes for N32 and N64.

Summary:
N32 and N64 follow the standard ELF conventions (.L) whereas O32 uses its own
($).

This fixes the majority of object differences between -fintegrated-as and
-fno-integrated-as.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

------------------------------------------------------------------------

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

8 years agoMerging r276232:
George Burgess IV [Fri, 22 Jul 2016 22:57:21 +0000 (22:57 +0000)]
Merging r276232:
------------------------------------------------------------------------
r276232 | gbiv | 2016-07-20 20:28:13 -0700 (Wed, 20 Jul 2016) | 13 lines

[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

------------------------------------------------------------------------

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

8 years agoReleaseNotes: s/3.7/3.8/ in 'since the 3.7 release'
Hans Wennborg [Fri, 22 Jul 2016 14:17:04 +0000 (14:17 +0000)]
ReleaseNotes: s/3.7/3.8/ in 'since the 3.7 release'

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

8 years agoAdd attribute abi_tag to the release notes
Hans Wennborg [Wed, 20 Jul 2016 13:28:36 +0000 (13:28 +0000)]
Add attribute abi_tag to the release notes

Patch by Dmitry Polukhin <dmitry.polukhin@gmail.com>!

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

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

8 years agoMerging r275880:
Hans Wennborg [Mon, 18 Jul 2016 20:12:49 +0000 (20:12 +0000)]
Merging r275880:
------------------------------------------------------------------------
r275880 | dcoughlin | 2016-07-18 11:57:50 -0700 (Mon, 18 Jul 2016) | 3 lines

Revert "[analyzer] Add checker modeling potential C++ self-assignment"

This reverts commit r275820. It is failing on the bots.
------------------------------------------------------------------------

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

8 years agoAnalyzer docs: update version to 3.9
Hans Wennborg [Mon, 18 Jul 2016 18:20:49 +0000 (18:20 +0000)]
Analyzer docs: update version to 3.9

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

8 years agoCreating release_39 branch off revision 275826
Hans Wennborg [Mon, 18 Jul 2016 17:52:43 +0000 (17:52 +0000)]
Creating release_39 branch off revision 275826

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

8 years ago[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate...
Reid Kleckner [Mon, 18 Jul 2016 17:49:40 +0000 (17:49 +0000)]
[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate of /Zd

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

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Mon, 18 Jul 2016 17:23:30 +0000 (17:23 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

A patch by Ádám Balogh!

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

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

8 years agoRelease note for 'nodebug' on variables
Paul Robinson [Mon, 18 Jul 2016 17:19:12 +0000 (17:19 +0000)]
Release note for 'nodebug' on variables

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

8 years ago[OpenMP] update test cases for -std=c++11 compile
Kelvin Li [Mon, 18 Jul 2016 16:09:53 +0000 (16:09 +0000)]
[OpenMP] update test cases for -std=c++11 compile

target_parallel_for_simd_collapse_messages.cpp and target_parallel_for_simd_ordered_messages.cpp give different diagnostic messages in compiling with -std=c++11. The test cases are updated to make it compatible.

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

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

8 years agoRevert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument...
NAKAMURA Takumi [Mon, 18 Jul 2016 03:23:25 +0000 (03:23 +0000)]
Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""

This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

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

8 years agotest: add missing triple to test
Saleem Abdulrasool [Sun, 17 Jul 2016 22:54:42 +0000 (22:54 +0000)]
test: add missing triple to test

The test was relying on the default triple which may not be correct.  Explicitly
provide it a triple.  Should repair the windows on Linux builder.

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

8 years agoCodeGen: honour dllstorage on ObjC types
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:44 +0000 (22:27 +0000)]
CodeGen: honour dllstorage on ObjC types

Add support for ObjC types to respect the DLLImport/DLLExport storage
annotations.  This only effects COFF output.  This would allow usage with
clang/C2, but not with clang/LLVM due to hard coded section names.

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

8 years agoCodeGen: whitespace, formatting cleanups, NFC
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:41 +0000 (22:27 +0000)]
CodeGen: whitespace, formatting cleanups, NFC

Format some code which was oddly formatted.  Use a bit of auto to make the code
more legible.  NFC.

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

8 years agoCodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:38 +0000 (22:27 +0000)]
CodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction

Clean up some formatting issues and use a bit more StringRef based operations
instead of SmallStrings.  NFC.

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

8 years agoAttempt to work around MSVC rejects-valid, round 2.
Richard Smith [Sun, 17 Jul 2016 20:00:59 +0000 (20:00 +0000)]
Attempt to work around MSVC rejects-valid, round 2.

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

8 years agoPR28589: attempt to work around MSVC rejects-valid.
Richard Smith [Sun, 17 Jul 2016 19:24:51 +0000 (19:24 +0000)]
PR28589: attempt to work around MSVC rejects-valid.

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

8 years ago[CodeGen] Some assorted cleanups
David Majnemer [Sun, 17 Jul 2016 00:39:12 +0000 (00:39 +0000)]
[CodeGen] Some assorted cleanups

No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

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

8 years agoCodeGen: use StringRefs more in ObjC class generation, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:06 +0000 (22:42 +0000)]
CodeGen: use StringRefs more in ObjC class generation, NFC

Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

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

8 years agoCodeGen: simplify using a local variable, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:04 +0000 (22:42 +0000)]
CodeGen: simplify using a local variable, NFC

Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

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

8 years agoRevert "Revert r275029 - Update Clang tests after adding inference for the returned...
Hal Finkel [Sat, 16 Jul 2016 07:22:09 +0000 (07:22 +0000)]
Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"

This reverts commit r275043 after reapplying the underlying LLVM commit.

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

8 years ago[Driver] Add flags for enabling both types of PGO Instrumentation
Sean Silva [Sat, 16 Jul 2016 02:54:58 +0000 (02:54 +0000)]
[Driver] Add flags for enabling both types of PGO Instrumentation

The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

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

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

8 years agoRemove extra semi-colon. Fixes warning and Werror bots.
Eric Christopher [Sat, 16 Jul 2016 00:58:34 +0000 (00:58 +0000)]
Remove extra semi-colon. Fixes warning and Werror bots.

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

8 years ago[ObjC] Implement @available in the Parser and AST
Erik Pilkington [Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)]
[ObjC] Implement @available in the Parser and AST

This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

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

8 years agoReimplement ExternalSemaSource delegation in terms of
Richard Smith [Sat, 16 Jul 2016 00:35:14 +0000 (00:35 +0000)]
Reimplement ExternalSemaSource delegation in terms of
MultiplexExternalSemaSource to remove one of the places that needs updating
every time the ExternalSemaSource interface changes.

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

8 years agoUse std::string instead of StringRef when generating the auxiliar triple in the front...
Samuel Antao [Sat, 16 Jul 2016 00:15:56 +0000 (00:15 +0000)]
Use std::string instead of StringRef when generating the auxiliar triple in the frontend tool.

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

8 years agoAttempt to fix breakage caused by r275645 for Windows bots.
Samuel Antao [Fri, 15 Jul 2016 23:51:21 +0000 (23:51 +0000)]
Attempt to fix breakage caused by r275645 for Windows bots.

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

8 years ago[CUDA][OpenMP] Create generic offload action
Samuel Antao [Fri, 15 Jul 2016 23:13:27 +0000 (23:13 +0000)]
[CUDA][OpenMP] Create generic offload action

Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[index] Create different USR if a property is a class property.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 22:18:19 +0000 (22:18 +0000)]
[index] Create different USR if a property is a class property.

Avoids USR conflicts between class & instance properties of the same name.

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

8 years agoRevert r275481, r275490. This broke modules bootstrap.
Richard Smith [Fri, 15 Jul 2016 21:33:46 +0000 (21:33 +0000)]
Revert r275481, r275490. This broke modules bootstrap.

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

8 years agoAMDGPU: Remove legacy ldexp builtin
Matt Arsenault [Fri, 15 Jul 2016 21:33:06 +0000 (21:33 +0000)]
AMDGPU: Remove legacy ldexp builtin

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

8 years agoAMDGPU: Update for rsq intrinsic changes
Matt Arsenault [Fri, 15 Jul 2016 21:33:02 +0000 (21:33 +0000)]
AMDGPU: Update for rsq intrinsic changes

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

8 years agoPush alias-declarations and alias-template declarations into scope even if
Richard Smith [Fri, 15 Jul 2016 20:53:25 +0000 (20:53 +0000)]
Push alias-declarations and alias-template declarations into scope even if
they're redeclarations. This is necessary in order for name lookup to correctly
find the most recent declaration of the name (which affects default template
argument lookup and cross-module merging, among other things).

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

8 years agoSema: support __declspec(dll*) on ObjC interfaces
Saleem Abdulrasool [Fri, 15 Jul 2016 20:41:10 +0000 (20:41 +0000)]
Sema: support __declspec(dll*) on ObjC interfaces

Extend the __declspec(dll*) attribute to cover ObjC interfaces.  This was
requested by Microsoft for their ObjC support.  Cover both import and export.
This only adds the semantic analysis portion of the support, code-generation
still remains outstanding.  Add some basic initial documentation on the
attributes that were previously empty.  Tweak the previous tests to use the
relative expected-warnings to make the tests easier to read.

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

8 years ago[test/objcmt] Add a follow-up test case for r275600.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 20:40:24 +0000 (20:40 +0000)]
[test/objcmt] Add a follow-up test case for r275600.

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

8 years ago[objcmt] Fix a buffer overflow crash than can occur while modernizing enums.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 19:22:34 +0000 (19:22 +0000)]
[objcmt] Fix a buffer overflow crash than can occur while modernizing enums.

Note that due to the nature of the crash it requires libgmalloc or asan for it to crash consistently.

rdar://19932927

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

8 years ago[AST] Keep track of the left brace source location of a tag decl.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 18:11:33 +0000 (18:11 +0000)]
[AST] Keep track of the left brace source location of a tag decl.

This is useful for source modification tools. There will be a follow-up commit using it.

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

8 years ago[objcmt] Don't add an #import of Foundation unnecessarily, if the NS_ENUM macro is...
Argyrios Kyrtzidis [Fri, 15 Jul 2016 18:11:27 +0000 (18:11 +0000)]
[objcmt] Don't add an #import of Foundation unnecessarily, if the NS_ENUM macro is already defined.

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

8 years agoAMDGPU: Add Clang Builtin for v_lerp_u8
Wei Ding [Fri, 15 Jul 2016 16:43:03 +0000 (16:43 +0000)]
AMDGPU: Add Clang Builtin for v_lerp_u8

Differential Revision: http://reviews.llvm.org/D22380

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

8 years agoXRay: Remove duplicate checks for xray instrumentation flags
Dean Michael Berris [Fri, 15 Jul 2016 15:46:39 +0000 (15:46 +0000)]
XRay: Remove duplicate checks for xray instrumentation flags

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

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Fri, 15 Jul 2016 13:13:45 +0000 (13:13 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15214/steps/docs-clang-html/logs/stdio).

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

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Fri, 15 Jul 2016 12:55:47 +0000 (12:55 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15213/steps/docs-clang-html/logs/stdio).

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

8 years ago[OpenMP] add check for both simdlen and safelen clauses specified
Kelvin Li [Fri, 15 Jul 2016 04:39:07 +0000 (04:39 +0000)]
[OpenMP] add check for both simdlen and safelen clauses specified

This patch adds the check for specifying both simdlen and safelen clauses on the 'distribute simd' or 'distribute parallel for simd' constructs.

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

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

8 years agoFrontend: Simplify ownership model for clang's output streams.
Peter Collingbourne [Fri, 15 Jul 2016 00:55:40 +0000 (00:55 +0000)]
Frontend: Simplify ownership model for clang's output streams.

This changes the CompilerInstance::createOutputFile function to return
a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream
implicitly owned by the CompilerInstance. This in most cases required that
I move ownership of the output stream to the relevant ASTConsumer.

The motivation for this change is to allow BackendConsumer to be a client
of interfaces such as D20268 which take ownership of the output stream.

Differential Revision: http://reviews.llvm.org/D21537

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

8 years agoRemove the new module cache from the index-module test
Ben Langmuir [Thu, 14 Jul 2016 22:53:23 +0000 (22:53 +0000)]
Remove the new module cache from the index-module test

Forgot to add the new cache to the `rm -rf` line. This broke some bots
when trying to load a module built with an older compiler.

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

8 years agoC does not have inline variables.
Paul Robinson [Thu, 14 Jul 2016 22:22:58 +0000 (22:22 +0000)]
C does not have inline variables.
Add a few missing tests for related C++ diagnostics.

Differential Revision: http://reviews.llvm.org/D22113

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

8 years agoAdd test inputs missed by r275481.
Richard Smith [Thu, 14 Jul 2016 22:15:06 +0000 (22:15 +0000)]
Add test inputs missed by r275481.

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

8 years ago[modules] Don't pass interesting decls to the consumer for a module file that's
Richard Smith [Thu, 14 Jul 2016 21:50:09 +0000 (21:50 +0000)]
[modules] Don't pass interesting decls to the consumer for a module file that's
passed on the command line but never actually used. We consider a (top-level)
module to be used if any part of it is imported, either by the current
translation unit, or by any part of a top-level module that is itself used.

(Put another way, a module is used if an implicit modules build would have
loaded its .pcm file.)

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

8 years ago[arcmt/objcmt] Fix ParentMap crash with invalid code.
Argyrios Kyrtzidis [Thu, 14 Jul 2016 20:21:16 +0000 (20:21 +0000)]
[arcmt/objcmt] Fix ParentMap crash with invalid code.

rdar://22489560

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

8 years agoAttempt to workaround Windows bots after my previous commit
Ben Langmuir [Thu, 14 Jul 2016 20:08:43 +0000 (20:08 +0000)]
Attempt to workaround Windows bots after my previous commit

For some reason it seems the second invocation is getting DMOD_OTHER_H
set to a path with/forward/slashes, but one of the use sites
has\back\slashes. There should be no difference with what was already
there, but for now try to avoid checking those paths.

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

8 years agoReverting 275417
Roger Ferrer Ibanez [Thu, 14 Jul 2016 20:05:30 +0000 (20:05 +0000)]
Reverting 275417

This change has triggered unexpected failures.

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

8 years agoWhen importing classes and structs with anonymous structs, it is critical that
Sean Callanan [Thu, 14 Jul 2016 19:53:44 +0000 (19:53 +0000)]
When importing classes and structs with anonymous structs, it is critical that
distinct anonymous structs remain distinct despite having similar layout.

This is already ensured by distinguishing based on their placement in the parent
struct, using the function `findAnonymousStructOrUnionIndex`.

The problem is that this function only handles anonymous structs, like
```
class Foo { struct { int a; } }
```
and not untagged structs like
```
class Foo { struct { int a; } var; }
```
Both need to be handled, and this patch fixes that.  The test case ensures that this functionality doesn't regress.

Thanks to Manman Ren for review.

https://reviews.llvm.org/D22270

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

8 years ago[index] Index system ImportDecls even when there is a DeclarationsOnly filter
Ben Langmuir [Thu, 14 Jul 2016 18:51:55 +0000 (18:51 +0000)]
[index] Index system ImportDecls even when there is a DeclarationsOnly filter

Whether we call an ImportDecl a decl or a reference symbol role is
somewhat academic, but in practice it's more like a declaration because
it is interesting even to consumers who wouldn't care about references.
Most importantly, we want to report the module dependencies of system
modules even when we have declaration-only filtering.

rdar://problem/27134855

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

8 years agoDespite there being an option, it seems that Sphinx has decided that "=123" is part...
Aaron Ballman [Thu, 14 Jul 2016 17:15:06 +0000 (17:15 +0000)]
Despite there being an option, it seems that Sphinx has decided that "=123" is part of the option directive name, and so having "=0" in the option tag is problematic. Since the option tag is part of the option directive definition, it's superfluous, and so I've removed it.

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

8 years agoRemoving a few more :option: tags that we do not have corresponding .. option directi...
Aaron Ballman [Thu, 14 Jul 2016 15:32:11 +0000 (15:32 +0000)]
Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15197/steps/docs-clang-html/logs/stdio).

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

8 years ago[OpenCL] In test/Driver/opencl.cl, don't require name of Clang binary to contain...
Benjamin Kramer [Thu, 14 Jul 2016 15:06:57 +0000 (15:06 +0000)]
[OpenCL] In test/Driver/opencl.cl, don't require name of Clang binary to contain "clang"

The test currently fails if the name of the Clang binary doesn't contain "clang".

This patch removes that requirement, as some environments may choose to run the test with a differently named binary. This shouldn't make the test any less strict -- the only place where the flags we're searching for can really occur is the Clang command line.

Patch by Martin Böhme!

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

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

8 years agoDiagnose taking address and reference binding of packed members
Roger Ferrer Ibanez [Thu, 14 Jul 2016 14:10:43 +0000 (14:10 +0000)]
Diagnose taking address and reference binding of packed members

This patch implements PR#22821.

Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.

This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member.
Conversions (either implicit or via a valid casting) to pointer types
with lower or equal alignment requirements (e.g. void* or char*)
silence the warning.

This change also adds a new error diagnostic when the user attempts to
bind a reference to a packed member, regardless of the alignment.

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

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

8 years agoRemoving more :option: tags that we do not have corresponding .. option directives...
Aaron Ballman [Thu, 14 Jul 2016 14:07:37 +0000 (14:07 +0000)]
Removing more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15195/steps/docs-clang-html/logs/stdio).

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

8 years agoThe test added in r275267 does not work on read-only checkouts because of the use...
Pierre Gousseau [Thu, 14 Jul 2016 13:58:27 +0000 (13:58 +0000)]
The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t.
Following Tom Rybka suggestion, the test files are now copied to a temporary directory first.

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

8 years agoUpgrade all the .arcconfigs to https.
Benjamin Kramer [Thu, 14 Jul 2016 13:15:37 +0000 (13:15 +0000)]
Upgrade all the .arcconfigs to https.

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

8 years agoThis is a malformed :option: tag -- we don't have an option directive that matches...
Aaron Ballman [Thu, 14 Jul 2016 13:01:00 +0000 (13:01 +0000)]
This is a malformed :option: tag -- we don't have an option directive that matches it, so turning it actual text instead of a markup tag. This will hopefully fix the clang docs build (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15194/steps/docs-clang-html/logs/stdio)

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

8 years ago[OpenCL] Actually activate Frontend/opencl.cl test and fix test bugs
Benjamin Kramer [Thu, 14 Jul 2016 12:56:21 +0000 (12:56 +0000)]
[OpenCL] Actually activate Frontend/opencl.cl test and fix test bugs

rL275318 added the test Frontend/opencl.cl test, but that test was never actually run because Frontend/lit.local.cfg doesn't contain the '.cl' file suffix.

Once the test is activated, it fails with (unintended) compile errors in the newly added CHECK_INVALID_OPENCL_VERSION checks.

This patch adds the '.cl' file suffix to Frontend/lit.local.cfg to activate the test and fixes the test bug by adding '-fblocks' to the relevant command lines.

Patch by Martin Böhme!

Differential Revision: http://reviews.llvm.org/D22349

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

8 years agoCorrect the attribute documentation for the new XRay attributes. Fixes the documentat...
Aaron Ballman [Thu, 14 Jul 2016 12:35:00 +0000 (12:35 +0000)]
Correct the attribute documentation for the new XRay attributes. Fixes the documentation build.

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

8 years ago[X86][AVX512F] minor fix of the parameter names
Asaf Badouh [Thu, 14 Jul 2016 08:40:30 +0000 (08:40 +0000)]
[X86][AVX512F] minor fix of the parameter names
add "__" prefix

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

8 years agoUse hasFlag instead of hasArg
Dean Michael Berris [Thu, 14 Jul 2016 06:37:46 +0000 (06:37 +0000)]
Use hasFlag instead of hasArg

Summary: Fix the build to use hasFlag instead of hasArg for checking some flags.

Reviewers: echristo

Subscribers: mehdi_amini, cfe-commits

Differential Revision: http://reviews.llvm.org/D22338

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

8 years agoAdd C++ dependencies to xray runtime
Dean Michael Berris [Thu, 14 Jul 2016 04:58:44 +0000 (04:58 +0000)]
Add C++ dependencies to xray runtime

Summary:
Depends on D21982 which implements the in-memory logging implementation of the
XRay runtime. These additional changes also depends on D20352 which adds the
bulk of XRay flags/dependencies when using the `-fxray-instrument` flag from
Clang.

Reviewers: echristo, rnk, aaron.ballman

Subscribers: mehdi_amini, cfe-commits

Differential Revision: http://reviews.llvm.org/D21983

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

8 years ago[OpenMP] Sema and parsing for 'target parallel for simd' pragma
Kelvin Li [Thu, 14 Jul 2016 02:54:56 +0000 (02:54 +0000)]
[OpenMP] Sema and parsing for 'target parallel for simd' pragma

This patch is to implement sema and parsing for 'target parallel for simd' pragma.

Differential Revision: http://reviews.llvm.org/D22096

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

8 years agoAdd a comment mirroring the one in LLVM's Dwarf.h
Adrian Prantl [Thu, 14 Jul 2016 00:42:53 +0000 (00:42 +0000)]
Add a comment mirroring the one in LLVM's Dwarf.h

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