]> granicus.if.org Git - clang/log
clang
6 years agoBackporting 325651:: release_50 origin/release_50
Simon Dardis [Fri, 16 Mar 2018 22:21:00 +0000 (22:21 +0000)]
Backporting 325651::
------------------------------------------------------------------------
r325651 | sdardis | 2018-02-21 00:05:05 +0000 (Wed, 21 Feb 2018) | 34 lines

[mips] Spectre variant two mitigation for MIPSR2

This patch provides mitigation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It provides the option
-mindirect-jump=hazard, which instructs the LLVM backend to replace
indirect branches with their hazard barrier variants.

This option is accepted when targeting MIPS revision two or later.

The migitation strategy suggested by MIPS for these processors is to
use two hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are used with the option -mindirect-jump=hazard
when branching indirectly and for indirect function calls.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

Implementation note: I've opted to provide this as an
-mindirect-jump={hazard,...} style option in case alternative
mitigation methods are required for other implementations of the MIPS
ISA in future, e.g. retpoline style solutions.

Reviewers: atanasyan

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

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

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

6 years agoMerging r323155:
Reid Kleckner [Thu, 1 Feb 2018 21:46:03 +0000 (21:46 +0000)]
Merging r323155:
------------------------------------------------------------------------
r323155 | chandlerc | 2018-01-22 14:05:25 -0800 (Mon, 22 Jan 2018) | 133 lines

Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre..

Summary:
First, we need to explain the core of the vulnerability. Note that this
is a very incomplete description, please see the Project Zero blog post
for details:
https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html

The basis for branch target injection is to direct speculative execution
of the processor to some "gadget" of executable code by poisoning the
prediction of indirect branches with the address of that gadget. The
gadget in turn contains an operation that provides a side channel for
reading data. Most commonly, this will look like a load of secret data
followed by a branch on the loaded value and then a load of some
predictable cache line. The attacker then uses timing of the processors
cache to determine which direction the branch took *in the speculative
execution*, and in turn what one bit of the loaded value was. Due to the
nature of these timing side channels and the branch predictor on Intel
processors, this allows an attacker to leak data only accessible to
a privileged domain (like the kernel) back into an unprivileged domain.

The goal is simple: avoid generating code which contains an indirect
branch that could have its prediction poisoned by an attacker. In many
cases, the compiler can simply use directed conditional branches and
a small search tree. LLVM already has support for lowering switches in
this way and the first step of this patch is to disable jump-table
lowering of switches and introduce a pass to rewrite explicit indirectbr
sequences into a switch over integers.

However, there is no fully general alternative to indirect calls. We
introduce a new construct we call a "retpoline" to implement indirect
calls in a non-speculatable way. It can be thought of loosely as
a trampoline for indirect calls which uses the RET instruction on x86.
Further, we arrange for a specific call->ret sequence which ensures the
processor predicts the return to go to a controlled, known location. The
retpoline then "smashes" the return address pushed onto the stack by the
call with the desired target of the original indirect call. The result
is a predicted return to the next instruction after a call (which can be
used to trap speculative execution within an infinite loop) and an
actual indirect branch to an arbitrary address.

On 64-bit x86 ABIs, this is especially easily done in the compiler by
using a guaranteed scratch register to pass the target into this device.
For 32-bit ABIs there isn't a guaranteed scratch register and so several
different retpoline variants are introduced to use a scratch register if
one is available in the calling convention and to otherwise use direct
stack push/pop sequences to pass the target address.

This "retpoline" mitigation is fully described in the following blog
post: https://support.google.com/faqs/answer/7625886

We also support a target feature that disables emission of the retpoline
thunk by the compiler to allow for custom thunks if users want them.
These are particularly useful in environments like kernels that
routinely do hot-patching on boot and want to hot-patch their thunk to
different code sequences. They can write this custom thunk and use
`-mretpoline-external-thunk` *in addition* to `-mretpoline`. In this
case, on x86-64 thu thunk names must be:
```
  __llvm_external_retpoline_r11
```
or on 32-bit:
```
  __llvm_external_retpoline_eax
  __llvm_external_retpoline_ecx
  __llvm_external_retpoline_edx
  __llvm_external_retpoline_push
```
And the target of the retpoline is passed in the named register, or in
the case of the `push` suffix on the top of the stack via a `pushl`
instruction.

