]> granicus.if.org Git - clang/log
clang
5 years agoMerging r345497:
Tom Stellard [Thu, 29 Nov 2018 04:37:25 +0000 (04:37 +0000)]
Merging r345497:

------------------------------------------------------------------------
r345497 | asavonic | 2018-10-29 04:14:01 -0700 (Mon, 29 Oct 2018) | 29 lines

[OpenCL] Fix serialization of OpenCLExtensionDecls

Summary:
I recently discovered that adding the following code into `opencl-c.h` causes
failure of `test/Headers/opencl-c-header.cl`:
```
#pragma OPENCL EXTENSION cl_my_ext : begin
void cl_my_ext_foobarbaz();
#pragma OPENCL EXTENSIOn cl_my_ext : end
```

Clang crashes at the assertion is `ASTReader::getGlobalSubmoduleID()`:
```
assert(I != M.SubmoduleRemap.end() && "Invalid index into submodule index remap");
```

The root cause of the problem that to deserialize `OPENCL_EXTENSION_DECLS`
section `ASTReader` needs to deserialize a Decl contained in it. In turn,
deserializing a Decl requires information about whether this declaration is
part of a (sub)module, but this information is not read yet because it is
located further in a module file.

Reviewers: Anastasia, yaxunl, JDevlieghere

Reviewed By: Anastasia

Subscribers: sidorovd, cfe-commits, asavonic

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

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

5 years agoMerging r343105:
Tom Stellard [Thu, 29 Nov 2018 02:54:32 +0000 (02:54 +0000)]
Merging r343105:

------------------------------------------------------------------------
r343105 | lebedevri | 2018-09-26 06:08:44 -0700 (Wed, 26 Sep 2018) | 17 lines

[analyzer] scan-build: if --status-bugs is passed, don't forget about the exit status of the actual build

Summary:
This has been bothering me for a while, but only now i have actually looked into this.
I'm using one CI job for static analysis - clang static analyzers as compilers + clang-tidy via cmake.
And i'd like for the build to fail if at least one of those finds issues.
If clang-tidy finds issues, it will fail the build since the warnings-as-errors is set.
If static analyzer finds anything, since --status-bugs is set, it will fail the build.
But if clang-tidy find anything, but static analyzer does not, the build succeeds :/

Reviewers: sylvestre.ledru, alexfh, jroelofs, ygribov, george.karpenkov, krememek

Reviewed By: jroelofs

Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits

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

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

5 years agoMerging r347179:
Tom Stellard [Thu, 29 Nov 2018 00:31:15 +0000 (00:31 +0000)]
Merging r347179:

------------------------------------------------------------------------
r347179 | brad | 2018-11-18 16:21:06 -0800 (Sun, 18 Nov 2018) | 4 lines

[PowerPC] Set the default PLT mode on OpenBSD/powerpc to Secure PLT.

OpenBSD/powerpc only supports Secure PLT.

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

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

5 years agoMerging r347262:
Tom Stellard [Wed, 28 Nov 2018 20:04:13 +0000 (20:04 +0000)]
Merging r347262:

------------------------------------------------------------------------
r347262 | vedantk | 2018-11-19 12:10:22 -0800 (Mon, 19 Nov 2018) | 8 lines

[Coverage] Fix PR39258: support coverage regions that start deeper than they end

popRegions used to assume that the start location of a region can't be
nested deeper than the end location, which is not always true.

Patch by Orivej Desh!

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

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

5 years agoMerging r347261:
Tom Stellard [Wed, 28 Nov 2018 19:50:01 +0000 (19:50 +0000)]
Merging r347261:

------------------------------------------------------------------------
r347261 | vedantk | 2018-11-19 12:10:21 -0800 (Mon, 19 Nov 2018) | 11 lines

[Sema] Fix PR38987: keep end location of a direct initializer list

If PerformConstructorInitialization of a direct initializer list constructor is
called while instantiating a template, it has brace locations in its BraceLoc
arguments but not in the Kind argument.

This reverts the hunk https://reviews.llvm.org/D41921#inline-468844.

Patch by Orivej Desh!

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

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

5 years agoMerging r341697:
Tom Stellard [Tue, 20 Nov 2018 00:36:24 +0000 (00:36 +0000)]
Merging r341697:

------------------------------------------------------------------------
r341697 | arphaman | 2018-09-07 11:59:45 -0700 (Fri, 07 Sep 2018) | 4 lines

warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'

Addresses first post-commit feedback for r335081 from Nico

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

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

6 years agoMerging r341312:
Tom Stellard [Fri, 2 Nov 2018 01:58:07 +0000 (01:58 +0000)]
Merging r341312:

------------------------------------------------------------------------
r341312 | psmith | 2018-09-03 05:36:32 -0700 (Mon, 03 Sep 2018) | 13 lines

[Aarch64] Fix linker emulation for Aarch64 big endian

This patch fixes target linker emulation for aarch64 big endian.
aarch64_be_linux is not recognized by gnu ld. The equivalent emulation
mode supported by gnu ld is aarch64linuxb.

Patch by: Bharathi Seshadri

Reviewed by: Peter Smith

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

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

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

6 years agoMerging r341778:
Tom Stellard [Fri, 26 Oct 2018 17:59:43 +0000 (17:59 +0000)]
Merging r341778:

------------------------------------------------------------------------
r341778 | rsmith | 2018-09-09 23:35:32 -0700 (Sun, 09 Sep 2018) | 5 lines

PR33222: Require the declared return type not the actual return type to
match when checking for redeclaration of a function template.

This properly handles differences in deduced return types, particularly
when performing redeclaration checks for a friend function template.
------------------------------------------------------------------------

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

6 years agoMerging r341775:
Tom Stellard [Fri, 26 Oct 2018 17:32:52 +0000 (17:32 +0000)]
Merging r341775:

------------------------------------------------------------------------
r341775 | rsmith | 2018-09-09 22:32:13 -0700 (Sun, 09 Sep 2018) | 2 lines

Part of PR33222: defer enforcing return type mismatch for dependent
friend function declarations of class templates.
------------------------------------------------------------------------

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

6 years agoMerging r340025:
Tom Stellard [Thu, 25 Oct 2018 20:41:01 +0000 (20:41 +0000)]
Merging r340025:

