]> granicus.if.org Git - clang/log
clang
7 years agoMerging r311695:
Hans Wennborg [Fri, 25 Aug 2017 20:27:58 +0000 (20:27 +0000)]
Merging r311695:
------------------------------------------------------------------------
r311695 | rsmith | 2017-08-24 13:10:33 -0700 (Thu, 24 Aug 2017) | 9 lines

[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any).

Do not sanitize the 'this' pointer of a member call operator for a lambda with
no capture-default, since that call operator can legitimately be called with a
null this pointer from the static invoker function. Any actual call with a null
this pointer should still be caught in the caller (if it is being sanitized).

This reinstates r311589 (reverted in r311680) with the above fix.

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

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

7 years agoReleaseNotes: remove boiler-plate, and minor fixes
Hans Wennborg [Thu, 24 Aug 2017 22:38:21 +0000 (22:38 +0000)]
ReleaseNotes: remove boiler-plate, and minor fixes

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

7 years agoReleaseNotes: drop in-progress warning
Hans Wennborg [Thu, 24 Aug 2017 22:34:18 +0000 (22:34 +0000)]
ReleaseNotes: drop in-progress warning

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

7 years agoMerging r311601:
Hans Wennborg [Thu, 24 Aug 2017 16:21:49 +0000 (16:21 +0000)]
Merging r311601:
------------------------------------------------------------------------
r311601 | adrian | 2017-08-23 14:24:12 -0700 (Wed, 23 Aug 2017) | 5 lines

Fix a bug in CGDebugInfo::EmitInlineFunctionStart causing DILocations to be
parented in function declarations.

Fixes PR33997.
https://bugs.llvm.org/show_bug.cgi?id=33997
------------------------------------------------------------------------

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

7 years agoRelease Notes fix
Hans Wennborg [Thu, 24 Aug 2017 15:49:39 +0000 (15:49 +0000)]
Release Notes fix

Patch by Marek Kurdej!

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

7 years agoRevert r309328 and r309290 (which merged r309327 and r309226).
Hans Wennborg [Wed, 23 Aug 2017 20:50:42 +0000 (20:50 +0000)]
Revert r309328 and r309290 (which merged r309327 and r309226).

The header change caused problems; see PR34182, and PR33858 from #9 onwards, as
well as the discussion on the r309226 cfe-commits thread.

These changes don't seem to be addressing any regression from 4.0.0, so rather
than scrambling to fix this on the branch, let's revert to safety.

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

7 years agoMerging r311330:
Hans Wennborg [Wed, 23 Aug 2017 19:56:39 +0000 (19:56 +0000)]
Merging r311330:
------------------------------------------------------------------------
r311330 | ibiryukov | 2017-08-21 05:03:08 -0700 (Mon, 21 Aug 2017) | 16 lines

Fixed a crash on replaying Preamble's PP conditional stack.

Summary:
The crash occurs when the first token after a preamble is a macro
expansion.
Fixed by moving replayPreambleConditionalStack from Parser into
Preprocessor. It is now called right after the predefines file is
processed.

Reviewers: erikjv, bkramer, klimek, yvvan

Reviewed By: bkramer

Subscribers: cfe-commits

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

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

7 years agoMerging r311532:
Hans Wennborg [Wed, 23 Aug 2017 16:49:21 +0000 (16:49 +0000)]
Merging r311532:
------------------------------------------------------------------------
r311532 | krasimir | 2017-08-23 00:18:36 -0700 (Wed, 23 Aug 2017) | 24 lines

[clang-format] Align trailing comments if ColumnLimit is 0

Summary:
ColumnLimit = 0 means no limit, so comment should always be aligned if requested. This was broken with

  https://llvm.org/svn/llvm-project/cfe/trunk@304687

introduced via

  https://reviews.llvm.org/D33830

and is included in 5.0.0-rc2. This commit fixes it and adds a unittest for this property.

Should go into clang-5.0 IMHO.

Contributed by @pboettch!

Reviewers: djasper, krasimir

Reviewed By: djasper, krasimir

Subscribers: hans, klimek

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

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

7 years agoMerging r311397:
Hans Wennborg [Tue, 22 Aug 2017 22:27:59 +0000 (22:27 +0000)]
Merging r311397:
------------------------------------------------------------------------
r311397 | ahatanak | 2017-08-21 15:46:46 -0700 (Mon, 21 Aug 2017) | 8 lines

[Driver][Darwin] Do not pass -munwind-table if -fno-excpetions is
supplied.

With this change, -fno-exceptions disables unwind tables unless
-funwind-tables is supplied too or the target is x86-64 (x86-64 requires
emitting unwind tables).

rdar://problem/33934446
------------------------------------------------------------------------

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

7 years agoMerging r311391:
Hans Wennborg [Tue, 22 Aug 2017 22:01:04 +0000 (22:01 +0000)]
Merging r311391:
------------------------------------------------------------------------
r311391 | stl_msft | 2017-08-21 15:19:33 -0700 (Mon, 21 Aug 2017) | 28 lines

[Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure.

This is a reasonably non-intrusive change, which I've verified
works for both x86 and x64 DevDiv-internal builds.

The idea is to change `bool IsVS2017OrNewer` into a 3-state
`ToolsetLayout VSLayout`. Either a build is DevDiv-internal,
released VS 2017 or newer, or released VS 2015 or older. When looking at
the directory structure, if instead of `"VC"` we see `"x86ret"`, `"x86chk"`,
`"amd64ret"`, or `"amd64chk"`, we recognize this as a DevDiv-internal build.

After we get past the directory structure validation, we use this knowledge
to regenerate paths appropriately. `llvmArchToDevDivInternalArch()` knows how
we use `"i386"` subdirectories, and `MSVCToolChain::getSubDirectoryPath()`
uses that. It also knows that DevDiv-internal builds have an `"inc"`
subdirectory instead of `"include"`.

This may still not be the "right" fix in any sense, but I believe that it's
non-intrusive in the sense that if the special directory names aren't found,
no codepaths are affected. (`ToolsetLayout::OlderVS` and
`ToolsetLayout::VS2017OrNewer` correspond to `IsVS2017OrNewer` being `false`
or `true`, respectively.) I searched for all references to `IsVS2017OrNewer`,
which are places where Clang cares about VS's directory structure, and the
only one that isn't being patched is some logic to deal with
cross-compilation. I'm fine with that not working for DevDiv-internal builds
for the moment (we typically test the native compilers), so I added a comment.

Fixes D36860.
------------------------------------------------------------------------

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

7 years ago[Docs] Added release notes for OpenCL.
Anastasia Stulova [Tue, 22 Aug 2017 19:29:27 +0000 (19:29 +0000)]
[Docs] Added release notes for OpenCL.

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

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

7 years agoReleaseNotes: coroutines update from Gor
Hans Wennborg [Tue, 22 Aug 2017 17:41:05 +0000 (17:41 +0000)]
ReleaseNotes: coroutines update from Gor

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

7 years agoMerging r311443:
Hans Wennborg [Tue, 22 Aug 2017 16:23:19 +0000 (16:23 +0000)]
Merging r311443:
------------------------------------------------------------------------
r311443 | arphaman | 2017-08-22 03:38:07 -0700 (Tue, 22 Aug 2017) | 15 lines

[ObjC] Check written attributes only when synthesizing ambiguous property

This commit fixes a bug introduced in r307903. The attribute ambiguity checker
that was introduced in r307903 checked all property attributes, which caused
errors for source-compatible properties, like:

@property (nonatomic, readonly) NSObject *prop;
@property (nonatomic, readwrite) NSObject *prop;

because the readwrite property would get implicit 'strong' attribute. The
ambiguity checker should be concerned about explicitly specified attributes
only.

rdar://33748089

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

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

7 years agoMention libclang code-completion changes in release notes
Alex Lorenz [Tue, 22 Aug 2017 13:36:03 +0000 (13:36 +0000)]
Mention libclang code-completion changes in release notes

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

7 years agoMention #pragma pack PCH serialization change in release notes
Alex Lorenz [Tue, 22 Aug 2017 13:23:54 +0000 (13:23 +0000)]
Mention #pragma pack PCH serialization change in release notes

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

7 years agoMention #pragma clang attribute in the release notes
Alex Lorenz [Tue, 22 Aug 2017 13:15:19 +0000 (13:15 +0000)]
Mention #pragma clang attribute in the release notes

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

7 years agoMention the ObjC property synthesis changes in release notes
Alex Lorenz [Tue, 22 Aug 2017 13:11:19 +0000 (13:11 +0000)]
Mention the ObjC property synthesis changes in release notes

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

7 years ago[Sema] Update release notes with details of implicit scalar to vector conversions
Simon Dardis [Tue, 22 Aug 2017 10:01:35 +0000 (10:01 +0000)]
[Sema] Update release notes with details of implicit scalar to vector conversions

Add notes on this to the C language section, along with the C++ section.

Reviewers: bruno, hans

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

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

7 years agoMerging r310983:
Hans Wennborg [Mon, 21 Aug 2017 23:40:02 +0000 (23:40 +0000)]
Merging r310983:
------------------------------------------------------------------------
r310983 | rsmith | 2017-08-15 18:49:53 -0700 (Tue, 15 Aug 2017) | 31 lines

PR19668, PR23034: Fix handling of move constructors and deleted copy
constructors when deciding whether classes should be passed indirectly.

This fixes ABI differences between Clang and GCC:

 * Previously, Clang ignored the move constructor when making this
   determination. It now takes the move constructor into account, per
   https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may
   seem recent, but the ABI change was agreed on the Itanium C++ ABI
   list a long time ago).

 * Previously, Clang's behavior when the copy constructor was deleted
   was unstable -- depending on whether the lazy declaration of the
   copy constructor had been triggered, you might get different behavior.
   We now eagerly declare the copy constructor whenever its deletedness
   is unclear, and ignore deleted copy/move constructors when looking for
   a trivial such constructor.

This also fixes an ABI difference between Clang and MSVC:

 * If the copy constructor would be implicitly deleted (but has not been
   lazily declared yet), for instance because the class has an rvalue
   reference member, we would pass it directly. We now pass such a class
   indirectly, matching MSVC.

Based on a patch by Vassil Vassilev, which was based on a patch by Bernd
Schmidt, which was based on a patch by Reid Kleckner!

This is a re-commit of r310401, which was reverted in r310464 due to ARM
failures (which should now be fixed).

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

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

7 years agoMerging r311182:
Hans Wennborg [Mon, 21 Aug 2017 20:27:26 +0000 (20:27 +0000)]
Merging r311182:
------------------------------------------------------------------------
r311182 | alexshap | 2017-08-18 11:20:43 -0700 (Fri, 18 Aug 2017) | 22 lines

[analyzer] Fix modeling of constructors

This diff fixes analyzer's crash (triggered assert) on the newly added test case.
The assert being discussed is assert(!B.lookup(R, BindingKey::Direct))
in lib/StaticAnalyzer/Core/RegionStore.cpp, however the root cause is different.
For classes with empty bases the offsets might be tricky.
For example, let's assume we have
 struct S: NonEmptyBase, EmptyBase {
     ...
 };
In this case Clang applies empty base class optimization and
the offset of EmptyBase will be 0, it can be verified via
clang -cc1 -x c++ -v -fdump-record-layouts main.cpp -emit-llvm -o /dev/null.
When the analyzer tries to perform zero initialization of EmptyBase
it will hit the assert because that region
has already been "written" by the constructor of NonEmptyBase.

Test plan:
make check-all

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

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

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

7 years agoUpdate Clang 5.0 release notes for ms_abi and __builtin_ms_va_list for aarch64
Martin Storsjo [Mon, 21 Aug 2017 18:45:39 +0000 (18:45 +0000)]
Update Clang 5.0 release notes for ms_abi and __builtin_ms_va_list for aarch64

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

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

7 years agoMention some warning-related additions and changes for LLVM 5
Alex Lorenz [Mon, 21 Aug 2017 17:47:51 +0000 (17:47 +0000)]
Mention some warning-related additions and changes for LLVM 5
release notes

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

7 years agoUpdate LLVM 5.0 release notes for clang.cindex changes
Jonathan Coe [Sat, 19 Aug 2017 01:24:47 +0000 (01:24 +0000)]
Update LLVM 5.0 release notes for clang.cindex changes