There is one other important source of indirect branches in x86 ELF
binaries: the PLT. These patches also include support for LLD to
generate PLT entries that perform a retpoline-style indirection.

The only other indirect branches remaining that we are aware of are from
precompiled runtimes (such as crt0.o and similar). The ones we have
found are not really attackable, and so we have not focused on them
here, but eventually these runtimes should also be replicated for
retpoline-ed configurations for completeness.

For kernels or other freestanding or fully static executables, the
compiler switch `-mretpoline` is sufficient to fully mitigate this
particular attack. For dynamic executables, you must compile *all*
libraries with `-mretpoline` and additionally link the dynamic
executable and all shared libraries with LLD and pass `-z retpolineplt`
(or use similar functionality from some other linker). We strongly
recommend also using `-z now` as non-lazy binding allows the
retpoline-mitigated PLT to be substantially smaller.

When manually apply similar transformations to `-mretpoline` to the
Linux kernel we observed very small performance hits to applications
running typical workloads, and relatively minor hits (approximately 2%)
even for extremely syscall-heavy applications. This is largely due to
the small number of indirect branches that occur in performance
sensitive paths of the kernel.

When using these patches on statically linked applications, especially
C++ applications, you should expect to see a much more dramatic
performance hit. For microbenchmarks that are switch, indirect-, or
virtual-call heavy we have seen overheads ranging from 10% to 50%.

However, real-world workloads exhibit substantially lower performance
impact. Notably, techniques such as PGO and ThinLTO dramatically reduce
the impact of hot indirect calls (by speculatively promoting them to
direct calls) and allow optimized search trees to be used to lower
switches. If you need to deploy these techniques in C++ applications, we
*strongly* recommend that you ensure all hot call targets are statically
linked (avoiding PLT indirection) and use both PGO and ThinLTO. Well
tuned servers using all of these techniques saw 5% - 10% overhead from
the use of retpoline.

We will add detailed documentation covering these components in
subsequent patches, but wanted to make the core functionality available
as soon as possible. Happy for more code review, but we'd really like to
get these patches landed and backported ASAP for obvious reasons. We're
planning to backport this to both 6.0 and 5.0 release streams and get
a 5.0 release with just this cherry picked ASAP for distros and vendors.

This patch is the work of a number of people over the past month: Eric, Reid,
Rui, and myself. I'm mailing it out as a single commit due to the time
sensitive nature of landing this and the need to backport it. Huge thanks to
everyone who helped out here, and everyone at Intel who helped out in
discussions about how to craft this. Also, credit goes to Paul Turner (at
Google, but not an LLVM contributor) for much of the underlying retpoline
design.

Reviewers: echristo, rnk, ruiu, craig.topper, DavidKreitzer

Subscribers: sanjoy, emaste, mcrosier, mgorny, mehdi_amini, hiraditya, llvm-commits

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

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

6 years agoMerging r314733:
Tom Stellard [Tue, 5 Dec 2017 22:38:44 +0000 (22:38 +0000)]
Merging r314733:

------------------------------------------------------------------------
r314733 | rsmith | 2017-10-02 15:43:36 -0700 (Mon, 02 Oct 2017) | 5 lines

PR33839: Fix -Wunused handling for structured binding declarations.

We warn about a structured binding declaration being unused only if none of its
bindings are used.

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

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

6 years agoMerging r311456:
Tom Stellard [Tue, 28 Nov 2017 16:19:54 +0000 (16:19 +0000)]
Merging r311456:

------------------------------------------------------------------------
r311456 | krasimir | 2017-08-22 07:28:01 -0700 (Tue, 22 Aug 2017) | 13 lines

[clang-format] Fix lines regression in clang-format.py

Summary:
This patch fixes a regression after https://reviews.llvm.org/rL305665,
which updates the structure of the `lines` variable.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

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

6 years agoMerging r316181:
Tom Stellard [Mon, 27 Nov 2017 14:54:45 +0000 (14:54 +0000)]
Merging r316181:

------------------------------------------------------------------------
r316181 | jvesely | 2017-10-19 13:40:13 -0700 (Thu, 19 Oct 2017) | 4 lines

AMDGPU: Parse r600 CPU name early and expose FMAF capability

Improve amdgcn macro test
Differential Revision: https://reviews.llvm.org/D38667
------------------------------------------------------------------------

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

6 years agoMerging r313182:
Tom Stellard [Wed, 22 Nov 2017 18:30:28 +0000 (18:30 +0000)]
Merging r313182:

------------------------------------------------------------------------
r313182 | sylvestre | 2017-09-13 13:03:29 -0700 (Wed, 13 Sep 2017) | 13 lines

SplitEmptyFunction should be true in the Mozilla coding style

Summary:
As defined here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Classes
See for the downstream bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1399359

Reviewers: Typz, djasper

Reviewed By: Typz

Subscribers: klimek, cfe-commits

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

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

6 years agoMerging r312748:
Tom Stellard [Wed, 15 Nov 2017 22:41:48 +0000 (22:41 +0000)]
Merging r312748:

------------------------------------------------------------------------
r312748 | jroelofs | 2017-09-07 15:01:25 -0700 (Thu, 07 Sep 2017) | 10 lines

Fix validation of the -mthread-model flag in the Clang driver

The ToolChain class validates the -mthread-model flag in the constructor which
doesn't work correctly since the thread model methods are virtual methods. The
check is moved into Clang::ConstructJob() when constructing the internal
command line.

https://reviews.llvm.org/D37496

Patch by: Ian Tessier!
------------------------------------------------------------------------

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

6 years agoMerging r315578:
Tom Stellard [Wed, 15 Nov 2017 17:51:08 +0000 (17:51 +0000)]
Merging r315578:

------------------------------------------------------------------------
r315578 | abataev | 2017-10-12 06:51:32 -0700 (Thu, 12 Oct 2017) | 7 lines

[OPENMP] Fix PR34925: Fix getting thread_id lvalue for inlined regions
in C.

If we try to get the lvalue for thread_id variables in inlined regions,
we did not use the correct version of function. Fixed this bug by adding
overrided version of the function getThreadIDVariableLValue for inlined
regions.
------------------------------------------------------------------------

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

6 years agoMerging r315464:
Tom Stellard [Wed, 15 Nov 2017 00:07:19 +0000 (00:07 +0000)]
Merging r315464:

------------------------------------------------------------------------
r315464 | abataev | 2017-10-11 08:29:40 -0700 (Wed, 11 Oct 2017) | 5 lines

[OPENMP] Fix PR34916: Crash on mixing taskloop|tasks directives.

If both taskloop and task directives are used at the same time in one
program, we may ran into the situation when the particular type for task
directive is reused for taskloop directives. Patch fixes this problem.
------------------------------------------------------------------------

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

6 years agoMerging r310905 and r310994:
Tom Stellard [Tue, 14 Nov 2017 23:53:22 +0000 (23:53 +0000)]
Merging r310905 and r310994:

------------------------------------------------------------------------
r310905 | rnk | 2017-08-14 18:17:47 -0700 (Mon, 14 Aug 2017) | 11 lines

Avoid PointerIntPair of constexpr EvalInfo structs

They are stack allocated, so their alignment is not to be trusted.
32-bit MSVC only guarantees 4 byte stack alignment, even though alignof
would tell you otherwise. I tried fixing this with __declspec align, but
that apparently upsets GCC. Hopefully this version will satisfy all
compilers.

See PR32018 for some info about the mingw issues.

Should supercede https://reviews.llvm.org/D34873
------------------------------------------------------------------------

------------------------------------------------------------------------
r310994 | chandlerc | 2017-08-16 00:22:49 -0700 (Wed, 16 Aug 2017) | 6 lines

Fix a UBSan failure where this boolean was copied when uninitialized.

When r310905 moved the pointer and bool out of a PointerIntPair, it made
them end up uninitialized and caused UBSan failures when copying the
uninitialized boolean. However, making the pointer be null should avoid
the reference to the boolean entirely.
------------------------------------------------------------------------

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