------------------------------------------------------------------------
r340025 | erichkeane | 2018-08-17 06:43:39 -0700 (Fri, 17 Aug 2018) | 8 lines

Fix for bug 38508 - Don't do PCH processing when only generating preprocessor output

This clang-cl driver change removes the PCH options when we are only generating
preprocessed output. This is similar to the behavior of Y-.

Patch by: mikerice
Differential Revision: https://reviews.llvm.org/D50640

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

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

6 years agoMerging r339424:
Tom Stellard [Thu, 25 Oct 2018 19:37:31 +0000 (19:37 +0000)]
Merging r339424:

------------------------------------------------------------------------
r339424 | hans | 2018-08-10 04:40:50 -0700 (Fri, 10 Aug 2018) | 1 line

clang-cl: accept -fcrash-diagnostics-dir=
------------------------------------------------------------------------

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

6 years agoMerging r342897:
Tom Stellard [Tue, 23 Oct 2018 05:18:59 +0000 (05:18 +0000)]
Merging r342897:

------------------------------------------------------------------------
r342897 | mgorny | 2018-09-24 09:10:25 -0700 (Mon, 24 Sep 2018) | 5 lines

[python] [tests] Update test_code_completion

Update expected completions to match output generated by clang-7.0.

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

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

6 years agoMerging r344824:
Tom Stellard [Mon, 22 Oct 2018 17:31:01 +0000 (17:31 +0000)]
Merging r344824:

------------------------------------------------------------------------
r344824 | ctopper | 2018-10-19 18:30:00 -0700 (Fri, 19 Oct 2018) | 14 lines

[X86] When checking the bits in cpu_features for function multiversioning dispatcher in the resolver, make sure all the required bits are set. Not just one of them

Summary:
The multiversioning code repurposed the code from __builtin_cpu_supports for checking if a single feature is enabled. That code essentially performed (_cpu_features & (1 << C)) != 0. But with the multiversioning path, the mask is no longer guaranteed to be a power of 2. So we return true anytime any one of the bits in the mask is set not just all of the bits.

The correct check is (_cpu_features & mask) == mask

Reviewers: erichkeane, echristo

Reviewed By: echristo

Subscribers: cfe-commits

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

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

6 years agoReleaseNotes: tiny fix
Hans Wennborg [Mon, 10 Sep 2018 12:14:41 +0000 (12:14 +0000)]
ReleaseNotes: tiny fix

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

6 years agoRegenerate DiagnosticsReference.rst
Hans Wennborg [Fri, 7 Sep 2018 14:38:20 +0000 (14:38 +0000)]
Regenerate DiagnosticsReference.rst

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

6 years agoReleaseNotes: tidy up for the release
Hans Wennborg [Fri, 7 Sep 2018 14:18:34 +0000 (14:18 +0000)]
ReleaseNotes: tidy up for the release

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

6 years agoReleaseNotes: libc++ _LIBCPP_HIDE_FROM_ABI_PER_TU
Hans Wennborg [Thu, 6 Sep 2018 08:09:39 +0000 (08:09 +0000)]
ReleaseNotes: libc++ _LIBCPP_HIDE_FROM_ABI_PER_TU

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

6 years agoReleaseNotes: tiny tweak
Hans Wennborg [Tue, 4 Sep 2018 11:43:30 +0000 (11:43 +0000)]
ReleaseNotes: tiny tweak

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

6 years agoAdd release notes for the new GNUstep Objective-C ABI.
David Chisnall [Tue, 4 Sep 2018 10:40:24 +0000 (10:40 +0000)]
Add release notes for the new GNUstep Objective-C ABI.

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

6 years agoDisable the GNUstep v2 ABI on Windows.
David Chisnall [Tue, 4 Sep 2018 10:40:19 +0000 (10:40 +0000)]
Disable the GNUstep v2 ABI on Windows.

The code remains so that we can potentially reenable it in a point
release, but the driver will reject it.  Several issues were raised
during testing that made it clear that this was not quite ready for
general consumption.

Approved by: Hans Wennborg

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

6 years ago[docs][mips] Clang 7.0 Release notes
Simon Atanasyan [Fri, 31 Aug 2018 11:25:04 +0000 (11:25 +0000)]
[docs][mips] Clang 7.0 Release notes

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

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

6 years ago[Docs] Release notes for OpenCL
Anastasia Stulova [Wed, 29 Aug 2018 10:30:35 +0000 (10:30 +0000)]
[Docs] Release notes for OpenCL

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

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

6 years agoMerging r340376:
Hans Wennborg [Mon, 27 Aug 2018 09:51:13 +0000 (09:51 +0000)]
Merging r340376:
------------------------------------------------------------------------
r340376 | steveire | 2018-08-22 03:11:18 +0200 (Wed, 22 Aug 2018) | 7 lines

Update the docs for using LLVM toolset in Visual Studio

Reviewers: hans

Subscribers: cfe-commits

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

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

6 years agoMerging r340666:
Hans Wennborg [Fri, 24 Aug 2018 22:49:44 +0000 (22:49 +0000)]
Merging r340666:
------------------------------------------------------------------------
r340666 | hans | 2018-08-25 00:46:33 +0200 (Sat, 25 Aug 2018) | 21 lines

Revert r323281 "Adjust MaxAtomicInlineWidth for i386/i486 targets."

As reported on http://lists.llvm.org/pipermail/cfe-dev/2018-August/058760.html,
this broke i386-freebsd11 due to its lack of atomic 64 bit primitives.

While that's not really this commit's fault, let's revert back to the old
behaviour until this can be fixed. This means generating cmpxchg8b etc for i386
and i486 which don't technically support those, but that's been the behaviour
for a long time, so a little longer probably doesn't hurt that much.

> Adjust MaxAtomicInlineWidth for i386/i486 targets.
>
> This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6.
> Currently, all  MaxAtomicInlineWidth of x86-32 targets are set to 64. However,
> i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg.
> So in this patch MaxAtomicInlineWidth is reset as follows:
> For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is supported.
> For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg.
> For others 32 bits x86 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b.
>
> Differential Revision: https://reviews.llvm.org/D42154
------------------------------------------------------------------------

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