Summary: This patch should be applied to clang 5.0 release notes, NOT to trunk.

Reviewers: rengolin, hans

Reviewed By: hans

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

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

7 years agoAdd release notes for r299463.
Dominic Chen [Sat, 19 Aug 2017 00:09:24 +0000 (00:09 +0000)]
Add release notes for r299463.

Implement z3-based constraint solver backend for clang static analyzer.

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

7 years agoMerging r311115:
Hans Wennborg [Fri, 18 Aug 2017 20:28:06 +0000 (20:28 +0000)]
Merging r311115:
------------------------------------------------------------------------
r311115 | rsmith | 2017-08-17 12:35:50 -0700 (Thu, 17 Aug 2017) | 2 lines

PR34161: support evaluation of 'void()' expressions in C++14 onwards.

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

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

7 years agoMerging r310776:
Hans Wennborg [Thu, 17 Aug 2017 17:26:33 +0000 (17:26 +0000)]
Merging r310776:
------------------------------------------------------------------------
r310776 | rsmith | 2017-08-11 18:46:03 -0700 (Fri, 11 Aug 2017) | 8 lines

PR34163: Don't cache an incorrect key function for a class if queried between
the class becoming complete and its inline methods being parsed.

This replaces the hack of using the "late parsed template" flag to track member
functions with bodies we've not parsed yet; instead we now use the "will have
body" flag, which carries the desired implication that the function declaration
*is* a definition, and that we've just not parsed its body yet.

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

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

7 years agoMerging r310672:
Hans Wennborg [Thu, 17 Aug 2017 16:48:03 +0000 (16:48 +0000)]
Merging r310672:
------------------------------------------------------------------------
r310672 | ahatanak | 2017-08-10 17:06:49 -0700 (Thu, 10 Aug 2017) | 7 lines

[Sema][ObjC] Fix spurious -Wcast-qual warnings.

We do not meaningfully track object const-ness of Objective-C object
types. Silence the -Wcast-qual warning that is issued when casting to or
from Objective-C object types results in losing const qualification.

rdar://problem/33807915
------------------------------------------------------------------------

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

7 years agoMerging r310706 and r310829:
Hans Wennborg [Tue, 15 Aug 2017 00:24:02 +0000 (00:24 +0000)]
Merging r310706 and r310829:
------------------------------------------------------------------------
r310706 | arphaman | 2017-08-11 05:06:52 -0700 (Fri, 11 Aug 2017) | 11 lines

[modules] Set the lexical DC for dummy tag decls that refer to hidden
declarations that are made visible after the dummy is parsed and ODR verified

Prior to this commit the
"(getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."),"
assertion failure was triggered during semantic analysis of the dummy
tag declaration that was declared in another tag declaration because its
lexical context did not point to the outer tag decl.

rdar://32292196

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

------------------------------------------------------------------------
r310829 | arphaman | 2017-08-14 03:59:44 -0700 (Mon, 14 Aug 2017) | 5 lines

Set the lexical context for dummy tag decl inside createTagFromNewDecl

This is a follow-up to r310706. This change has been recommended by
Bruno Cardoso Lopes and Richard Smith.

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

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

7 years agoMerging r310804:
Hans Wennborg [Mon, 14 Aug 2017 17:27:59 +0000 (17:27 +0000)]
Merging r310804:
------------------------------------------------------------------------
r310804 | rsmith | 2017-08-13 15:26:53 -0700 (Sun, 13 Aug 2017) | 2 lines

Replace remaining user-visible mentions of C++1z with C++17.

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

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

7 years agoMerging r310516:
Hans Wennborg [Mon, 14 Aug 2017 15:48:04 +0000 (15:48 +0000)]
Merging r310516:
------------------------------------------------------------------------
r310516 | hans | 2017-08-09 13:12:53 -0700 (Wed, 09 Aug 2017) | 13 lines

Make -std=c++17 an alias of -std=c++1z

As suggested on PR33912.

Trying to keep this small to make it easy to merge to the 5.0 branch. We
can do a follow-up with more thorough renaming (diagnostic text,
options, ids, etc.) later.

(For C++14 this was done in r215982, and I think a smaller patch for the
3.5 branch:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20140818/113013.html)

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

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

7 years agoMerging r310704:
Hans Wennborg [Fri, 11 Aug 2017 16:32:49 +0000 (16:32 +0000)]
Merging r310704:
------------------------------------------------------------------------
r310704 | smaksimovic | 2017-08-11 04:39:07 -0700 (Fri, 11 Aug 2017) | 8 lines

Revert r302670 for the upcoming 5.0.0 release

This is causing failures when compiling clang with -O3
as one of the structures used by clang is passed by
value and uses the fastcc calling convention.

Faliures manifest for stage2 mips build.

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

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