6 years agoMerging r313278:
Tom Stellard [Tue, 14 Nov 2017 02:38:20 +0000 (02:38 +0000)]
Merging r313278:

------------------------------------------------------------------------
r313278 | prazek | 2017-09-14 10:33:08 -0700 (Thu, 14 Sep 2017) | 11 lines

Enable __declspec(selectany) on any platform

Summary:
This feature was disabled probably by mistake in rL300562
This fixes bug https://bugs.llvm.org/show_bug.cgi?id=33285

Reviewers: davide, rnk

Subscribers: cfe-commits

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

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

6 years agoMerging r315611:
Tom Stellard [Tue, 14 Nov 2017 00:18:14 +0000 (00:18 +0000)]
Merging r315611:

------------------------------------------------------------------------
r315611 | abataev | 2017-10-12 13:03:39 -0700 (Thu, 12 Oct 2017) | 5 lines

[OPENMP] Fix PR34927: Emit initializer for reduction array with declare
reduction.

If the reduction is an array or an array section and reduction operation
is declare reduction without initializer, it may lead to crash.
------------------------------------------------------------------------

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

6 years agoMerging r315586:
Tom Stellard [Tue, 14 Nov 2017 00:00:35 +0000 (00:00 +0000)]
Merging r315586:

------------------------------------------------------------------------
r315586 | abataev | 2017-10-12 08:18:41 -0700 (Thu, 12 Oct 2017) | 5 lines

[OPENMP] Fix PR34926: Fix handling of the array sections passed as
function params.

Codegen could crash if the array section base expression is the
function parameter.
------------------------------------------------------------------------

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

6 years agoMerging r313675:
Tom Stellard [Mon, 13 Nov 2017 23:52:05 +0000 (23:52 +0000)]
Merging r313675:

------------------------------------------------------------------------
r313675 | rcraik | 2017-09-19 14:04:23 -0700 (Tue, 19 Sep 2017) | 9 lines

[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values

When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec):
1) The iteration vector vec contains less than n items
2) The iteration vector vec contains a variable that is not a loop control variable
This patch addresses both of these issues.

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

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

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

6 years agoMerging r312296:
Tom Stellard [Mon, 13 Nov 2017 23:42:12 +0000 (23:42 +0000)]
Merging r312296:

------------------------------------------------------------------------
r312296 | abataev | 2017-08-31 16:34:33 -0700 (Thu, 31 Aug 2017) | 1 line

[OPENMP] Fix the test, NFC.
------------------------------------------------------------------------

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

6 years agoMerging r312292:
Tom Stellard [Mon, 13 Nov 2017 23:34:53 +0000 (23:34 +0000)]
Merging r312292:

------------------------------------------------------------------------
r312292 | abataev | 2017-08-31 16:06:52 -0700 (Thu, 31 Aug 2017) | 8 lines

[OPENMP] Fix for PR34398: assert with random access iterator if the
step>1.

If the loop is a loot with random access iterators and the iteration
construct is represented it += n, then the compiler crashed because of
reusing of the same MaterializedTemporaryExpr around N. Patch fixes it
by using the expression as written, without any special kind of
wrappings.
------------------------------------------------------------------------

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

6 years agoMerging r311777:
Tom Stellard [Mon, 13 Nov 2017 23:26:36 +0000 (23:26 +0000)]
Merging r311777:

------------------------------------------------------------------------
r311777 | abataev | 2017-08-25 08:43:55 -0700 (Fri, 25 Aug 2017) | 5 lines

[OPENMP] Fix for PR34321: ustom OpenMP reduction in C++ template causes
SEGFAULT at compile time

Compiler crashed when tried to rebuild non-template expression in
dependent context.
------------------------------------------------------------------------

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

6 years agoMerging r311013:
Tom Stellard [Mon, 13 Nov 2017 23:12:35 +0000 (23:12 +0000)]
Merging r311013:

------------------------------------------------------------------------
r311013 | abataev | 2017-08-16 08:58:46 -0700 (Wed, 16 Aug 2017) | 7 lines

[OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.

If worksharing construct has at least one linear item, an implicit
synchronization point must be emitted to avoid possible conflict with
the loading/storing values to the original variables. Added implicit
barrier if the linear item is found before actual start of the
worksharing construct.
------------------------------------------------------------------------

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

6 years agoMerging r309288:
Tom Stellard [Mon, 13 Nov 2017 22:52:27 +0000 (22:52 +0000)]
Merging r309288:

------------------------------------------------------------------------
r309288 | erichkeane | 2017-07-27 09:28:20 -0700 (Thu, 27 Jul 2017) | 32 lines

Fix double destruction of objects when OpenMP construct is canceled

When an omp for loop is canceled the constructed objects are being destructed
twice.

It looks like the desired code is:

{

  Obj o;
  If (cancelled) branch-through-cleanups to cancel.exit.

}
[cleanups]
cancel.exit:

__kmpc_for_static_fini
br cancel.cont (*)

cancel.cont:

__kmpc_barrier
return

The problem seems to be the branch to cancel.cont is currently also going
through the cleanups calling them again. This change just does a direct branch
instead.

Patch By: michael.p.rice@intel.com

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

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

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

6 years agoMerging r313392:
Tom Stellard [Fri, 29 Sep 2017 23:52:26 +0000 (23:52 +0000)]
Merging r313392:

------------------------------------------------------------------------
r313392 | ctopper | 2017-09-15 13:27:59 -0700 (Fri, 15 Sep 2017) | 7 lines

[X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent a backend isel failure.

The __builtin_ia32_pbroadcastq512_mem_mask we were previously trying to use in 32-bit mode is not implemented in the x86 backend and causes isel to fail in release builds. In debug builds it fails even earlier during legalization with an llvm_unreachable.

While there add the missing test case for this intrinsic for this for 64-bit mode.

This fixes PR34631. D37668 should be able to recover this for 32-bit mode soon. But I wanted to fix the crash ahead of that.
------------------------------------------------------------------------

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

6 years agoMerging r312447:
Tom Stellard [Thu, 28 Sep 2017 23:41:39 +0000 (23:41 +0000)]
Merging r312447:

------------------------------------------------------------------------
r312447 | hfinkel | 2017-09-03 10:18:25 -0700 (Sun, 03 Sep 2017) | 12 lines

[CodeGen] Treat all vector fields as mayalias

Because it is common to treat vector types as an array of their elements, or
even some other type that's not the element type, and thus index into them, we
can't use struct-path TBAA for these accesses. Even though we already treat all
vector types as equivalent to 'char', we were using field-offset information
for them with TBAA, and this renders undefined the intra-value indexing we
intend to allow. Note that, although 'char' is universally aliasing, with path
TBAA, we can still differentiate between access to s.a and s.b in
  struct { char a, b; } s;. We can't use this capability as-is for vector types.

Fixes PR33967.
------------------------------------------------------------------------

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

6 years agoMerging r312651:
Tom Stellard [Thu, 28 Sep 2017 21:57:43 +0000 (21:57 +0000)]
Merging r312651:

------------------------------------------------------------------------
r312651 | jroelofs | 2017-09-06 10:09:25 -0700 (Wed, 06 Sep 2017) | 23 lines

Fix ARM bare metal driver to support atomics

The new bare metal support only supports the single thread model. This causes
the builtin atomic functions (e.g.: __atomic_fetch_add) to not generate
thread-safe assembly for these operations, which breaks our firmware. We target
bare metal, and need to atomically modify variables in our interrupt routines,
and task threads.

Internally, the -mthread-model flag determines whether to lower or expand
atomic operations (see D4984).

This change removes the overridden thread model methods, and instead relies on
the base ToolChain class to validate the thread model (which already includes
logic to validate single thread model support). If the single thread model is
required, the -mthread-model flag will have to be provided.

As a workaround "-mthread-model posix" could be provided, but it only works due
to a bug in the validation of the -mthread-model flag (separate patch coming to
fix this).

https://reviews.llvm.org/D37493

Patch by: Ian Tessier!
------------------------------------------------------------------------

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

6 years agoMerging r312622:
Tom Stellard [Thu, 28 Sep 2017 17:22:56 +0000 (17:22 +0000)]
Merging r312622:

------------------------------------------------------------------------
r312622 | jbcoe | 2017-09-06 00:33:32 -0700 (Wed, 06 Sep 2017) | 13 lines

Fix __repr__ for Diagnostic in clang.cindex

Summary: Also move misplaced tests for exception specification to fix failing Python tests.

Reviewers: hans, compnerd

Reviewed By: compnerd

Subscribers: cfe-commits

Tags: #clang-c

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

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

6 years agoMerging r314354:
Dylan McKay [Thu, 28 Sep 2017 07:06:54 +0000 (07:06 +0000)]
Merging r314354:
------------------------------------------------------------------------
r314354 | dylanmckay | 2017-09-28 11:09:01 +1300 (Thu, 28 Sep 2017) | 3 lines

[AVR] Update data layout to match current LLVM trunk

The data layout was changed in r314179 to fix atomic loads and stores.
------------------------------------------------------------------------

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

6 years agoMention the expected change to default -std= in future clang releases.
Richard Smith [Thu, 31 Aug 2017 23:19:49 +0000 (23:19 +0000)]
Mention the expected change to default -std= in future clang releases.

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

6 years agoConsistently use code font for command-line flags in the release notes.
Richard Smith [Wed, 30 Aug 2017 23:03:58 +0000 (23:03 +0000)]
Consistently use code font for command-line flags in the release notes.

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

6 years agoAdd a couple of release note updates for C++ changes since Clang 4.
Richard Smith [Wed, 30 Aug 2017 22:58:37 +0000 (22:58 +0000)]
Add a couple of release note updates for C++ changes since Clang 4.

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

6 years agoReleaseNotes: one back-tick too many
Hans Wennborg [Wed, 30 Aug 2017 18:43:04 +0000 (18:43 +0000)]
ReleaseNotes: one back-tick too many

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

6 years agoReleaseNotes: remove another in-progress warning
Hans Wennborg [Wed, 30 Aug 2017 18:38:07 +0000 (18:38 +0000)]
ReleaseNotes: remove another in-progress warning

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

6 years agoMerging r312149:
Hans Wennborg [Wed, 30 Aug 2017 18:36:09 +0000 (18:36 +0000)]
Merging r312149:
------------------------------------------------------------------------
r312149 | hans | 2017-08-30 11:35:44 -0700 (Wed, 30 Aug 2017) | 1 line

docs: typo fix
------------------------------------------------------------------------

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

6 years agoMerging r311823: (+update ClangCommandLineReference.rst)
Hans Wennborg [Tue, 29 Aug 2017 17:13:55 +0000 (17:13 +0000)]
Merging r311823: (+update ClangCommandLineReference.rst)
------------------------------------------------------------------------
r311823 | rsmith | 2017-08-25 18:04:35 -0700 (Fri, 25 Aug 2017) | 16 lines

Add flag to request Clang is ABI-compatible with older versions of itself

This patch adds a flag -fclang-abi-compat that can be used to request that
Clang attempts to be ABI-compatible with some older version of itself.

This is provided on a best-effort basis; right now, this can be used to undo
the ABI change in r310401, reverting Clang to its prior C++ ABI for pass/return
by value of class types affected by that change, and to undo the ABI change in
r262688, reverting Clang to using integer registers rather than SSE registers
for passing <1 x long long> vectors. The intent is that we will maintain this
backwards compatibility path as we make ABI-breaking fixes in future.

The reversion to the old behavior for r310401 is also applied to the PS4 target
since that change is not part of its platform ABI (which is essentially to do
whatever Clang 3.2 did).

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

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

6 years agoMerging r311792:
Hans Wennborg [Fri, 25 Aug 2017 20:30:43 +0000 (20:30 +0000)]
Merging r311792:
------------------------------------------------------------------------
r311792 | djasper | 2017-08-25 12:14:53 -0700 (Fri, 25 Aug 2017) | 9 lines

[Format] Invert nestingAndIndentLevel pair in WhitespaceManager used for
alignments

Indent should be compared before nesting level to determine if a token
is on the same scope as the one we align with. Because it was inverted,
clang-format sometimes tried to align tokens with tokens from outer
scopes, causing the assert(Shift >= 0) to fire.

This fixes bug #33507. Patch by Beren Minor, thank you!
------------------------------------------------------------------------

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

6 years agoMerging r311695:
Hans Wennborg [Fri, 25 Aug 2017 20:27:58 +0000 (20:27 +0000)]
Merging r311695:
------------------------------------------------------------------------
r311695 | rsmith | 2017-08-24 13:10:33 -0700 (Thu, 24 Aug 2017) | 9 lines

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Patch by Marek Kurdej!

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

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

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

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

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

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

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

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

Reviewers: erikjv, bkramer, klimek, yvvan

Reviewed By: bkramer

Subscribers: cfe-commits

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

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

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

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

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

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

introduced via

  https://reviews.llvm.org/D33830

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

Should go into clang-5.0 IMHO.

Contributed by @pboettch!

Reviewers: djasper, krasimir

Reviewed By: djasper, krasimir

Subscribers: hans, klimek

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[ObjC] Check written attributes only when synthesizing ambiguous property

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

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

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

rdar://33748089

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: bruno, hans

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

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

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

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

This fixes ABI differences between Clang and GCC:

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

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

This also fixes an ABI difference between Clang and MSVC:

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

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

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

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

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

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

[analyzer] Fix modeling of constructors

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

Test plan:
make check-all

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

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

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

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

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

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

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

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

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

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

Reviewers: rengolin, hans

Reviewed By: hans

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

rdar://32292196

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

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

Set the lexical context for dummy tag decl inside createTagFromNewDecl

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

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

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

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

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

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

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

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

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

As suggested on PR33912.

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

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

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

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

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

Revert r302670 for the upcoming 5.0.0 release

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

Faliures manifest for stage2 mips build.

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

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

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

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

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

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

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

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

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

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

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

Implement latest feature test macro recommendations, P0096R4.

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

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

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

Reorder tests to match latest SD-6 draft.

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

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

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

PR33850: Update cxx_dr_status for Clang 5 branch.

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

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

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

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

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

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

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

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

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

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

int main() {
  return foo1();
}

rdar://problem/32411865

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

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

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

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

This fixes a change that was inadvertently introduced in r309607.

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

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

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

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

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

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

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

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

This is a follow-up to r306922.

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

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

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

Fix -Wshadow false positives with function-local classes.

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

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

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

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

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

Reviewers: rnk, rsmith, arphaman, Quuxplusone

Reviewed By: rnk, Quuxplusone

Subscribers: Quuxplusone, cfe-commits

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

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

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

Fixed failing assert in code completion.

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

Reviewers: erikjv, klimek, bkramer, krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

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

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

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

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

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

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

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

Fixes a regression introduced by r308218.

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

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

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

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

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

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

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

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

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

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

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

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

Fixes PR34079

Reviewers: RKSimon, zvi

Reviewed By: RKSimon

Subscribers: cfe-commits

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

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

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

Revert r304953 for release 5.0.0

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

Faliures manifest for stage2 mips build.

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

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

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

Don't emit undefined-internal warnings for CXXDeductionGuideDecls.

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

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

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

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

[coroutines] Add serialization/deserialization of coroutines

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: EricWF, cfe-commits

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

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

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

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

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

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

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

[Sema] Fix lax conversion between non ext vectors

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[Bash-autocompletion] Show HelpText with possible flags

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

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

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

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

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

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

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

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

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

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

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

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

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

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

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

Headers: improve ARM EHABI coverage of unwind.h

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

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

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

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

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

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

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

This fixes PR33916.

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

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

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

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

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

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

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

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

Work around an MSVC2017 update 3 codegen bug.

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

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

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

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

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

I ran:

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

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

6 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 19 Jul 2017 14:44:30 +0000 (14:44 +0000)]
Generate docs/AttributeReference.rst

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

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

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

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

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

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

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

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

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

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

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

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

rdar://10184173

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

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

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

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