6 years agoMerging r339667:
Hans Wennborg [Wed, 22 Aug 2018 18:44:16 +0000 (18:44 +0000)]
Merging r339667:
------------------------------------------------------------------------
r339667 | theraven | 2018-08-14 12:04:36 +0200 (Tue, 14 Aug 2018) | 11 lines

Add a stub mangling for ObjC selectors in the Microsoft ABI.

This mangling is used only for outlined SEH finally blocks, which have
internal linkage.

This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
expensive checks enabled, on Windows.  This test should probably be
specifying a triple: it currently picks up whatever the host environment
is using.  Unfortunately, I have no idea what it is trying to test,
because it contains no comments and predates Clang having working
Objective-C IR generation.
------------------------------------------------------------------------

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

6 years agoNotify pending API removal in the release notes
Hans Wennborg [Wed, 22 Aug 2018 00:53:19 +0000 (00:53 +0000)]
Notify pending API removal in the release notes

Patch by Stephen Kelly.

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

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

6 years agoMerging r340181:
Hans Wennborg [Tue, 21 Aug 2018 22:41:40 +0000 (22:41 +0000)]
Merging r340181:
------------------------------------------------------------------------
r340181 | abataev | 2018-08-20 18:00:22 +0200 (Mon, 20 Aug 2018) | 7 lines

[OPENMP][BLOCKS]Fix PR38923: reference to a global variable is captured
by a block.

Added checks for capturing of the variable in the block when trying to
emit correct address for the variable with the reference type. This
extra check allows correctly identify the variables that are not
captured in the block context.
------------------------------------------------------------------------

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

6 years agoMerging r340191:
Hans Wennborg [Tue, 21 Aug 2018 22:39:17 +0000 (22:39 +0000)]
Merging r340191:
------------------------------------------------------------------------
r340191 | abataev | 2018-08-20 20:03:40 +0200 (Mon, 20 Aug 2018) | 6 lines

[OPENMP] Fix crash on the emission of the weak function declaration.

If the function is actually a weak reference, it should not be marked as
deferred definition as this is only a declaration. Patch adds checks for
the definitions if they must be emitted. Otherwise, only declaration is
emitted.
------------------------------------------------------------------------

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

6 years agoMerging r339372, r339373, r339374, and r339379
Hans Wennborg [Tue, 21 Aug 2018 20:22:01 +0000 (20:22 +0000)]
Merging r339372, r339373, r339374, and r339379
------------------------------------------------------------------------
r339372 | steveire | 2018-08-09 22:05:03 +0200 (Thu, 09 Aug 2018) | 5 lines

Add getBeginLoc API to replace getLocStart

Subscribers: cfe-commits

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

------------------------------------------------------------------------
r339373 | steveire | 2018-08-09 22:05:18 +0200 (Thu, 09 Aug 2018) | 7 lines

Add getBeginLoc API to replace getStartLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

------------------------------------------------------------------------
r339374 | steveire | 2018-08-09 22:05:47 +0200 (Thu, 09 Aug 2018) | 5 lines

Add getEndLoc API to replace getLocEnd

Subscribers: cfe-commits

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

------------------------------------------------------------------------
r339379 | steveire | 2018-08-09 22:21:09 +0200 (Thu, 09 Aug 2018) | 1 line

Fix build
------------------------------------------------------------------------

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

6 years agoMerging r340048:
Hans Wennborg [Tue, 21 Aug 2018 15:56:49 +0000 (15:56 +0000)]
Merging r340048:
------------------------------------------------------------------------
r340048 | nico | 2018-08-17 19:19:06 +0200 (Fri, 17 Aug 2018) | 10 lines

Make __shiftleft128 / __shiftright128 real compiler built-ins.

r337619 added __shiftleft128 / __shiftright128 as functions in intrin.h.
Microsoft's STL plans on using these functions, and they're using intrin0.h
which just has declarations of built-ins to not pull in the huge intrin.h
header in the standard library headers. That requires that these functions are
real built-ins.

https://reviews.llvm.org/D50907

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

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

6 years agoMerging r340101:
Reid Kleckner [Fri, 17 Aug 2018 22:18:56 +0000 (22:18 +0000)]
Merging r340101:
------------------------------------------------------------------------
r340101 | rnk | 2018-08-17 15:11:31 -0700 (Fri, 17 Aug 2018) | 14 lines

Don't warn on returning the address of a label from a statement expression

Summary:
There isn't anything inherently wrong with returning a label from a
statement expression. In practice, the Linux kernel uses this pattern to
materialize PCs.

Fixes PR38569

Reviewers: niravd, rsmith, nickdesaulniers

Subscribers: cfe-commits

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

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

6 years agoMerging r340079:
Reid Kleckner [Fri, 17 Aug 2018 21:25:51 +0000 (21:25 +0000)]
Merging r340079:
------------------------------------------------------------------------
r340079 | rnk | 2018-08-17 13:59:27 -0700 (Fri, 17 Aug 2018) | 20 lines

[MS] Mangle a hash of the main file path into anonymous namespaces

Summary:
This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.

Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.

Fixes PR38609.

Reviewers: majnemer, inglorion, hans

Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits

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

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

6 years agoBackport r339704 to 7.0 for PR38598
Hans Wennborg [Fri, 17 Aug 2018 07:34:53 +0000 (07:34 +0000)]
Backport r339704 to 7.0 for PR38598

> Author: abataev
> Date: Tue Aug 14 11:31:20 2018
> New Revision: 339704
>
> URL: http://llvm.org/viewvc/llvm-project?rev=339704&view=rev
> Log:
> [OPENMP] Fix processing of declare target construct.
>
> The attribute marked as inheritable since OpenMP 5.0 supports it +
> additional fixes to support new functionality.

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

6 years agoMerging r339603:
Hans Wennborg [Thu, 16 Aug 2018 09:35:01 +0000 (09:35 +0000)]
Merging r339603:
------------------------------------------------------------------------
r339603 | abataev | 2018-08-13 21:04:24 +0200 (Mon, 13 Aug 2018) | 4 lines

[OPENMP] Fix emission of the loop doacross constructs.

The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.
------------------------------------------------------------------------

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