7 years agoRevert r310074 (see PR34067 #4)
Hans Wennborg [Fri, 11 Aug 2017 16:30:46 +0000 (16:30 +0000)]
Revert r310074 (see PR34067 #4)

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

7 years agoMerging r310700:
Hans Wennborg [Fri, 11 Aug 2017 16:18:44 +0000 (16:18 +0000)]
Merging r310700:
------------------------------------------------------------------------
r310700 | yamaguchi | 2017-08-11 02:44:42 -0700 (Fri, 11 Aug 2017) | 11 lines

[Bash-autocompletion] Add --autocomplete flag to 5.0 release notes

Summary:
I thought we should add this information to release notes, because we
added a new flag to clang driver.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

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

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

7 years agoMerging r310694:
Hans Wennborg [Fri, 11 Aug 2017 16:16:08 +0000 (16:16 +0000)]
Merging r310694:
------------------------------------------------------------------------
r310694 | rsmith | 2017-08-10 20:39:40 -0700 (Thu, 10 Aug 2017) | 2 lines

Implement latest feature test macro recommendations, P0096R4.

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

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

7 years agoMerging r309054:
Hans Wennborg [Fri, 11 Aug 2017 16:14:07 +0000 (16:14 +0000)]
Merging r309054:
------------------------------------------------------------------------
r309054 | rsmith | 2017-07-25 16:31:42 -0700 (Tue, 25 Jul 2017) | 2 lines

Reorder tests to match latest SD-6 draft.

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

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

7 years agoMerging r310692:
Hans Wennborg [Fri, 11 Aug 2017 16:07:17 +0000 (16:07 +0000)]
Merging r310692:
------------------------------------------------------------------------
r310692 | rsmith | 2017-08-10 20:14:20 -0700 (Thu, 10 Aug 2017) | 2 lines

PR33850: Update cxx_dr_status for Clang 5 branch.

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

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

7 years agoMerging r310691:
Hans Wennborg [Fri, 11 Aug 2017 15:58:58 +0000 (15:58 +0000)]
Merging r310691:
------------------------------------------------------------------------
r310691 | rsmith | 2017-08-10 19:04:19 -0700 (Thu, 10 Aug 2017) | 2 lines

PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.

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

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

7 years agoMerging r310006:
Hans Wennborg [Fri, 11 Aug 2017 01:47:32 +0000 (01:47 +0000)]
Merging r310006:
------------------------------------------------------------------------
r310006 | ahatanak | 2017-08-03 16:55:42 -0700 (Thu, 03 Aug 2017) | 22 lines

[Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.

This commit fixes a bug where clang/llvm doesn't emit an unwind table
for a function when it is marked noexcept. Without this patch, the
following code terminates with an uncaught exception on ARM64:

int foo1() noexcept {
  try {
    throw 0;
  } catch (int i) {
    return 0;
  }
  return 1;
}

int main() {
  return foo1();
}

rdar://problem/32411865

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

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

7 years agoMerging r309633, r309636 and r309640:
Hans Wennborg [Fri, 11 Aug 2017 01:45:48 +0000 (01:45 +0000)]
Merging r309633, r309636 and r309640:
------------------------------------------------------------------------
r309633 | ahatanak | 2017-07-31 15:19:34 -0700 (Mon, 31 Jul 2017) | 6 lines

[Driver] Make sure the deployment target is earlier than iOS 11 when
it is inferred from -isysroot.

This fixes a change that was inadvertently introduced in r309607.

rdar://problem/32230613
------------------------------------------------------------------------

------------------------------------------------------------------------
r309636 | ahatanak | 2017-07-31 15:46:00 -0700 (Mon, 31 Jul 2017) | 1 line

Silence warning -Wmissing-sysroot.
------------------------------------------------------------------------

------------------------------------------------------------------------
r309640 | ahatanak | 2017-07-31 16:08:52 -0700 (Mon, 31 Jul 2017) | 1 line

Use -target instead of -arch in test case.
------------------------------------------------------------------------

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

7 years agoMerging r309607:
Hans Wennborg [Fri, 11 Aug 2017 01:41:23 +0000 (01:41 +0000)]
Merging r309607:
------------------------------------------------------------------------
r309607 | ahatanak | 2017-07-31 12:16:40 -0700 (Mon, 31 Jul 2017) | 6 lines

[Driver] Allow users to silence the warning that is issued when the
deployment target is earlier than iOS 11 and the target is 32-bit.

This is a follow-up to r306922.

rdar://problem/32230613
------------------------------------------------------------------------

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

7 years agoMerging r309569:
Hans Wennborg [Fri, 11 Aug 2017 01:00:59 +0000 (01:00 +0000)]
Merging r309569:
------------------------------------------------------------------------
r309569 | alexfh | 2017-07-31 08:21:26 -0700 (Mon, 31 Jul 2017) | 39 lines

Fix -Wshadow false positives with function-local classes.

Summary:
Fixes http://llvm.org/PR33947.

https://godbolt.org/g/54XRMT

void f(int a) {
  struct A {
    void g(int a) {}
    A() { int a; }
  };
}

3 : <source>:3:16: warning: declaration shadows a local variable [-Wshadow]
    void g(int a) {}
               ^
1 : <source>:1:12: note: previous declaration is here
void f(int a) {
           ^
4 : <source>:4:15: warning: declaration shadows a local variable [-Wshadow]
    A() { int a; }
              ^
1 : <source>:1:12: note: previous declaration is here
void f(int a) {
           ^
2 warnings generated.

The local variable `a` of the function `f` can't be accessed from a method of
the function-local class A, thus no shadowing occurs and no diagnostic is
needed.

Reviewers: rnk, rsmith, arphaman, Quuxplusone

Reviewed By: rnk, Quuxplusone

Subscribers: Quuxplusone, cfe-commits

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

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

7 years agoMerging r308722:
Hans Wennborg [Tue, 8 Aug 2017 18:38:07 +0000 (18:38 +0000)]
Merging r308722:
------------------------------------------------------------------------
r308722 | ibiryukov | 2017-07-21 02:24:00 -0700 (Fri, 21 Jul 2017) | 13 lines

Fixed failing assert in code completion.

Summary:
The code was accessing uninstantiated default argument.
This resulted in failing assertion at ParmVarDecl::getDefaultArg().

Reviewers: erikjv, klimek, bkramer, krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

7 years agoMerging r309263:
Hans Wennborg [Tue, 8 Aug 2017 18:34:26 +0000 (18:34 +0000)]
Merging r309263:
------------------------------------------------------------------------
r309263 | psmith | 2017-07-27 03:43:53 -0700 (Thu, 27 Jul 2017) | 6 lines

[CodeGen][ARM] ARM runtime helper functions are not always soft-fp

Re-commit r309257 with less precise register checks in arm-float-helpers.c
test.

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

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

7 years agoMerging r310359:
Hans Wennborg [Tue, 8 Aug 2017 18:15:02 +0000 (18:15 +0000)]
Merging r310359:
------------------------------------------------------------------------
r310359 | n.bozhenov | 2017-08-08 07:13:50 -0700 (Tue, 08 Aug 2017) | 4 lines

[libclang] Fix PR34055 (incompatible update of clang-c/Index.h)

Fixes a regression introduced by r308218.

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

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

7 years agoMerging r310158:
Hans Wennborg [Mon, 7 Aug 2017 20:45:55 +0000 (20:45 +0000)]
Merging r310158:
------------------------------------------------------------------------
r310158 | rtrieu | 2017-08-04 17:54:19 -0700 (Fri, 04 Aug 2017) | 8 lines

[ODRHash] Treat some non-templated classes as templated.

When using nested classes, if the inner class is not templated, but the outer
class is templated, the inner class will not be templated, but may have some
traits as if it were.  This is particularly evident if the inner class
refers to the outer class in some fashion.  Treat any class that is in the
context of a templated class as also a templated class.

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

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

7 years agoMerging r310191:
Hans Wennborg [Mon, 7 Aug 2017 20:15:58 +0000 (20:15 +0000)]
Merging r310191:
------------------------------------------------------------------------
r310191 | ctopper | 2017-08-05 16:35:54 -0700 (Sat, 05 Aug 2017) | 18 lines

[X86] Enable isel to use the PAUSE instruction even when SSE2 is disabled. Clang part

Summary:
On older processors this instruction encoding is treated as a NOP.

MSVC doesn't disable intrinsics based on features the way clang/gcc does. Because the PAUSE instruction encoding doesn't crash older processors, some software out there uses these intrinsics without checking for SSE2.

This change also seems to also be consistent with gcc behavior.

Fixes PR34079

Reviewers: RKSimon, zvi

Reviewed By: RKSimon

Subscribers: cfe-commits

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

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

7 years agoMerging r310057:
Hans Wennborg [Fri, 4 Aug 2017 17:19:44 +0000 (17:19 +0000)]
Merging r310057:
------------------------------------------------------------------------
r310057 | smaksimovic | 2017-08-04 05:37:34 -0700 (Fri, 04 Aug 2017) | 8 lines

Revert r304953 for release 5.0.0

This is causing failures when compiling clang with -O3
as one of the structures used by clang is passed by
value and uses the fastcc calling convention.

Faliures manifest for stage2 mips build.

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

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

7 years agoMerging r309975: (except the docs/ part)
Hans Wennborg [Fri, 4 Aug 2017 16:48:43 +0000 (16:48 +0000)]
Merging r309975: (except the docs/ part)
------------------------------------------------------------------------
r309975 | rsmith | 2017-08-03 12:24:27 -0700 (Thu, 03 Aug 2017) | 4 lines

Don't emit undefined-internal warnings for CXXDeductionGuideDecls.

Patch by ~paul (cynecx on phabricator)! Some test massaging by me.

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

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

7 years agoMerging r308996:
Hans Wennborg [Thu, 3 Aug 2017 16:12:51 +0000 (16:12 +0000)]
Merging r308996:
------------------------------------------------------------------------
r308996 | gornishanov | 2017-07-25 11:01:49 -0700 (Tue, 25 Jul 2017) | 9 lines

[coroutines] Add serialization/deserialization of coroutines

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: EricWF, cfe-commits

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

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

7 years agoMerging r309523:
Hans Wennborg [Wed, 2 Aug 2017 17:42:08 +0000 (17:42 +0000)]
Merging r309523:
------------------------------------------------------------------------
r309523 | brad | 2017-07-30 14:13:59 -0700 (Sun, 30 Jul 2017) | 2 lines

Also pass -pie back to the linker when linking on OpenBSD.

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

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

7 years agoMerging r309722:
Hans Wennborg [Tue, 1 Aug 2017 23:54:32 +0000 (23:54 +0000)]
Merging r309722:
------------------------------------------------------------------------
r309722 | bruno | 2017-08-01 12:05:25 -0700 (Tue, 01 Aug 2017) | 7 lines

[Sema] Fix lax conversion between non ext vectors

r282968 introduced a regression due to the lack of proper testing.
Re-add lax conversion support between non ext vectors for compound
assignments and add a test for that.

rdar://problem/28639467
------------------------------------------------------------------------

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

7 years agoMerging r309752:
Hans Wennborg [Tue, 1 Aug 2017 23:32:23 +0000 (23:32 +0000)]
Merging r309752:
------------------------------------------------------------------------
r309752 | bruno | 2017-08-01 15:10:36 -0700 (Tue, 01 Aug 2017) | 6 lines

[Headers][Darwin] Allow #include_next<float.h> to work on Darwin prior to 10.7

This fixes PR31504 and it's a follow up from adding #include_next<float.h>
for Darwin in r289018.

rdar://problem/29856682
------------------------------------------------------------------------

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

7 years agoMerging r309382:
Hans Wennborg [Mon, 31 Jul 2017 17:29:29 +0000 (17:29 +0000)]
Merging r309382:
------------------------------------------------------------------------
r309382 | rksimon | 2017-07-28 06:47:02 -0700 (Fri, 28 Jul 2017) | 3 lines

[X86] Add tests showing inability of vector non-temporal load/store intrinsic to force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.
------------------------------------------------------------------------
Merging r309383:
------------------------------------------------------------------------
r309383 | rksimon | 2017-07-28 07:01:51 -0700 (Fri, 28 Jul 2017) | 1 line

Strip trailing whitespace. NFCI.
------------------------------------------------------------------------
Merging r309488:
------------------------------------------------------------------------
r309488 | rksimon | 2017-07-29 08:33:34 -0700 (Sat, 29 Jul 2017) | 7 lines

[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets (annoyingly in the driver not via cc1), meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

This patch casts the vectors to explicitly aligned types prior to the load/store to ensure that the require alignment is respected.

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

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

7 years agoMerging r309503:
Hans Wennborg [Mon, 31 Jul 2017 17:00:55 +0000 (17:00 +0000)]
Merging r309503:
------------------------------------------------------------------------
r309503 | rsmith | 2017-07-29 23:31:29 -0700 (Sat, 29 Jul 2017) | 6 lines

PR33902: Invalidate line number cache when adding more text to existing buffer.

This led to crashes as the line number cache would report a bogus line number
for a line of code, and we'd try to find a nonexistent column within the line
when printing diagnostics.

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

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

7 years agoMerging r309113:
Hans Wennborg [Fri, 28 Jul 2017 21:31:07 +0000 (21:31 +0000)]
Merging r309113:
------------------------------------------------------------------------
r309113 | yamaguchi | 2017-07-26 06:36:58 -0700 (Wed, 26 Jul 2017) | 19 lines

[Bash-autocompletion] Show HelpText with possible flags

Summary:
`clang --autocomplete=-std` will show
```
-std:   Language standard to compile for
-std=   Language standard to compile for
-stdlib=        C++ standard library to use
```
after this change.

However, showing HelpText with completion in bash seems super tricky, so
this feature will be used in other shells (fish, zsh...).

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

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

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

7 years agoMerging r309112:
Hans Wennborg [Fri, 28 Jul 2017 21:25:21 +0000 (21:25 +0000)]
Merging r309112:
------------------------------------------------------------------------
r309112 | yamaguchi | 2017-07-26 06:30:36 -0700 (Wed, 26 Jul 2017) | 7 lines

[Bash-completion] Fixed a bug that file doesn't autocompleted after =

Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

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

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

7 years agoMerging r309327:
Hans Wennborg [Thu, 27 Jul 2017 22:08:00 +0000 (22:08 +0000)]
Merging r309327:
------------------------------------------------------------------------
r309327 | compnerd | 2017-07-27 14:56:25 -0700 (Thu, 27 Jul 2017) | 5 lines

Headers: fix _Unwind_{G,S}etGR for non-EHABI targets

The EHABI definition was being inlined into the users even when EHABI
was not in use.  Adjust the condition to ensure that the right version
is defined.
------------------------------------------------------------------------

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

7 years agoMerging r309226:
Hans Wennborg [Thu, 27 Jul 2017 16:45:43 +0000 (16:45 +0000)]
Merging r309226:
------------------------------------------------------------------------
r309226 | compnerd | 2017-07-26 15:55:23 -0700 (Wed, 26 Jul 2017) | 13 lines

Headers: improve ARM EHABI coverage of unwind.h

Ensure that we define the `_Unwind_Control_Block` structure used on ARM
EHABI targets.  This is needed for building libc++abi with the unwind.h
from the resource dir.  A minor fallout of this is that we needed to
create a typedef for _Unwind_Exception to work across ARM EHABI and
non-EHABI targets.  The structure definitions here are based originally
on the documentation from ARM under the "Exception Handling ABI for the
ARM® Architecture" Section 7.2.  They are then adjusted to more closely
reflect the definition in libunwind from LLVM.  Those changes are
compatible in layout but permit easier use in libc++abi and help
maintain compatibility between libunwind and the compiler provided
definition.
------------------------------------------------------------------------

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

7 years agoRevert r304899 and r304836: It's not clear printing all targets with --version is...
Hans Wennborg [Thu, 27 Jul 2017 16:20:45 +0000 (16:20 +0000)]
Revert r304899 and r304836: It's not clear printing all targets with --version is the right thing to do (see discussion on D33900)

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

7 years agoMerging r309058:
Hans Wennborg [Wed, 26 Jul 2017 16:35:53 +0000 (16:35 +0000)]
Merging r309058:
------------------------------------------------------------------------
r309058 | majnemer | 2017-07-25 16:33:58 -0700 (Tue, 25 Jul 2017) | 9 lines

[CodeGen] Correctly model std::byte's aliasing properties

std::byte, when defined as an enum, needs to be given special treatment
with regards to its aliasing properties. An array of std::byte is
allowed to be used as storage for other types.

This fixes PR33916.

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

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

7 years agoMerging r308824:
Hans Wennborg [Wed, 26 Jul 2017 16:15:18 +0000 (16:15 +0000)]
Merging r308824:
------------------------------------------------------------------------
r308824 | yamaguchi | 2017-07-22 05:35:15 -0700 (Sat, 22 Jul 2017) | 5 lines

[Bash-autocompletion] Fixed typo and add '-' after -Wno

Summary: -Wno-<warning> was autocompleted as -Wno<warning>, so fixed this typo.

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

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

7 years agoMerging r308897:
Hans Wennborg [Tue, 25 Jul 2017 17:10:17 +0000 (17:10 +0000)]
Merging r308897:
------------------------------------------------------------------------
r308897 | nico | 2017-07-24 09:54:11 -0700 (Mon, 24 Jul 2017) | 9 lines

Work around an MSVC2017 update 3 codegen bug.

C2017 update 3 produces a clang that crashes when compiling clang. Disabling
optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go
away.

Patch from Bruce Dawson <brucedawson@chromium.org>!
https://reviews.llvm.org/D35757

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

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

8 years agoRegenerate ClangCommandLineReference.rst
Hans Wennborg [Fri, 21 Jul 2017 08:17:53 +0000 (08:17 +0000)]
Regenerate ClangCommandLineReference.rst

I ran:

$ bin/clang-tblgen -gen-opt-docs -I../cfe.src/include \
    -I../cfe.src/include/clang/Driver -I../llvm.src/include \
    ../cfe.src/include/clang/Driver/ClangOptionDocs.td \
    -o ../cfe.src/docs/ClangCommandLineReference.rst

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

8 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 19 Jul 2017 14:44:30 +0000 (14:44 +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_50@308481 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMerging r308455:
Hans Wennborg [Wed, 19 Jul 2017 13:02:51 +0000 (13:02 +0000)]
Merging r308455:
------------------------------------------------------------------------
r308455 | hans | 2017-07-19 05:31:01 -0700 (Wed, 19 Jul 2017) | 16 lines

Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files"

This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until
it's fixed, especially since this landed just before the 5.0 branch.

> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
>
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
>
> rdar://10184173
>
> Differential Revision: https://reviews.llvm.org/D35484
------------------------------------------------------------------------

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

8 years agoCreating release_50 branch off revision 308441
Hans Wennborg [Wed, 19 Jul 2017 12:20:43 +0000 (12:20 +0000)]
Creating release_50 branch off revision 308441

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

8 years agoRecommit r308327: Add a warning for missing '#pragma pack (pop)'
Alex Lorenz [Wed, 19 Jul 2017 11:30:41 +0000 (11:30 +0000)]
Recommit r308327: Add a warning for missing '#pragma pack (pop)'
and suspicious uses of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

8 years agoFix compilation problem introduced in r308433
Erik Verbruggen [Wed, 19 Jul 2017 11:15:36 +0000 (11:15 +0000)]
Fix compilation problem introduced in r308433

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

8 years agoRevert "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 11:11:02 +0000 (11:11 +0000)]
Revert "[mips] Teach the driver to accept -m(no-)gpopt."

Revert r308431 and r308432, these caused broke some buildbots.

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

8 years agoAdd default values for function parameter chunks
Erik Verbruggen [Wed, 19 Jul 2017 10:45:40 +0000 (10:45 +0000)]
Add default values for function parameter chunks

Append optional chunks with their default values. For example:
before - "int i", after - "int i = 10"

Patch by Ivan Donchevskii!

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

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

8 years ago[mips] Add warning test for -mgpopt option.
Simon Dardis [Wed, 19 Jul 2017 10:39:15 +0000 (10:39 +0000)]
[mips] Add warning test for -mgpopt option.

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

8 years ago[mips] Teach the driver to accept -m(no-)gpopt.
Simon Dardis [Wed, 19 Jul 2017 10:38:03 +0000 (10:38 +0000)]
[mips] Teach the driver to accept -m(no-)gpopt.

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

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

8 years agoUpdate clang-cl options in the users manual
Hans Wennborg [Wed, 19 Jul 2017 09:52:24 +0000 (09:52 +0000)]
Update clang-cl options in the users manual

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

8 years ago[analyzer] Add annotation attribute to trust retain count implementation
Devin Coughlin [Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)]
[analyzer] Add annotation attribute to trust retain count implementation

Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

Adding this annotation avoids spurious diagnostics when the implementation of
a reference counting operation is visible but the analyzer can't reason
precisely about the ref count.

Patch by Malhar Thakkar!

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

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

8 years ago[CMake] Build runtimes for Fuchsia targets
Petr Hosek [Wed, 19 Jul 2017 02:57:47 +0000 (02:57 +0000)]
[CMake] Build runtimes for Fuchsia targets

This relies on the multi-target runtimes build support.

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

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

8 years ago[scan-build-py] Patch to fix "-analyzer-config" option
Petr Hosek [Wed, 19 Jul 2017 00:29:41 +0000 (00:29 +0000)]
[scan-build-py] Patch to fix "-analyzer-config" option

I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on
scan-build-py it will throw an error message "error reading
'ipa=basic-inlining'".

After debugging, it turns out that the scan-build-py does not put
"-analyzer-config" flag in front of the analyzer config flags (in this
case is the "ipa=basic-inlining") in the final clang command line. This
patch fixes this issue.

Patch by Haowei Wu

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

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

8 years agoUpdate for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
Adrian Prantl [Wed, 19 Jul 2017 00:09:58 +0000 (00:09 +0000)]
Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).

<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822

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

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

8 years agoDebug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Adrian Prantl [Tue, 18 Jul 2017 23:58:34 +0000 (23:58 +0000)]
Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.

Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.

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

8 years ago[Driver] Always use -z rodynamic for Fuchsia
Petr Hosek [Tue, 18 Jul 2017 23:23:16 +0000 (23:23 +0000)]
[Driver] Always use -z rodynamic for Fuchsia

Fuchsia uses read-only .dynamic section.

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

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

8 years agoConvert attribute 'target' parsing from a 'pair' to a 'struct' to make further improv...
Erich Keane [Tue, 18 Jul 2017 20:41:02 +0000 (20:41 +0000)]
Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further improvements easier

Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further
improvements easier

The attribute 'target' parse function previously returned a pair. Convert
this to a 'pair' in order to add more functionality, and improve usability.

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

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

8 years ago[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp
Erik Pilkington [Tue, 18 Jul 2017 20:32:07 +0000 (20:32 +0000)]
[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp

Previously, this was awkwardly split up between SemaExpr.cpp.

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

8 years ago[OPENMP] Initial support for 'task_reduction' clause.
Alexey Bataev [Tue, 18 Jul 2017 20:17:46 +0000 (20:17 +0000)]
[OPENMP] Initial support for 'task_reduction' clause.

Parsing/sema analysis of the 'task_reduction' clause.

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

8 years agoAdd GCC's noexcept-type alias for c++1z-compat-mangling
Raphael Isemann [Tue, 18 Jul 2017 18:52:58 +0000 (18:52 +0000)]
Add GCC's noexcept-type alias for c++1z-compat-mangling

Summary: GCC has named this `-Wnoexcept-type`, so let's add an alias to stay compatible with the GCC flags.

Reviewers: rsmith, dexonsmith

Reviewed By: dexonsmith

Subscribers: cfe-commits, karies, v.g.vassilev, ahatanak

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

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

8 years agoDon't set TUScope to null when generating a module in incremental processing mode.
Raphael Isemann [Tue, 18 Jul 2017 18:24:42 +0000 (18:24 +0000)]
Don't set TUScope to null when generating a module in incremental processing mode.

Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates.

Reviewers: rsmith, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: cfe-commits, v.g.vassilev

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

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

8 years agoRevert r308327
Alex Lorenz [Tue, 18 Jul 2017 17:36:42 +0000 (17:36 +0000)]
Revert r308327

I forgot to test clang-tools-extra which is now failing.

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

8 years agoAdd a warning for missing '#pragma pack (pop)' and suspicious uses
Alex Lorenz [Tue, 18 Jul 2017 17:23:51 +0000 (17:23 +0000)]
Add a warning for missing '#pragma pack (pop)' and suspicious uses
of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

8 years ago[OPENMP] Generalization of sema analysis of reduction-based clauses,
Alexey Bataev [Tue, 18 Jul 2017 15:32:58 +0000 (15:32 +0000)]
[OPENMP] Generalization of sema analysis of reduction-based clauses,
NFC.

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

8 years agoCodeGen: Insert addr space cast for automatic/temp var at right position
Yaxun Liu [Tue, 18 Jul 2017 14:46:03 +0000 (14:46 +0000)]
CodeGen: Insert addr space cast for automatic/temp var at right position

The uses of alloca may be in different blocks other than the block containing the alloca.
Therefore if the alloca addr space is non-zero and it needs to be casted to default
address space, the cast needs to be inserted in the same BB as the alloca insted of
the current builder insert point since the current insert point may be in a different BB.

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

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

8 years agoclang-format: [JS] Correctly format JavaScript imports with long module paths
Martin Probst [Tue, 18 Jul 2017 14:00:19 +0000 (14:00 +0000)]
clang-format: [JS] Correctly format JavaScript imports with long module paths

Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports where the module path is not on the same line as the `from` keyword.
For example:

    import {A} from
    'some/path/longer/than/column/limit/module.js';```

This causes issues when in the middle a list of imports because the formatter
thinks it has reached the end of the imports, and therefore will not sort any
imports lower in the list.

The formatter will, however, split the `from` keyword and the module path if
the path exceeds the column limit, which triggers the issue the next time the
file is formatted.

Patch originally by Jared Neil - thanks!

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

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

8 years ago[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config...
NAKAMURA Takumi [Tue, 18 Jul 2017 08:55:03 +0000 (08:55 +0000)]
[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config/config.h.

LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h.

FIXME: It'd be better that they are #cmakedefine01 rather than #cmakedefine.
(#if FOO rather than #if defined(FOO))
Then we can find missing #include "clang/Config/config.h" in the future.

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

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

8 years ago[Index] Prevent canonical decl becoming nullptr
Krasimir Georgiev [Tue, 18 Jul 2017 07:20:53 +0000 (07:20 +0000)]
[Index] Prevent canonical decl becoming nullptr

Summary:
This patch prevents getCanonicalDecl returning nullptr in case it finds
a canonical TemplateDeclaration with no attached TemplatedDecl.
Found by running the indexer over a version of the standard library deep inside
a template metaprogramming mess.

Reviewers: klimek, vsk

Reviewed By: vsk

Subscribers: vsk, arphaman, cfe-commits

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

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

8 years agoAlso add the option -no-pie (like -nopie)
Sylvestre Ledru [Tue, 18 Jul 2017 06:54:54 +0000 (06:54 +0000)]
Also add the option -no-pie (like -nopie)

Summary:
For example, this option is expected by ghc (haskell compiler). Currently, building with ghc will fail with:

```
clang: error: unknown argument: '-no-pie'
`gcc' failed in phase `Linker'. (Exit code: 1)
. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
configure_recipe
```

This won't do anything (but won't fail with an error)

Reviewers: rafael, joerg

Reviewed By: joerg

Subscribers: joerg, cfe-commits

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

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

8 years ago[OpenCL] Added extended tests on metadata generation for half data type and arrays.
Egor Churaev [Tue, 18 Jul 2017 06:04:01 +0000 (06:04 +0000)]
[OpenCL] Added extended tests on metadata generation for half data type and arrays.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: bader, cfe-commits, yaxunl

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

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

8 years ago[OPENMP] Pacify windows buildbots, NFC.
Alexey Bataev [Tue, 18 Jul 2017 00:42:35 +0000 (00:42 +0000)]
[OPENMP] Pacify windows buildbots, NFC.

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

8 years ago[analyzer] Add missing documentation for static analyzer checkers
Devin Coughlin [Tue, 18 Jul 2017 00:34:57 +0000 (00:34 +0000)]
[analyzer] Add missing documentation for static analyzer checkers

Some checks did not have documentation in the www/analyzer/ folder and also
some alpha checks became non-alpha.

Patch by Dominik Szabó!

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

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

8 years ago[COFF, ARM64] Set the data type widths and the data layout string
Mandeep Singh Grang [Mon, 17 Jul 2017 21:10:45 +0000 (21:10 +0000)]
[COFF, ARM64] Set the data type widths and the data layout string

Summary: COFF ARM64 is LLP64 platform. So int is 4 bytes, long is 4 bytes and long long is 8 bytes.

Reviewers: compnerd, ruiu, rnk, efriedma

Reviewed By: compnerd, efriedma

Subscribers: efriedma, javed.absar, cfe-commits, aemerson, llvm-commits, kristof.beyls

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

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

8 years ago[AArch64] Add support for __builtin_ms_va_list on aarch64
Martin Storsjo [Mon, 17 Jul 2017 20:49:45 +0000 (20:49 +0000)]
[AArch64] Add support for __builtin_ms_va_list on aarch64

Move builtins from the x86 specific scope into the global
scope. Their use is still limited to x86_64 and aarch64 though.

This allows wine on aarch64 to properly handle variadic functions.

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

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

8 years agoUpdate use of llvm::CallingConv:X86_64_Win64 after LLVM commit r308208
Martin Storsjo [Mon, 17 Jul 2017 20:05:56 +0000 (20:05 +0000)]
Update use of llvm::CallingConv:X86_64_Win64 after LLVM commit r308208

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

8 years ago[Basic] Detect Git submodule version in CMake
Brian Gesiak [Mon, 17 Jul 2017 19:22:57 +0000 (19:22 +0000)]
[Basic] Detect Git submodule version in CMake

Summary:
When searching for Git version control information, libBasic's CMake
checks for the path '.git/logs/HEAD'. However, when LLVM is included as
a Git submodule, this path does not exist. Instead, it contains a '.git'
file with the following:

```
gitdir: ../../.git/modules/external/llvm
```

Where '../..' is the relative path to the root repository that contains
the LLVM Git submodule.

Because of this discrepancy, `clang --version` does not output source
control information if built from a Git submodule.

To fix, check whether '.git' is a directory or a file. If it's a
directory, simply use the '.git/logs/HEAD' path. If it's a file, read it
and check for the tell-tale sign of a Git submodule: the text "gitdir:".
If it exists, follow that path and use the 'logs/HEAD' at that location
instead. This allows not only the correct revision information to be
retrieved, but also uses a file that will change with each source
control revision.

Test Plan:
1. Before applying this change, build Clang as a Git submodule in a repository
   that places it in external/clang, and confirm no revision information
   is output when `clang --version` is invoked (just "clang 5.0.0" is
   output, no Git hashes).
2. Apply these changes and build Clang as a Git repository nested under
   llvm/tools/clang, and confirm that `clang --version` displays correct
   version information.
3. Apply these changes and build Clang as a Git submodule using the
   structure described in (1), and confirm version control information
   is output as in (2).

Reviewers: jordan_rose, beanz, probinson

Reviewed By: jordan_rose

Subscribers: chapuni, mgorny, cfe-commits

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

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

8 years ago[SystemZ] Add support for IBM z14 processor (3/3)
Ulrich Weigand [Mon, 17 Jul 2017 17:47:35 +0000 (17:47 +0000)]
[SystemZ] Add support for IBM z14 processor (3/3)

This patch updates the vecintrin.h header file to provide the new
set of high-level vector built-in functions.  This matches the
updated definition implemented by other compilers for the platform,
indicated by the pre-defined macro __VEC__ == 10302.

Note that some of the new functions (notably those involving the
vector float data type) are only available with -march=z14
(indicated by __ARCH__ == 12).

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