]> granicus.if.org Git - clang/log
clang
7 years ago[ubsan] Disable bounds-check for flexible array ivars
Vedant Kumar [Tue, 4 Oct 2016 20:36:04 +0000 (20:36 +0000)]
[ubsan] Disable bounds-check for flexible array ivars

This eliminates a class of false positives for -fsanitize=array-bounds
on instrumented ObjC projects.

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

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

7 years agoclang-format: Fix bad multi-variable for-loop formatting.
Daniel Jasper [Tue, 4 Oct 2016 20:18:25 +0000 (20:18 +0000)]
clang-format: Fix bad multi-variable for-loop formatting.

Before:
  for (int*p, *q; p != q; p = p->next) {

After:
  for (int *p, *q; p != q; p = p->next) {

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

7 years ago[sancov] documentation update after r283241
Mike Aizatsky [Tue, 4 Oct 2016 19:19:16 +0000 (19:19 +0000)]
[sancov] documentation update after r283241

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

7 years agoTest what happens when tag lookup and redeclaration lookup disagree
Reid Kleckner [Tue, 4 Oct 2016 18:10:23 +0000 (18:10 +0000)]
Test what happens when tag lookup and redeclaration lookup disagree

Clang has a diagnostic for the what happens when an elaborated type
implicitly creates a tag declaration and the initial tag lookup fails,
but the redeclaration lookup succeeds and finds a non-tag type. However,
it wasn't tested, and looked like dead code. After much staring, we
discovered how to exercise it, and are now committing the test for
posterity.

In this example, the tag lookup will not find A, but then when we go to
insert a declaration of A at global scope, we discover the template
friend, which is not a tag type.

  struct C {
    template <typename> friend struct A;
  };
  struct B {
    struct A *p;
  };

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

7 years ago[Sema] Format a comment line so that it fits 80 columns. NFC
Alex Lorenz [Tue, 4 Oct 2016 16:06:37 +0000 (16:06 +0000)]
[Sema] Format a comment line so that it fits 80 columns. NFC

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

7 years ago[MS] Move hex long long sign compat hack to -fms-compatibility
Reid Kleckner [Tue, 4 Oct 2016 15:57:49 +0000 (15:57 +0000)]
[MS] Move hex long long sign compat hack to -fms-compatibility

Treating large 0x*LL literals as signed instead of unsigned is not a
conforming language extension, so move it out of -fms-extensions.

Came up in PR30605

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

7 years ago[OpenMP] fix segfault when a variable referenced in reduction clause is a reference...
David Sheinkman [Tue, 4 Oct 2016 14:41:36 +0000 (14:41 +0000)]
[OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter\nDifferential Revision: http://reviews.llvm.org/D24524

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

7 years ago[ThinLTO] Spell `llvm-ar` correctly.
Davide Italiano [Tue, 4 Oct 2016 13:16:00 +0000 (13:16 +0000)]
[ThinLTO] Spell `llvm-ar` correctly.

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

7 years agoDo not find friend function definitions inside non-instantiated class.
Serge Pavlov [Tue, 4 Oct 2016 10:11:43 +0000 (10:11 +0000)]
Do not find friend function definitions inside non-instantiated class.

Previously if a file-level function was defined inside befriending
template class, it always was treated as defined. For instance, the code like:
```
  int func(int x);
  template<typename T> class C1 {
    friend int func(int x) { return x; }
  };
  template<typename T> class C2 {
    friend int func(int x) { return x; }
  };
```
could not be compiled due to function redefinition, although not of the templates
is instantiated. Moreover, the body of friend function can contain use of template
parameters, attempt to get definition of such function outside any instantiation
causes compiler abnormal termination.

Other compilers (gcc, icc) follow viewpoint that the body of the function defined
in friend declaration becomes available when corresponding class is instantiated.
This patch implements this viewpoint in clang.

Definitions introduced by friend declarations in template classes are not added
to the redeclaration chain of corresponding function. Only when the template is
instantiated, instantiation of the function definition is placed to the chain.

The fix was made in collaboration with Richard Smith.

This change fixes PR8035, PR17923, PR22307 and PR25848.

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

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

7 years agoMinor cleanups in clang-format.el.
Manuel Klimek [Tue, 4 Oct 2016 09:53:04 +0000 (09:53 +0000)]
Minor cleanups in clang-format.el.

- Enable lexical binding
- Formatting
- Enable file name completion for the clang-format-executable variable
- Add a missing docstring
- When available, use bufferpos-to-filepos and filepos-to-bufferpos. These functions given more precise mapping than byte-to-position and position-bytes.
- Rename arguments of clang-format-region to match the docstring
- Instead of binding local variables to nil and then assigning them, bind them directly to their values
- Make use of the fact that insert-file-contents returns the number of characters it inserted
- Use cl-destructuring-bind to make the code a bit shorter
- Use standard iteration (dolist) instead of mapc with a lambda, which is more common and shorter
- Remove a message that was most likely only present for debugging purposes

Patch by Philipp Stephani.

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

7 years agoRevert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument...
Dean Michael Berris [Tue, 4 Oct 2016 08:54:51 +0000 (08:54 +0000)]
Revert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed"

This reverts 283193 -- broke the build.

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

7 years agoRevert r283106, "Wdocumentation fix"
NAKAMURA Takumi [Tue, 4 Oct 2016 08:32:33 +0000 (08:32 +0000)]
Revert r283106, "Wdocumentation fix"

It should depend on r283094 and r283182.

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

7 years ago[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is...
Dean Michael Berris [Tue, 4 Oct 2016 08:22:47 +0000 (08:22 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed

Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Author: rSerge

Reviewers: dberris, rsmith, aaron.ballman, rnk

Subscribers: cfe-commits, iid_iunknown

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

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

7 years agoRevert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092
Vitaly Buka [Tue, 4 Oct 2016 02:40:35 +0000 (02:40 +0000)]
Revert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092

This reverts commit r283094.

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

7 years agoRevert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted...
Vitaly Buka [Tue, 4 Oct 2016 02:36:58 +0000 (02:36 +0000)]
Revert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted r283092

This reverts commit r283093.

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

7 years agoRevert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.
Vitaly Buka [Tue, 4 Oct 2016 02:19:17 +0000 (02:19 +0000)]
Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.

This reverts commit r283092.

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

7 years agoRevert "[analyzer] A blind attempt to fix a buildbot" as it does not help.
Vitaly Buka [Tue, 4 Oct 2016 02:19:12 +0000 (02:19 +0000)]
Revert "[analyzer] A blind attempt to fix a buildbot" as it does not help.

This reverts commit r283141.

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

7 years ago[coroutines] Switch to using std::experimental namespace per P0057R5
Gor Nishanov [Tue, 4 Oct 2016 00:31:16 +0000 (00:31 +0000)]
[coroutines] Switch to using std::experimental namespace per P0057R5

Summary:
Look for coroutine_traits and friends in std::experimental namespace.
Patch (mostly) by EricWF.

Reviewers: cfe-commits, EricWF, rsmith

Subscribers: majnemer, mehdi_amini

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

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

7 years ago[coroutines] Adding builtins for coroutine intrinsics and backendutil support.
Gor Nishanov [Mon, 3 Oct 2016 22:44:48 +0000 (22:44 +0000)]
[coroutines] Adding builtins for coroutine intrinsics and backendutil support.

Summary:
With this commit simple coroutines can be created in plain C using coroutine builtins.

Reviewers: rnk, EricWF, rsmith

Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits

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

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

7 years agoObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.
Manman Ren [Mon, 3 Oct 2016 21:26:46 +0000 (21:26 +0000)]
ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.

The deserialization of redeclartion can cause seg fault since getCanonicalDecl
of the redeclaration returns the lookup result on the ObjCContainerDecl,
which can be null if FindExternalVisibleDeclsByName is not done updating
the lookup results.

The fix is to return the redeclaration itself as the canonical decl. Note that
the handling for redeclaration of ObjCMethodDecl is not in line with other
redeclarables.

rdar://28488466

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

7 years ago[analyzer] A blind attempt to fix a buildbot after r283092.
Artem Dergachev [Mon, 3 Oct 2016 20:12:12 +0000 (20:12 +0000)]
[analyzer] A blind attempt to fix a buildbot after r283092.

The msvc compiler seems to crash compiling the BugReport class.

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

7 years agoAdded more comments to tooling::Replacements.
Eric Liu [Mon, 3 Oct 2016 19:14:30 +0000 (19:14 +0000)]
Added more comments to tooling::Replacements.

Summary: Also test phabricator commit processing.

Subscribers: klimek, cfe-commits

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

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

7 years agoFactor out a diagnostic kind enum for use in two %select expressions
Reid Kleckner [Mon, 3 Oct 2016 18:34:23 +0000 (18:34 +0000)]
Factor out a diagnostic kind enum for use in two %select expressions

NFC

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

7 years ago[CUDA] Clean up some comments in Sema::IsOverload. NFC
Justin Lebar [Mon, 3 Oct 2016 16:48:27 +0000 (16:48 +0000)]
[CUDA] Clean up some comments in Sema::IsOverload.  NFC

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

7 years ago[CUDA] Disallow overloading destructors.
Justin Lebar [Mon, 3 Oct 2016 16:48:23 +0000 (16:48 +0000)]
[CUDA] Disallow overloading destructors.

Summary:
We'd attempted to allow this, but turns out we were doing a very bad
job.  :)

Making this work properly would be a giant change in clang.  For
example, we'd need to make CXXRecordDecl::getDestructor()
context-sensitive, because the destructor you end up with depends on
where you're calling it from.

For now (and hopefully for ever), just disallow overloading of
destructors in CUDA.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

7 years ago[ARC] Ignore qualifiers in copy-restore expressions
Vedant Kumar [Mon, 3 Oct 2016 15:29:22 +0000 (15:29 +0000)]
[ARC] Ignore qualifiers in copy-restore expressions

When ARC is enabled, an ObjCIndirectCopyRestoreExpr models the passing
of a function argument s.t:

  * The argument is copied into a temporary,
  * The temporary is passed into the function, and
  * After the function call completes, the temporary is move-assigned
    back to the original location of the argument.

The argument type and the parameter type must agree "except possibly in
qualification". This commit weakens an assertion in EmitCallArg() to
actually reflect that.

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

7 years ago[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions
Yaxun Liu [Mon, 3 Oct 2016 14:41:50 +0000 (14:41 +0000)]
[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions

__builtin_astype is used to cast OpenCL opaque types to other types, as such, it needs to be able to handle casting from and to pointer types correctly.

Current it cannot handle 1) casting between pointers of different addr spaces 2) casting between pointer type and non-pointer types.

This patch fixes that.

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

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

7 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:13:50 +0000 (13:13 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.
I forgot to svn add the new file in my previous commit.

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

7 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:12:20 +0000 (13:12 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.

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

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

7 years agoWdocumentation fix
Simon Pilgrim [Mon, 3 Oct 2016 12:37:08 +0000 (12:37 +0000)]
Wdocumentation fix

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

7 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:22:17 +0000 (12:22 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

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

7 years agoRevert r283102 (Typo in the phabricator link)
Alex Lorenz [Mon, 3 Oct 2016 12:17:56 +0000 (12:17 +0000)]
Revert r283102 (Typo in the phabricator link)

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

7 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:12:03 +0000 (12:12 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

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

7 years ago[StaticAnalyser] Add test case to ensure that unreachable code is found.
Daniel Marjamaki [Mon, 3 Oct 2016 09:45:35 +0000 (09:45 +0000)]
[StaticAnalyser] Add test case to ensure that unreachable code is found.

https://reviews.llvm.org/D24905

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

7 years ago[StaticAnalyzer] Fix UnreachableCode false positives.
Daniel Marjamaki [Mon, 3 Oct 2016 08:28:51 +0000 (08:28 +0000)]
[StaticAnalyzer] Fix UnreachableCode false positives.

When there is 'do { } while (0);' in the code the ExplodedGraph and UnoptimizedCFG did not match.

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

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

7 years ago[analyzer] Improve CloneChecker diagnostics
Artem Dergachev [Mon, 3 Oct 2016 08:11:50 +0000 (08:11 +0000)]
[analyzer] Improve CloneChecker diagnostics

Highlight code clones referenced by the warning message with the help of
the extra notes feature recently introduced in r283092.

Change warning text to more clang-ish. Remove suggestions from the copy-paste
error checker diagnostics, because currently our suggestions are strictly 50%
wrong (we do not know which of the two code clones contains the error), and
for that reason we should not sound as if we're actually suggesting this.
Hopefully a better solution would bring them back.

Make sure the suspicious clone pair structure always mentions
the correct variable for the second clone.

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

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

7 years ago[analyzer] Add extra notes to ObjCDeallocChecker
Artem Dergachev [Mon, 3 Oct 2016 08:03:51 +0000 (08:03 +0000)]
[analyzer] Add extra notes to ObjCDeallocChecker

The report is now highlighting instance variables and properties
referenced by the warning message with the help of the
extra notes feature recently introduced in r283092.

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

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

7 years ago[analyzer] Extend bug reports with extra notes
Artem Dergachev [Mon, 3 Oct 2016 07:58:26 +0000 (07:58 +0000)]
[analyzer] Extend bug reports with extra notes

These diagnostics are separate from the path-sensitive engine's path notes,
and can be added manually on top of path-sensitive or path-insensitive reports.

The new note diagnostics would appear as note:-diagnostic on console and
as blue bubbles in scan-build. In plist files they currently do not appear,
because format needs to be discussed with plist file users.

The analyzer option "-analyzer-config notes-as-events=true" would convert
notes to normal path notes, and put them at the beginning of the path.
This is a temporary hack to show the new notes in plist files.

A few checkers would be updated in subsequent commits,
including tests for this new feature.

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

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

7 years agoKeep the test only for Itanium abi
Aditya Kumar [Mon, 3 Oct 2016 02:36:33 +0000 (02:36 +0000)]
Keep the test only for Itanium abi

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

7 years ago[cmake] Install 'clang-cpp' symlink
Michal Gorny [Sun, 2 Oct 2016 19:28:57 +0000 (19:28 +0000)]
[cmake] Install 'clang-cpp' symlink

Install the 'clang-cpp' symlink used to spawn the preprocessor. The code
handling this suffix is already included in Driver. FreeBSD is already
creating such a symlink in ports, and a similar one was requested
by Gentoo/FreeBSD team. The goal is to handle software that takes a C
preprocessor via a variable but does not handle passing options
correctly (i.e. 'clang -E' does not work).

Bug: https://bugs.gentoo.org/478810

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

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

7 years ago[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when...
Craig Topper [Sun, 2 Oct 2016 17:43:00 +0000 (17:43 +0000)]
[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when rounding mode isn't used.

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

7 years ago[CUDA] Allow extern __shared__ on empty-length arrays.
Justin Lebar [Sun, 2 Oct 2016 15:24:50 +0000 (15:24 +0000)]
[CUDA] Allow extern __shared__ on empty-length arrays.

"extern __shared__ int x[]" is OK.

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

7 years ago[coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts
Gor Nishanov [Sun, 2 Oct 2016 03:31:58 +0000 (03:31 +0000)]
[coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts

Summary:
Also makes -fcoroutines_ts to be both a Driver and CC1 flag.

Patch mostly by EricWF.

Reviewers: rnk, cfe-commits, rsmith, EricWF

Subscribers: mehdi_amini

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

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

7 years agoAlias must point to a definition
Aditya Kumar [Sun, 2 Oct 2016 03:06:36 +0000 (03:06 +0000)]
Alias must point to a definition

Reapplying the patch after modifying the test case.

Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend.
https://llvm.org/bugs/show_bug.cgi?id=30341

This patch disables alias to available_externally definitions.

Reviewers: eugenis, rsmith

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

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

7 years ago[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float
Hal Finkel [Sun, 2 Oct 2016 02:10:45 +0000 (02:10 +0000)]
[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float

Enable soft-float support on PPC64, as the backend now supports it. Also, the
backend now uses -hard-float instead of +soft-float, so set the target features
accordingly.

Fixes PR26970.

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

7 years ago[AVX-512] Check rounding mode for builtins that take one. Rounding mode should be...
Craig Topper [Sat, 1 Oct 2016 21:03:50 +0000 (21:03 +0000)]
[AVX-512] Check rounding mode for builtins that take one. Rounding mode should be either _MM_FROUND_CUR_DIRECTION or a 2-bit rounding mode ORed with _MM_FROUND_NO_EXC.

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

7 years ago[AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode intrinsics...
Craig Topper [Sat, 1 Oct 2016 21:03:46 +0000 (21:03 +0000)]
[AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode intrinsics. This is preparation for a follow up commit that will check validity of rounding mode argument.

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

7 years agoUse StringRef for MemoryBuffer identifier API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 16:38:28 +0000 (16:38 +0000)]
Use StringRef for MemoryBuffer identifier API (NFC)

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

7 years agoUse StringRef in Registry API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 15:44:54 +0000 (15:44 +0000)]
Use StringRef in Registry API (NFC)

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

7 years agoUse StringRef in Pass/PassManager APIs (NFC)
Mehdi Amini [Sat, 1 Oct 2016 02:56:57 +0000 (02:56 +0000)]
Use StringRef in Pass/PassManager APIs (NFC)

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

7 years agoUse StringRef in Triple API (NFC)
Mehdi Amini [Sat, 1 Oct 2016 01:16:22 +0000 (01:16 +0000)]
Use StringRef in Triple API (NFC)

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

7 years agoFix crash when emitting error.
Richard Trieu [Sat, 1 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix crash when emitting error.

With templated classes, is possible to not be able to determine is a member
function is a special member function before the class is instantiated.  Only
these special member functions can be defaulted.  In some cases, knowing
whether a function is a special member function can't be determined until
instantiation, so an uninstantiated function could possibly be defaulted too.
Add a case to the error diagnostic when the function marked with a default is
not known to be a special member function.

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

7 years ago[CUDA] Harmonize asserts in SemaCUDA, NFC.
Justin Lebar [Fri, 30 Sep 2016 23:57:38 +0000 (23:57 +0000)]
[CUDA] Harmonize asserts in SemaCUDA, NFC.

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

7 years ago[CUDA] Disallow __constant__ local variables.
Justin Lebar [Fri, 30 Sep 2016 23:57:34 +0000 (23:57 +0000)]
[CUDA] Disallow __constant__ local variables.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Disallow 'extern __shared__' variables.
Justin Lebar [Fri, 30 Sep 2016 23:57:30 +0000 (23:57 +0000)]
[CUDA] Disallow 'extern __shared__' variables.

Also add a test that we disallow

  __constant__ __shared__ int x;

because it's possible to break this without breaking

  __shared__ __constant__ int x;

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years agoFix bogus "inline namespace cannot be reopened as non-inline" diagnostic to
Richard Smith [Fri, 30 Sep 2016 23:16:08 +0000 (23:16 +0000)]
Fix bogus "inline namespace cannot be reopened as non-inline" diagnostic to
just warn that the second declaration is missing the 'inline' keyword. This is
valid, and we shouldn't be suggesting otherwise.

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

7 years agoCodeGen: inherit DLLExport attribute in Windows Itanium
Saleem Abdulrasool [Fri, 30 Sep 2016 23:11:05 +0000 (23:11 +0000)]
CodeGen: inherit DLLExport attribute in Windows Itanium

When emitting the fundamental type information constants, inherit the
DLLExportAttr from `__fundamental_type_info`.  We would previously not
honor the `__declspec(dllexport)` on the type information.

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

7 years agoP0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we
Richard Smith [Fri, 30 Sep 2016 22:41:36 +0000 (22:41 +0000)]
P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we
assume that ::operator new provides no more alignment than is necessary for any
primitive type, except when we're on a GNU OS, where glibc's malloc guarantees
to provide 64-bit alignment on 32-bit systems and 128-bit alignment on 64-bit
systems. This can be controlled by the command-line -fnew-alignment flag.

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

7 years ago[coroutines] Diagnose when 'main' is declared as a coroutine.
Eric Fiselier [Fri, 30 Sep 2016 22:38:31 +0000 (22:38 +0000)]
[coroutines] Diagnose when 'main' is declared as a coroutine.

Summary: The title says it all.

Reviewers: rsmith, GorNishanov

Subscribers: mehdi_amini, cfe-commits

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

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

7 years ago[Sema] Support lax conversions for compound assignments
Bruno Cardoso Lopes [Fri, 30 Sep 2016 22:19:38 +0000 (22:19 +0000)]
[Sema] Support lax conversions for compound assignments

Support lax convertions on compound assignment expressions like:

  typedef __attribute__((vector_size(8))) double float64x1_t;
  typedef __attribute__((vector_size(16))) double float64x2_t;
  float64x1_t vget_low_f64(float64x2_t __p0);

  double c = 3.0;
  float64x2_t v = {0.0, 1.0};
  c += vget_low_f64(v);

This restores one more valid behavior pre r266366, and is a incremental
follow up from work committed in r274646.

While here, make the check more strict, add FIXMEs, clean up variable
names to match what they can actually be and update testcases to reflect
that. We now reject:

  typedef float float2 __attribute__ ((vector_size (8)));
  double d;
  f2 += d;

which doesn't fit as a direct bitcast anyway.

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

rdar://problem/28033929

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

7 years ago[sanitizer-coverage] fix docs
Kostya Serebryany [Fri, 30 Sep 2016 21:57:10 +0000 (21:57 +0000)]
[sanitizer-coverage] fix docs

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

7 years agoAdd missing std::move in Replacements::add
Alexander Shaposhnikov [Fri, 30 Sep 2016 21:05:45 +0000 (21:05 +0000)]
Add missing std::move in Replacements::add

This diff adds std::move to avoid copying of
the Replacement NewR in the method Replacements::add.

Test plan: make -j8 check-all

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

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

7 years ago[sancov] -symbolize documentation update
Mike Aizatsky [Fri, 30 Sep 2016 21:02:56 +0000 (21:02 +0000)]
[sancov] -symbolize documentation update

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

7 years ago[CUDA] Fix implicit-device-lambda.cu after r282911.
Justin Lebar [Fri, 30 Sep 2016 20:17:37 +0000 (20:17 +0000)]
[CUDA] Fix implicit-device-lambda.cu after r282911.

This commit added a warning that we're (correctly) hitting in this test.
Just ignore it.

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

7 years ago[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.
Justin Lebar [Fri, 30 Sep 2016 19:55:59 +0000 (19:55 +0000)]
[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.

I'd said that nvcc doesn't allow you to add __host__ or __device__
attributes on lambdas in all circumstances, but I believe this was user
error on my part.  I can't reproduce these warnings/errors if I pass
--expt-extended-lambda to nvcc.

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

7 years ago[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(....
Justin Lebar [Fri, 30 Sep 2016 19:55:55 +0000 (19:55 +0000)]
[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

Summary:
This is probably the sane place for the attribute to go, but nvcc
specifically rejects it.  Other GNU-style attributes are allowed in this
position (although judging from the warning it emits for
host/device/global, those attributes are applied to the lambda's
anonymous struct, not to the function itself).

It would be nice to have a FixIt message here, but doing so, or even
just getting the correct range for the attribute, including its '((' and
'))'s, is apparently Hard.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA...
Justin Lebar [Fri, 30 Sep 2016 19:55:48 +0000 (19:55 +0000)]
[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

Summary: There's an overload that we can use to make this a bit cleaner.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[MS] Implement __iso_volatile loads/stores as builtins
Martin Storsjo [Fri, 30 Sep 2016 19:13:46 +0000 (19:13 +0000)]
[MS] Implement __iso_volatile loads/stores as builtins

These are supposed to produce the same as normal volatile
pointer loads/stores. When -volatile:ms is specified,
normal volatile pointers are forced to have atomic semantics
(as is the default on x86 in MSVC mode). In that case,
these builtins should still produce non-atomic volatile
loads/stores without acquire/release semantics, which
the new test verifies.

These are only available on ARM (and on AArch64,
although clang doesn't support AArch64/Windows yet).

This implements what is missing for PR30394, making it possible
to compile C++ for ARM in MSVC mode with MSVC headers.

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

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

7 years ago[CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in...
Justin Lebar [Fri, 30 Sep 2016 17:14:53 +0000 (17:14 +0000)]
[CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

Summary: NVCC compat.  Fixes bug 30567.

Reviewers: tra

Subscribers: cfe-commits, rnk

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

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

7 years ago[CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).
Justin Lebar [Fri, 30 Sep 2016 17:14:48 +0000 (17:14 +0000)]
[CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

Summary: This is ugh, but it makes us compatible with NVCC.  Fixes bug 26341.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[CUDA] Add missing comment on Sema::CheckCUDAVLA.
Justin Lebar [Fri, 30 Sep 2016 17:14:44 +0000 (17:14 +0000)]
[CUDA] Add missing comment on Sema::CheckCUDAVLA.

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

7 years ago[CUDA][OpenMP] Add a generic offload action builder
Samuel Antao [Fri, 30 Sep 2016 15:34:19 +0000 (15:34 +0000)]
[CUDA][OpenMP] Add a generic offload action builder

Summary:
This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities:
- Add device dependences to host actions.
- Add host dependence to device actions.
- Register device top-level actions.

The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented.

When the specialized builder is generated, it produces programming-model-specific diagnostics.

A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current  `buildCudaAction` by the three different functionalities.

Reviewers: tra, echristo, ABataev, jlebar, hfinkel

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

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

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

7 years agoStrip trailing whitespace (NFCI)
Simon Pilgrim [Fri, 30 Sep 2016 14:25:09 +0000 (14:25 +0000)]
Strip trailing whitespace (NFCI)

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

7 years agoFix int <= bool comparison warning on MSVC
Simon Pilgrim [Fri, 30 Sep 2016 14:18:06 +0000 (14:18 +0000)]
Fix int <= bool comparison warning on MSVC

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

7 years agoCosmetic fix: deleted unnecessary line break in comment.
Victor Leschuk [Fri, 30 Sep 2016 06:39:48 +0000 (06:39 +0000)]
Cosmetic fix: deleted unnecessary line break in comment.

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

7 years agoMove UTF functions into namespace llvm.
Justin Lebar [Fri, 30 Sep 2016 00:38:45 +0000 (00:38 +0000)]
Move UTF functions into namespace llvm.

Summary:
This lets people link against LLVM and their own version of the UTF
library.

I determined this only affects llvm, clang, lld, and lldb by running

$ git grep -wl 'UTF[0-9]\+\|\bConvertUTF\bisLegalUTF\|getNumBytesFor' | cut -f 1 -d '/' | sort | uniq
  clang
  lld
  lldb
  llvm

Tested with

  ninja lldb
  ninja check-clang check-llvm check-lld

(ninja check-lldb doesn't complete for me with or without this patch.)

Reviewers: rnk

Subscribers: klimek, beanz, mgorny, llvm-commits

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

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

7 years agoP0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.
Richard Smith [Thu, 29 Sep 2016 22:49:46 +0000 (22:49 +0000)]
P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.

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

7 years ago[Coroutines] Fix assertion about uncorrected typos in co_await/co_yield/co_return...
Eric Fiselier [Thu, 29 Sep 2016 21:47:39 +0000 (21:47 +0000)]
[Coroutines] Fix assertion about uncorrected typos in co_await/co_yield/co_return expressions

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

7 years agoSwitch to a different workaround for unimplementability of P0145R3 in MS ABIs.
Richard Smith [Thu, 29 Sep 2016 21:30:12 +0000 (21:30 +0000)]
Switch to a different workaround for unimplementability of P0145R3 in MS ABIs.
Instead of ignoring the evaluation order rule, ignore the "destroy parameters
in reverse construction order" rule for the small number of problematic cases.
This only causes incorrect behavior in the rare case where both parameters to
an overloaded operator <<, >>, ->*, &&, ||, or comma are of class type with
non-trivial destructor, and the program is depending on those parameters being
destroyed in reverse construction order.

We could do a little better here by reversing the order of parameter
destruction for those functions (and reversing the argument evaluation order
for all direct calls, not just those with operator syntax), but that is not a
complete solution to the problem, as the same situation can be reached by an
indirect function call.

Approach reviewed off-line by rnk.

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

7 years ago[Myriad] Silently ignore -fno-split-dwarf-inlining
Douglas Katzman [Thu, 29 Sep 2016 19:59:12 +0000 (19:59 +0000)]
[Myriad] Silently ignore -fno-split-dwarf-inlining

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

7 years ago[sanitizer-coverage] a bit more docs
Kostya Serebryany [Thu, 29 Sep 2016 19:06:09 +0000 (19:06 +0000)]
[sanitizer-coverage] a bit more docs

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

7 years ago[sanitizer-coverage] more docs
Kostya Serebryany [Thu, 29 Sep 2016 18:58:17 +0000 (18:58 +0000)]
[sanitizer-coverage] more docs

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

7 years ago[sanitize-coverage] doc typo
Kostya Serebryany [Thu, 29 Sep 2016 18:34:40 +0000 (18:34 +0000)]
[sanitize-coverage] doc typo

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

7 years ago[sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create one array...
Kostya Serebryany [Thu, 29 Sep 2016 17:43:24 +0000 (17:43 +0000)]
[sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create one array of guards per function, instead of one guard per BB. reorganize the code so that trace-pc-guard does not create unneeded globals

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

7 years agoRevert "[PR30341] Alias must point to a definition"
Aditya Kumar [Thu, 29 Sep 2016 11:37:23 +0000 (11:37 +0000)]
Revert "[PR30341] Alias must point to a definition"

This reverts commit r282679.

Ninja check fails, reverting to debug the issue.

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

7 years agoXFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set
Jonas Hahnfeld [Thu, 29 Sep 2016 07:43:08 +0000 (07:43 +0000)]
XFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set

Until someone rewrites the stdlib logic for Darwin so that we don't need
to pass down the -stdlib argument to cc1.
(see https://llvm.org/bugs/show_bug.cgi?id=30548)

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

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

7 years ago[PR30341] Alias must point to a definition
Aditya Kumar [Thu, 29 Sep 2016 03:32:04 +0000 (03:32 +0000)]
[PR30341] Alias must point to a definition

Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend.
https://llvm.org/bugs/show_bug.cgi?id=30341

This patch disables alias to available_externally definitions.

Reviewers: eugenis, rsmith

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

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

7 years agoMark P0127R3 as done, and replace its __has_feature check with the corresponding...
Richard Smith [Thu, 29 Sep 2016 00:08:05 +0000 (00:08 +0000)]
Mark P0127R3 as done, and replace its __has_feature check with the corresponding SD-6 macro.

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

7 years agoP0127R2: Support type deduction for types of non-type template parameters in
Richard Smith [Wed, 28 Sep 2016 23:55:27 +0000 (23:55 +0000)]
P0127R2: Support type deduction for types of non-type template parameters in
C++1z.

Patch by James Touton! Some bugfixes and rebasing by me.

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

7 years ago[CUDA] Disallow variable-length arrays in CUDA device code.
Justin Lebar [Wed, 28 Sep 2016 22:45:58 +0000 (22:45 +0000)]
[CUDA] Disallow variable-length arrays in CUDA device code.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years ago[CUDA] Disallow exceptions in device code.
Justin Lebar [Wed, 28 Sep 2016 22:45:54 +0000 (22:45 +0000)]
[CUDA] Disallow exceptions in device code.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years ago[Coroutines] Add proper mangling for operator co_await for MicrosoftABI
Gor Nishanov [Wed, 28 Sep 2016 22:37:17 +0000 (22:37 +0000)]
[Coroutines] Add proper mangling for operator co_await for MicrosoftABI

Reviewers: rnk, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

7 years agoFix bug where template argument deduction of a non-type template parameter used
Richard Smith [Wed, 28 Sep 2016 22:08:38 +0000 (22:08 +0000)]
Fix bug where template argument deduction of a non-type template parameter used
as a template argument in a template-id, from a null non-type template
argument, failed.

Extracted from a patch by James Touton!

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

7 years agocxx_status: use HTML5 details/summary elements to hide implementation status
Richard Smith [Wed, 28 Sep 2016 21:01:37 +0000 (21:01 +0000)]
cxx_status: use HTML5 details/summary elements to hide implementation status
tables for fully-implemented language modes by default. Also add some missing
elements to TS support table.

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

7 years agoAdd a couple more tentative names for upcoming SD-6 feature checks. These might
Richard Smith [Wed, 28 Sep 2016 20:42:56 +0000 (20:42 +0000)]
Add a couple more tentative names for upcoming SD-6 feature checks. These might
not reflect the final chosen names, but supporting them now seems to have
little downside.

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

7 years agoP0095R3: Implement the latest published revision of SD-6 (C++ feature test macros).
Richard Smith [Wed, 28 Sep 2016 20:26:06 +0000 (20:26 +0000)]
P0095R3: Implement the latest published revision of SD-6 (C++ feature test macros).

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

7 years agoP0096R2: Implement more recent revision of SD-6 (C++ feature test macros).
Richard Smith [Wed, 28 Sep 2016 19:44:50 +0000 (19:44 +0000)]
P0096R2: Implement more recent revision of SD-6 (C++ feature test macros).

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

7 years agoLong-overdue update to cxx_status: C++14 is no longer "upcoming".
Richard Smith [Wed, 28 Sep 2016 19:22:36 +0000 (19:22 +0000)]
Long-overdue update to cxx_status: C++14 is no longer "upcoming".

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

7 years agoRe-commit r282556, reverted in r282564, with a fix to CallArgList::addFrom to
Richard Smith [Wed, 28 Sep 2016 19:09:10 +0000 (19:09 +0000)]
Re-commit r282556, reverted in r282564, with a fix to CallArgList::addFrom to
function correctly when targeting MS ABIs (this appears to have never mattered
prior to this change).

Update test case to always cover both 32-bit and 64-bit Windows ABIs, since
they behave somewhat differently from each other here.

Update test case to also cover operators , && and ||, which it appears are also
affected by P0145R3 (they're not explicitly called out by the design document,
but this is the emergent behavior of the existing wording).

Original commit message:

P0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side of
assignment and compound-assignment operators before the left-hand side. (Even
if it's an overloaded operator.)

This completes the implementation of P0145R3 + P0400R0 for all targets except
Windows, where the evaluation order guarantees for <<, >>, and ->* are
unimplementable as the ABI requires the function arguments are evaluated from
right to left (because parameter destructors are run from left to right in the
callee).

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

7 years ago[CUDA] Added support for CUDA-8
Artem Belevich [Wed, 28 Sep 2016 17:47:40 +0000 (17:47 +0000)]
[CUDA] Added support for CUDA-8

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

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