6 years agoMerging r339597:
Hans Wennborg [Tue, 14 Aug 2018 09:20:55 +0000 (09:20 +0000)]
Merging r339597:
------------------------------------------------------------------------
r339597 | erichkeane | 2018-08-13 20:33:20 +0200 (Mon, 13 Aug 2018) | 7 lines

Enforce instantiation of template multiversion functions

Multiversioned member functions inside of a template type were
not properly being emitted.  The solution to this is to simply
ensure that their bodies are correctly evaluated/assigned during
template instantiation.

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

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

6 years agoMerging r338934:
Hans Wennborg [Tue, 14 Aug 2018 09:10:53 +0000 (09:10 +0000)]
Merging r338934:
------------------------------------------------------------------------
r338934 | vsapsai | 2018-08-04 01:12:37 +0200 (Sat, 04 Aug 2018) | 29 lines

[Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

Libc++ needs to know when aligned allocation is supported by clang, but is
otherwise unavailable at link time. Otherwise, libc++ will incorrectly end up
generating calls to `__builtin_operator_new`/`__builtin_operator_delete` with
alignment arguments.

This patch implements the following changes:

* The `__cpp_aligned_new` feature test macro to no longer be defined when
  aligned allocation is otherwise enabled but unavailable.

* The Darwin driver no longer passes `-faligned-alloc-unavailable` when the
  user manually specifies `-faligned-allocation` or `-fno-aligned-allocation`.

* Instead of a warning Clang now generates a hard error when an aligned
  allocation or deallocation function is referenced but unavailable.

Patch by Eric Fiselier.

Reviewers: rsmith, vsapsai, erik.pilkington, ahatanak, dexonsmith

Reviewed By: rsmith

Subscribers: Quuxplusone, cfe-commits

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

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

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

6 years ago[ReleaseNotes] Mention one Windows specific change for 7.0
Martin Storsjo [Tue, 14 Aug 2018 07:52:21 +0000 (07:52 +0000)]
[ReleaseNotes] Mention one Windows specific change for 7.0

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

6 years agoMerging r339264:
Hans Wennborg [Mon, 13 Aug 2018 11:53:27 +0000 (11:53 +0000)]
Merging r339264:
------------------------------------------------------------------------
r339264 | rksimon | 2018-08-08 17:53:14 +0200 (Wed, 08 Aug 2018) | 5 lines

[CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning (PR38210)

As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector

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

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

6 years agoMerging r339074:
Hans Wennborg [Mon, 13 Aug 2018 11:51:39 +0000 (11:51 +0000)]
Merging r339074:
------------------------------------------------------------------------
r339074 | stella.stamenova | 2018-08-07 00:37:45 +0200 (Tue, 07 Aug 2018) | 12 lines

[lit, python] Always add quotes around the python path in lit

Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This is a companion change to: https://reviews.llvm.org/D50206

Reviewers: asmith, zturner

Subscribers: cfe-commits

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

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

6 years agoMerging r339428 and r339494:
Hans Wennborg [Mon, 13 Aug 2018 07:59:11 +0000 (07:59 +0000)]
Merging r339428 and r339494:
------------------------------------------------------------------------
r339428 | theraven | 2018-08-10 14:53:13 +0200 (Fri, 10 Aug 2018) | 18 lines

Add Windows support for the GNUstep Objective-C ABI V2.

Summary:
Introduces funclet-based unwinding for Objective-C and fixes an issue
where global blocks can't have their isa pointers initialised on
Windows.

After discussion with Dustin, this changes the name mangling of
Objective-C types to prevent a C++ catch statement of type struct X*
from catching an Objective-C object of type X*.

Reviewers: rjmccall, DHowett-MSFT

Reviewed By: rjmccall, DHowett-MSFT

Subscribers: mgrang, mstorsjo, smeenai, cfe-commits

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

------------------------------------------------------------------------
r339494 | dyung | 2018-08-11 04:46:47 +0200 (Sat, 11 Aug 2018) | 2 lines

Make the section boundary checks on Windows not depend on the order as they are emitted in reverse when the compiler is built by Visual C++.

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

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

6 years agoMerging r339281:
Hans Wennborg [Thu, 9 Aug 2018 12:46:44 +0000 (12:46 +0000)]
Merging r339281:
------------------------------------------------------------------------
r339281 | ctopper | 2018-08-08 21:14:23 +0200 (Wed, 08 Aug 2018) | 5 lines

[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified

r330571 added a new FrontendTimesIsEnabled variable and replaced many usages of llvm::TimePassesIsEnabled. Including the place that set llvm::TimePassesIsEnabled for -ftime-report. The effect of this is that -ftime-report now only contains the timers specifically referenced in CodeGenAction.cpp and none of the timers in the backend.

This commit adds back the assignment, but otherwise leaves everything else unchanged.
------------------------------------------------------------------------

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

6 years agoMerging r339317:
Hans Wennborg [Thu, 9 Aug 2018 12:42:36 +0000 (12:42 +0000)]
Merging r339317:
------------------------------------------------------------------------
r339317 | theraven | 2018-08-09 10:02:42 +0200 (Thu, 09 Aug 2018) | 15 lines

Correctly initialise global blocks on Windows.

Summary:
Windows does not allow globals to be initialised to point to globals in
another DLL.  Exported globals may be referenced only from code.  Work
around this by creating an initialiser that runs in early library
initialisation and sets the isa pointer.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

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

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

6 years agoMerging r339210:
Hans Wennborg [Wed, 8 Aug 2018 12:06:21 +0000 (12:06 +0000)]
Merging r339210:
------------------------------------------------------------------------
r339210 | rsmith | 2018-08-08 02:42:42 +0200 (Wed, 08 Aug 2018) | 2 lines

PR38286: Don't crash when attempting to define a constructor for an
incomplete class template.
------------------------------------------------------------------------

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

6 years agoMerging r339128:
Hans Wennborg [Wed, 8 Aug 2018 11:27:49 +0000 (11:27 +0000)]
Merging r339128:
------------------------------------------------------------------------
r339128 | theraven | 2018-08-07 14:02:46 +0200 (Tue, 07 Aug 2018) | 8 lines

[objc-gnustep] Don't emit .guess ivar offset vars.

These were intended to allow non-fragile and fragile ABI code to be
mixed, as long as the fragile classes were higher up the hierarchy than
the non-fragile ones.  Unfortunately:

 - No one actually wants to do this.
 - Recent versions of Linux's run-time linker break it.
------------------------------------------------------------------------

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

6 years agoMerging r339170:
Hans Wennborg [Wed, 8 Aug 2018 06:37:32 +0000 (06:37 +0000)]
Merging r339170:
------------------------------------------------------------------------
r339170 | mstorsjo | 2018-08-07 22:02:40 +0200 (Tue, 07 Aug 2018) | 5 lines

[Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64

This matches how GCC defines this struct.

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

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

6 years agoMerging r338627:
Hans Wennborg [Tue, 7 Aug 2018 06:57:36 +0000 (06:57 +0000)]
Merging r338627:
------------------------------------------------------------------------
r338627 | mgorny | 2018-08-01 22:38:22 +0200 (Wed, 01 Aug 2018) | 7 lines

[test] Fix %hmaptool path for standalone builds

Fix %hmaptool path to refer to clang_tools_dir instead of
llvm_tools_dir, in order to fix standalone builds.  The tool is built
as part of clang, so it won't be found in installed LLVM tools.

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

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

6 years agoMerging r338942:
Hans Wennborg [Mon, 6 Aug 2018 10:32:02 +0000 (10:32 +0000)]
Merging r338942:
------------------------------------------------------------------------
r338942 | rsmith | 2018-08-04 03:02:00 +0200 (Sat, 04 Aug 2018) | 1 line

[www] Update cxx_status and cxx_dr_status now that Clang 7 has branched.
------------------------------------------------------------------------

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

6 years agoRelease notes for write exec detection features
David Carlier [Mon, 6 Aug 2018 08:05:11 +0000 (08:05 +0000)]
Release notes for write exec detection features

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

6 years agoRelease note for DWARF v5 support
Paul Robinson [Fri, 3 Aug 2018 14:05:11 +0000 (14:05 +0000)]
Release note for DWARF v5 support

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

6 years agoMerging r338749:
Hans Wennborg [Fri, 3 Aug 2018 10:20:21 +0000 (10:20 +0000)]
Merging r338749:
------------------------------------------------------------------------
r338749 | mstorsjo | 2018-08-02 20:12:08 +0200 (Thu, 02 Aug 2018) | 6 lines

Work around more GCC miscompiles exposed by r338464.

This is the same fix as in r338478, for another occurrance of the
same pattern from r338464.

See gcc.gnu.org/PR86769 for details of the bug.
------------------------------------------------------------------------

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

6 years agoMerging r338553:
Hans Wennborg [Thu, 2 Aug 2018 08:53:00 +0000 (08:53 +0000)]
Merging r338553:
------------------------------------------------------------------------
r338553 | filcab | 2018-08-01 15:41:42 +0200 (Wed, 01 Aug 2018) | 1 line

Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true
------------------------------------------------------------------------

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

6 years agoMerging r338552:
Hans Wennborg [Thu, 2 Aug 2018 08:51:08 +0000 (08:51 +0000)]
Merging r338552:
------------------------------------------------------------------------
r338552 | filcab | 2018-08-01 15:41:11 +0200 (Wed, 01 Aug 2018) | 1 line

Add REQUIRES: native to a test that assumes it
------------------------------------------------------------------------

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

6 years agoMerging r338602:
Hans Wennborg [Thu, 2 Aug 2018 06:34:39 +0000 (06:34 +0000)]
Merging r338602:
------------------------------------------------------------------------
r338602 | hans | 2018-08-01 19:51:23 +0200 (Wed, 01 Aug 2018) | 11 lines

Revert r338455 "[constexpr] Support for constant evaluation of __builtin_memcpy and __builtin_memmove (in non-type-punning cases)."

It caused asserts during Chromium builds, see reply on the cfe-commits thread.

> This is intended to permit libc++ to make std::copy etc constexpr
> without sacrificing the optimization that uses memcpy on
> trivially-copyable types.
>
> __builtin_strcpy and __builtin_wcscpy are not handled by this change.
> They'd be straightforward to add, but we haven't encountered a need for
> them just yet.
------------------------------------------------------------------------

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

6 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 1 Aug 2018 15:28:01 +0000 (15:28 +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_70@338575 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegenerate ClangCommandLineReference.rst
Hans Wennborg [Wed, 1 Aug 2018 15:27:26 +0000 (15:27 +0000)]
Regenerate ClangCommandLineReference.rst

$ 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_70@338574 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCreating release_70 branch off revision 338536
Hans Wennborg [Wed, 1 Aug 2018 13:30:01 +0000 (13:30 +0000)]
Creating release_70 branch off revision 338536

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

6 years agoMake test/Frontend/clang-abi-compat.cpp pass when the version goes to 8
Hans Wennborg [Wed, 1 Aug 2018 13:19:14 +0000 (13:19 +0000)]
Make test/Frontend/clang-abi-compat.cpp pass when the version goes to 8

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

6 years agoUserManual: Update with the latest clang-cl flags
Hans Wennborg [Wed, 1 Aug 2018 12:58:57 +0000 (12:58 +0000)]
UserManual: Update with the latest clang-cl flags

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

6 years ago[AArch64][ARM] Add Armv8.4-A tests
Sjoerd Meijer [Wed, 1 Aug 2018 12:41:10 +0000 (12:41 +0000)]
[AArch64][ARM] Add Armv8.4-A tests

This adds tests for Armv8.4-A, and also some v8.2 and v8.3 tests that were
missing.

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

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

6 years ago[clang-format] Add some text proto functions to Google style
Krasimir Georgiev [Wed, 1 Aug 2018 12:35:23 +0000 (12:35 +0000)]
[clang-format] Add some text proto functions to Google style

Summary: Adds 2 functions taking a text proto argument.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: acoomans, cfe-commits

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

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

6 years agowrap to 80 cols, no behavior change
Nico Weber [Wed, 1 Aug 2018 11:56:20 +0000 (11:56 +0000)]
wrap to 80 cols, no behavior change

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

6 years ago[clang-format] Add @private to the list of jsdoc annotations
Krasimir Georgiev [Wed, 1 Aug 2018 11:48:04 +0000 (11:48 +0000)]
[clang-format] Add @private to the list of jsdoc annotations

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: acoomans, cfe-commits

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

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

6 years agoAdd missing semicolon.
Simon Pilgrim [Wed, 1 Aug 2018 10:34:13 +0000 (10:34 +0000)]
Add missing semicolon.

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

6 years agoReplace 'FALL-THROUGH' comment with LLVM_FALLTHROUGH to silence warning. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 10:26:04 +0000 (10:26 +0000)]
Replace 'FALL-THROUGH' comment with LLVM_FALLTHROUGH to silence warning. NFCI.

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

6 years ago[Modules] Do not emit relocation error when -fno-validate-pch is set
Yuka Takahashi [Wed, 1 Aug 2018 09:50:02 +0000 (09:50 +0000)]
[Modules] Do not emit relocation error when -fno-validate-pch is set

Summary:
Clang emits error when implicit modules was relocated from the
first build directory. However this was biting our usecase where we copy
the contents of build directory to another directory in order to
distribute.

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

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

6 years agoFix "not all control paths return a value" MSVC warning.
Simon Pilgrim [Wed, 1 Aug 2018 09:45:21 +0000 (09:45 +0000)]
Fix "not all control paths return a value" MSVC warning.

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

6 years ago[AST] CastExpr: BasePathSize is not large enough.
Roman Lebedev [Wed, 1 Aug 2018 06:06:16 +0000 (06:06 +0000)]
[AST] CastExpr: BasePathSize is not large enough.

Summary:
rC337815 / D49508 had to cannibalize one bit of `CastExprBitfields::BasePathSize` in order to squeeze `PartOfExplicitCast` boolean.
That reduced the maximal value of `PartOfExplicitCast` from 9 bits (~512) down to 8 bits (~256).
Apparently, that mattered. Too bad there weren't any tests.
It caused [[ https://bugs.llvm.org/show_bug.cgi?id=38356 | PR38356 ]].

So we need to increase `PartOfExplicitCast` back at least to 9 bits, or a bit more.
For obvious reasons, we can't do that in `CastExprBitfields` - that would blow up the size of every `Expr`.
So we need to either just add a variable into the `CastExpr` (as done here),
or use `llvm::TrailingObjects`. The latter does not seem to be straight-forward.
Perhaps, that needs to be done not for the `CastExpr` itself, but for all of it's `final` children.

Reviewers: rjmccall, rsmith, erichkeane

Reviewed By: rjmccall

Subscribers: bricci, hans, cfe-commits, waddlesplash

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

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

6 years ago[OpenEmbedded] Explicitly specify -rtlib in tests
Petr Hosek [Wed, 1 Aug 2018 03:30:06 +0000 (03:30 +0000)]
[OpenEmbedded] Explicitly specify -rtlib in tests

Tests added in r338294 implicitly assume that libgcc is the runtime library,
but that's not the case when the user configures Clang to use compiler-rt in
which case these tests will break. Explicitly request libgcc when invoking
clang in these tests to avoid that.

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

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

6 years agoWork around GCC miscompile exposed by r338464.
Richard Smith [Wed, 1 Aug 2018 02:27:18 +0000 (02:27 +0000)]
Work around GCC miscompile exposed by r338464.

See gcc.gnu.org/PR86769 for details of the bug.

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

6 years ago[analyzer] CallEvent: Add helper methods for obtaining the callee stack frame.
Artem Dergachev [Wed, 1 Aug 2018 01:58:15 +0000 (01:58 +0000)]
[analyzer] CallEvent: Add helper methods for obtaining the callee stack frame.

Newly added methods allow reasoning about the stack frame of the call (as
opposed to the stack frame on which the call was made, which was always
available) - obtain the stack frame context, obtain parameter regions - even if
the call is not going to be (or was not) inlined, i.e. even if the analysis
has never actually entered the stack frame.

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

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

6 years agoSpeculative fix for buildbot failures after r338464.
Richard Smith [Wed, 1 Aug 2018 01:57:49 +0000 (01:57 +0000)]
Speculative fix for buildbot failures after r338464.

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

6 years agoAMDGPU: Add clamp bit to dot builtins
Konstantin Zhuravlyov [Wed, 1 Aug 2018 01:32:21 +0000 (01:32 +0000)]
AMDGPU: Add clamp bit to dot builtins

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

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

6 years agoAvoid exposing name for range-based for '__range' variables in lifetime warnings.
Richard Smith [Wed, 1 Aug 2018 01:03:33 +0000 (01:03 +0000)]
Avoid exposing name for range-based for '__range' variables in lifetime warnings.

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

6 years ago[P0936R0] add [[clang::lifetimebound]] attribute
Richard Smith [Wed, 1 Aug 2018 00:33:25 +0000 (00:33 +0000)]
[P0936R0] add [[clang::lifetimebound]] attribute

This patch adds support for a new attribute, [[clang::lifetimebound]], that
indicates that the lifetime of a function result is related to one of the
function arguments. When walking an initializer to make sure that the lifetime
of the initial value is at least as long as the lifetime of the initialized
object, we step through parameters (including the implicit object parameter of
a non-static member function) that are marked with this attribute.

There's nowhere to write an attribute on the implicit object parameter, so in
lieu of that, it may be applied to a function type (where it appears
immediately after the cv-qualifiers and ref-qualifier, which is as close to a
declaration of the implicit object parameter as we have). I'm currently
modeling this in the AST as the attribute appertaining to the function type.

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

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

6 years ago[constexpr] Support for constant evaluation of __builtin_memcpy and
Richard Smith [Tue, 31 Jul 2018 23:35:09 +0000 (23:35 +0000)]
[constexpr] Support for constant evaluation of __builtin_memcpy and
__builtin_memmove (in non-type-punning cases).

This is intended to permit libc++ to make std::copy etc constexpr
without sacrificing the optimization that uses memcpy on
trivially-copyable types.

__builtin_strcpy and __builtin_wcscpy are not handled by this change.
They'd be straightforward to add, but we haven't encountered a need for
them just yet.

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

6 years agoRevert r337635 "[Driver] Sanitizer support based on runtime library presence"
Reid Kleckner [Tue, 31 Jul 2018 21:57:35 +0000 (21:57 +0000)]
Revert r337635 "[Driver] Sanitizer support based on runtime library presence"

This change causes issues with distributed build systems, which may only
have compiler binaries without any runtime libraries. See discussion
about this on https://reviews.llvm.org/D15225.

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

6 years ago[analyzer] Fix eliding the same destructor twice due to buggy default arguments.
Artem Dergachev [Tue, 31 Jul 2018 21:17:40 +0000 (21:17 +0000)]
[analyzer] Fix eliding the same destructor twice due to buggy default arguments.

Because of incomplete support for CXXDefaultArgExpr, we cannot yet commit to
asserting that the same destructor won't be elided twice.

Suppress the assertion failure for now. Proper support is still an open problem.

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

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

6 years ago[CFG] [analyzer] NFC: Enumerate construction context layer kinds.
Artem Dergachev [Tue, 31 Jul 2018 21:12:42 +0000 (21:12 +0000)]
[CFG] [analyzer] NFC: Enumerate construction context layer kinds.

This is a refactoring patch; no functional change intended.

The common part of ConstructionContextLayer and ConstructedObjectKey is
factored out into a new structure, ConstructionContextItem.

Various sub-kinds of ConstructionContextItem are enumerated in order to
provide richer information about construction contexts.

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

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

6 years ago[serialization] PR34728: Don't assume that only a suffix of template
Richard Smith [Tue, 31 Jul 2018 21:01:53 +0000 (21:01 +0000)]
[serialization] PR34728: Don't assume that only a suffix of template
parameters can have default arguments.

At least for function templates and class template partial
specializations, it's possible for a template parameter with a default
argument to be followed by a non-pack template parameter with no default
argument, and this case was not properly handled here.

Testcase by Steve O'Brien!

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

6 years ago[CFG] [analyzer] Implement function argument construction contexts.
Artem Dergachev [Tue, 31 Jul 2018 20:45:53 +0000 (20:45 +0000)]
[CFG] [analyzer] Implement function argument construction contexts.

In r330377 and r338425 we have already identified what constitutes function
argument constructors and added stubs in order to prevent confusing them
with other temporary object constructors.

Now we implement a ConstructionContext sub-class to carry all the necessary
information about the construction site, namely call expression and argument
index.

On the analyzer side, the patch interacts with the recently implemented
pre-C++17 copy elision support in an interesting manner. If on the CFG side we
didn't find a construction context for the elidable constructor, we build
the CFG as if the elidable constructor is not elided, and the non-elided
constructor within it is a simple temporary. But the same problem may occur
in the analyzer: if the elidable constructor has a construction context but
the analyzer doesn't implement such context yet, the analyzer should also
try to skip copy elision and still inline the non-elided temporary constructor.
This was implemented by adding a "roll back" mechanism: when elision fails,
roll back the changes and proceed as if it's a simple temporary. The approach
is wonky, but i'm fine with that as long as it's merely a defensive mechanism
that should eventually go away once all construction contexts become supported.

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

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

6 years ago[analyzer] Move InnerPointerChecker out of alpha.
Reka Kovacs [Tue, 31 Jul 2018 20:27:11 +0000 (20:27 +0000)]
[analyzer] Move InnerPointerChecker out of alpha.

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

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

6 years ago[OpenCL] Forbid size dependent types used as kernel arguments
Alexey Sotkin [Tue, 31 Jul 2018 20:26:43 +0000 (20:26 +0000)]
[OpenCL] Forbid size dependent types used as kernel arguments

Summary:
Size_t, intptr_t, uintptr_t and ptrdiff_t cannot be used as kernel
arguments, according to OpenCL Specification s6.9k:
The size in bytes of these types are implementation-defined and in
addition can also be different for the OpenCL device and the host
processor making it difficult to allocate buffer objects to be passed
as arguments to a kernel declared as pointer to these types.

Patch by: Andrew Savonichev

Reviewers: Anastasia, yaxunl

Subscribers: yaxunl, Anastasia, cfe-commits

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

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

6 years ago[OpenCL] Check for invalid kernel arguments in array types
Alexey Sotkin [Tue, 31 Jul 2018 19:47:19 +0000 (19:47 +0000)]
[OpenCL] Check for invalid kernel arguments in array types

Summary:
OpenCL specification forbids use of several types as kernel arguments.
This patch improves existing diagnostic to look through arrays.

Patch by: Andrew Savonichev

Reviewers: Anastasia, yaxunl

Subscribers: yaxunl, Anastasia, cfe-commits

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

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

6 years ago[CFG] [analyzer] Add construction contexts for returning C++ objects in ObjC++.
Artem Dergachev [Tue, 31 Jul 2018 19:46:14 +0000 (19:46 +0000)]
[CFG] [analyzer] Add construction contexts for returning C++ objects in ObjC++.

Like any normal funciton, Objective-C message can return a C++ object
in Objective-C++. Such object would require a construction context.

This patch, therefore, is an extension of r327343 onto Objective-C++.

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

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

6 years ago[CFG] [analyzer] Add stubs for constructor and message argument constructors.
Artem Dergachev [Tue, 31 Jul 2018 19:39:37 +0000 (19:39 +0000)]
[CFG] [analyzer] Add stubs for constructor and message argument constructors.

CFG now correctly identifies construction context for temporaries constructed
for the purpose of passing into a function as an argument.

Such context is still not fully implemented because the information it provides
is not rich enough: it doens't contain information about argument index.
It will be addresssed later.

This patch is an extension of r330377 to C++ construct-expressions and
Objective-C message expressions which aren't call-expressions but require
similar handling. C++ new-expressions with placement arguments still remain to
be handled.

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

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

6 years ago[analyzer] Reuse some code in simplifySVal().
Artem Dergachev [Tue, 31 Jul 2018 19:29:25 +0000 (19:29 +0000)]
[analyzer] Reuse some code in simplifySVal().

No functional change intended.

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

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

6 years ago[analyzer] Don't try to simplify mixed Loc/NonLoc expressions.
Artem Dergachev [Tue, 31 Jul 2018 19:26:34 +0000 (19:26 +0000)]
[analyzer] Don't try to simplify mixed Loc/NonLoc expressions.

This fix is similar to r337769 and addresses a regression caused by r337167.

When an operation between a nonloc::LocAsInteger and a non-pointer symbol
is performed, the LocAsInteger-specific part of information is lost.
When the non-pointer symbol is collapsing into a constant, we cannot easily
re-evaluate the result, because we need to recover the missing
LocAsInteger-specific information (eg., integer type, or the very fact that
this pointer was at some point converted to an integer).

Add one more defensive check to prevent crashes on trying to simplify a
SymSymExpr with different Loc-ness of operands.

Differential Revision:

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

6 years agoFix riscv32-toolchain.c with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Tue, 31 Jul 2018 18:47:48 +0000 (18:47 +0000)]
Fix riscv32-toolchain.c with CLANG_DEFAULT_CXX_STDLIB

This configuration was (again) broken after r338385 because Clang
might be configured to always use libc++.

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

6 years ago[OPENMP] Change linkage of offloading symbols to support dropping
Alexey Bataev [Tue, 31 Jul 2018 18:27:42 +0000 (18:27 +0000)]
[OPENMP] Change linkage of offloading symbols to support dropping
offload targets.

Changed the linkage of omp_offloading.img_start.<triple> and omp_offloading.img_end.<triple> symbols from external to external weak to allow dropping of some targets during linking.

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

6 years ago[COFF, ARM64] Enable SEH for ARM64 Windows
Mandeep Singh Grang [Tue, 31 Jul 2018 17:42:05 +0000 (17:42 +0000)]
[COFF, ARM64] Enable SEH for ARM64 Windows

Reviewers: rnk, mstorsjo, ssijaric, haripul, TomTan

Reviewed By: rnk

Subscribers: kristof.beyls, chrib, cfe-commits

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

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

6 years ago[OPENMP] Prevent problems with linking of the static variables.
Alexey Bataev [Tue, 31 Jul 2018 16:40:15 +0000 (16:40 +0000)]
[OPENMP] Prevent problems with linking of the static variables.

No need to change the linkage, we can avoid the problem using special variable. That points to the original variable and, thus, prevent some of the optimizations that might break the compilation.

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

6 years ago[RISCV] Add driver for riscv32-unknown-elf baremetal target
David Bolvansky [Tue, 31 Jul 2018 14:21:46 +0000 (14:21 +0000)]
[RISCV] Add driver for riscv32-unknown-elf baremetal target

Summary:
This patch adds a driver for the baremetal RISC-V target (i.e. riscv32-unknown-elf). For reference, D39963 added basic target info and added support for riscv32-linux-unknown-elf.

Patch by: asb (Alex Bradbury)

Reviewers: efriedma, phosek, apazos, espindola, mgrang

Reviewed By: mgrang

Subscribers: jrtc27, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, emaste, mgorny, arichardson, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, cfe-commits

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

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

6 years agoclang-format: try to make the doc for ConstructorInitializerAllOnOneLineOrOnePerLine...
Hans Wennborg [Tue, 31 Jul 2018 12:42:02 +0000 (12:42 +0000)]
clang-format: try to make the doc for ConstructorInitializerAllOnOneLineOrOnePerLine more clear

PR38080 complained that the "OnePerLine" case wasn't previously shown.

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

6 years agoFix linux-header-search.cpp with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Tue, 31 Jul 2018 11:36:14 +0000 (11:36 +0000)]
Fix linux-header-search.cpp with CLANG_DEFAULT_CXX_STDLIB

This configuration was broken after r338294 because Clang might
be configured to always use libc++.

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

6 years agoImprove support of PDB as an external layout source
Aleksandr Urakov [Tue, 31 Jul 2018 08:27:06 +0000 (08:27 +0000)]
Improve support of PDB as an external layout source

Summary:
This patch improves support of PDB as an external layout source
in the next cases:

- Multiple non-virtual inheritance from packed base classes. When using
  external layout, there's no need to align `NonVirtualSize` of a base class.
  It may cause an overlapping when the next base classes will be layouted
  (but there is a slightly different case in the test because I can't find
  a way to specify a base offset);
- Support of nameless structs and unions. There is no info about nameless child
  structs and unions in Microsoft cl-emitted PDBs. Instead all its fields
  are just treated as outer structure's (union's) fields. This also causes
  a fields overlapping, and makes it possible for unions to have fields located
  at a non-zero offset.

Reviewers: rsmith, zturner, rnk, mstorsjo, majnemer

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

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

6 years ago[coroutines] Fix handling of dependent co_await in StmtProfiler.
Richard Smith [Tue, 31 Jul 2018 00:47:41 +0000 (00:47 +0000)]
[coroutines] Fix handling of dependent co_await in StmtProfiler.

Fix "Invalid operator call kind" error (llvm_unreachable) in
DecodeOperatorCall when profiling a dependent co_await.

Patch by Victor Zverovich!

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

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

6 years ago[analyzer] Rename test: cxx17-mandatory-elision.cpp -> copy-elision.cpp
Artem Dergachev [Tue, 31 Jul 2018 00:18:35 +0000 (00:18 +0000)]
[analyzer] Rename test: cxx17-mandatory-elision.cpp -> copy-elision.cpp

It reflects its contents more accurately. No functional change intended.

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

6 years ago[Sema] Relax a failing assert in TemplateArgumentLoc
Erik Pilkington [Tue, 31 Jul 2018 00:18:30 +0000 (00:18 +0000)]
[Sema] Relax a failing assert in TemplateArgumentLoc

Any of these template argument kinds can be represented with an expression, so
accept them in this constructor.

Patch by Balaji Iyer!

rdar://41459965

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

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

6 years ago[analyzer] CStringChecker: Remember to highlight the argument expression range.
Artem Dergachev [Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)]
[analyzer] CStringChecker: Remember to highlight the argument expression range.

When emitting a bug report, it is important to highlight which argument of the
call-expression is causing the problem.

Before:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^~~~~~~~~~~~

After:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^      ~

Affects other output modes as well, not just text.

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

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

6 years agoRevert "Add a definition for FieldSize that seems to make sense here."
Eric Christopher [Mon, 30 Jul 2018 23:21:51 +0000 (23:21 +0000)]
Revert "Add a definition for FieldSize that seems to make sense here."

This reverts commit r338327, the problem was previously fixed in r338321.

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