]> granicus.if.org Git - clang/log
clang
7 years ago[OpenMP][Driver] Put target binary for each offload target into a
Alexey Bataev [Tue, 30 May 2017 18:57:51 +0000 (18:57 +0000)]
[OpenMP][Driver] Put target binary for each offload target into a
separate section, by Sergey Dmitriev

Linker script that is generated by the clang driver for creating fat binary puts target binaries for all offload targets into a single ELF section .omp_offloading. This is not convenient because it greatly complicates operations with the final fat binary once it is linked. For example extracting target binary for a particular target from such fat executable would not be an easy task if you have more than one offload target.

Attached patch changes clang driver to put target binary for each
offload target into a separate ELF section .omp_offloading.<target
triple>.

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

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

7 years agoReverting Neon vector type 64-alignment fix
Javed Absar [Tue, 30 May 2017 17:09:47 +0000 (17:09 +0000)]
Reverting Neon vector type 64-alignment fix

The patch caused ABI breaks on darwin/others.
Reverting to come back with a more restrictive patch.

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

7 years ago[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.
Alexey Bataev [Tue, 30 May 2017 16:00:04 +0000 (16:00 +0000)]
[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.

According to OpenMP 5.0 at least one 'map' or 'use_device_ptr' clause
must be specified for 'target data' construct. Patch adds support for
this feature.

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

7 years ago[libclang] Allow to suspend a translation unit.
Erik Verbruggen [Tue, 30 May 2017 14:25:54 +0000 (14:25 +0000)]
[libclang] Allow to suspend a translation unit.

A suspended translation unit uses significantly less memory but on the
other side does not support any other calls than
clang_reparseTranslationUnit to resume it or
clang_disposeTranslationUnit to dispose it completely.

This helps IDEs to reduce the memory footprint. The data that is freed
by a call to clang_suspendTranslationUnit will be re-generated on the
next (re)parse anyway. Used with a preamble, this allows pretty fast
resumption of the translation unit for further use (compared to disposal
of the translation unit and a parse from scratch).

Patch by Nikolai Kosjar!

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

7 years agoFixup r304205 - Require PowerPC target
Diana Picus [Tue, 30 May 2017 14:05:33 +0000 (14:05 +0000)]
Fixup r304205 - Require PowerPC target

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

7 years agoFix issue with test that caused bildbot failure
Javed Absar [Tue, 30 May 2017 13:34:26 +0000 (13:34 +0000)]
Fix issue with test that caused bildbot failure

These tests did not specify the target.
The failure was triggered by change -
https://reviews.llvm.org/D33205
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/7314

which sets vector alignment to 8-byte for arm-targets (except for Android).
So, fixing the test to make it target specific.

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

7 years ago[ARM] Update long-test after r304201.
Benjamin Kramer [Tue, 30 May 2017 12:44:48 +0000 (12:44 +0000)]
[ARM] Update long-test after r304201.

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

7 years agoAllow for unfinished #if blocks in preambles
Erik Verbruggen [Tue, 30 May 2017 11:54:55 +0000 (11:54 +0000)]
Allow for unfinished #if blocks in preambles

Previously, a preamble only included #if blocks (and friends like
ifdef) if there was a corresponding #endif before any declaration or
definition. The problem is that any header file that uses include guards
will not have a preamble generated, which can make code-completion very
slow.

To prevent errors about unbalanced preprocessor conditionals in the
preamble, and unbalanced preprocessor conditionals after a preamble
containing unfinished conditionals, the conditional stack is stored
in the pch file.

This fixes PR26045.

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

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

7 years ago[PPC] Make altivec conversion function macros.
Benjamin Kramer [Tue, 30 May 2017 11:37:29 +0000 (11:37 +0000)]
[PPC] Make altivec conversion function macros.

The second argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

Sadly the overloading turned this into a big macro mess. Fixes PR33212.

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

7 years ago[ARM] Fix Neon vector type alignment to 64-bit
Javed Absar [Tue, 30 May 2017 10:12:15 +0000 (10:12 +0000)]
[ARM] Fix Neon vector type alignment to 64-bit

The maximum alignment for ARM NEON data types should be 64-bits as specified
in ARM procedure call standard document Sec. A.2 Notes.
This patch fixes it from its current larger natural default values, except
for Android (so as not to break existing ABI).
Reviewed by: Stephen Hines, Renato Golin.
Differential Revision: https://reviews.llvm.org/D33205

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

7 years ago[OpenCL] Added diagnostic for implicit declaration of function in OpenCL
Egor Churaev [Tue, 30 May 2017 05:57:52 +0000 (05:57 +0000)]
[OpenCL] Added diagnostic for implicit declaration of function in OpenCL

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[OpenCL] An error shall occur if any scalar operand has greater rank than the type...
Egor Churaev [Tue, 30 May 2017 05:32:03 +0000 (05:32 +0000)]
[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Summary:
This is the fix for patch https://reviews.llvm.org/D33353
@uweigand, could you please verify that everything will be good on SystemZ?
I added triple spir-unknown-unknown.
Thank you in advance!

Reviewers: uweigand

Reviewed By: uweigand

Subscribers: yaxunl, cfe-commits, bader, Anastasia, uweigand

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

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

7 years agoDiagnose attempts to build a preprocessed module that defines an unavailable submodule.
Richard Smith [Tue, 30 May 2017 05:22:59 +0000 (05:22 +0000)]
Diagnose attempts to build a preprocessed module that defines an unavailable submodule.

The errors we would otherwise get are incomprehensible, as we would enter the
module but not make its contents visible to itself.

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

7 years ago[trivial] fix a typo in comment, NFC
Hiroshi Inoue [Tue, 30 May 2017 05:06:46 +0000 (05:06 +0000)]
[trivial] fix a typo in comment, NFC

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

7 years ago[modules] When we #include a local submodule header that we've already built,
Richard Smith [Tue, 30 May 2017 02:03:19 +0000 (02:03 +0000)]
[modules] When we #include a local submodule header that we've already built,
and it has an include guard, produce callbacks for a module import, not for a
skipped non-modular header.

Fixes -E output when preprocessing a module to list these cases as a module
import, rather than suppressing the #include and losing the import side effect.

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

7 years agoCGCoroutine.cpp: (NFC) clang-format misplaced brace
Gor Nishanov [Mon, 29 May 2017 21:15:31 +0000 (21:15 +0000)]
CGCoroutine.cpp: (NFC) clang-format misplaced brace

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

7 years ago[analyzer] Fix immutable map factory lifetime for partial taint.
Artem Dergachev [Mon, 29 May 2017 18:54:02 +0000 (18:54 +0000)]
[analyzer] Fix immutable map factory lifetime for partial taint.

This should fix the leaks found by asan buildbot in r304162.

Also don't store a reference to the factory with every map value,
which is the only difference between ImmutableMap and ImmutableMapRef.

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

7 years agoUnbreak long test after r304127.
Benjamin Kramer [Mon, 29 May 2017 18:11:11 +0000 (18:11 +0000)]
Unbreak long test after r304127.

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

7 years ago[analyzer] Support partially tainted records.
Artem Dergachev [Mon, 29 May 2017 15:42:56 +0000 (15:42 +0000)]
[analyzer] Support partially tainted records.

The analyzer's taint analysis can now reason about structures or arrays
originating from taint sources in which only certain sections are tainted.

In particular, it also benefits modeling functions like read(), which may
read tainted data into a section of a structure, but RegionStore is incapable of
expressing the fact that the rest of the structure remains intact, even if we
try to model read() directly.

Patch by Vlad Tsyrklevich!

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

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

7 years ago[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.
Artem Dergachev [Mon, 29 May 2017 15:03:20 +0000 (15:03 +0000)]
[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.

The new checker currently contains the very core infrastructure for tracking
the state of iterator-type objects in the analyzer: relating iterators to
their containers, tracking symbolic begin and end iterator values for
containers, and solving simple equality-type constraints over iterators.
A single specific check over this infrastructure is capable of finding usage of
out-of-range iterators in some simple cases.

Patch by Ádám Balogh!

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

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

7 years ago[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.
Artem Dergachev [Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)]
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.

pthread_mutex_destroy() may fail, returning a non-zero error number, and
keeping the mutex untouched. The mutex can be used on the execution branch
that follows such failure, so the analyzer shouldn't warn on using
a mutex that was previously destroyed, when in fact the destroy call has failed.

Patch by Malhar Thakkar!

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

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

7 years agoclang-format: [JS] do not clean up duplicated commas.
Martin Probst [Mon, 29 May 2017 08:41:11 +0000 (08:41 +0000)]
clang-format: [JS] do not clean up duplicated commas.

Summary:
In JavaScript, duplicated commas have semantic meaning.
    x = [a,,b];

The statement above creates an array with three entries, the middle being undefined. Because clang-format should not change semantics, disable this cleanup in JS.

Reviewers: djasper

Subscribers: klimek

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

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

7 years agoclang-format: [JS] fix indenting bound functions.
Martin Probst [Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)]
clang-format: [JS] fix indenting bound functions.

Summary:
The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:
    fn((function() { ... }).bind(this));

This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[OpenCL] Test on half immediate support.
Egor Churaev [Mon, 29 May 2017 07:44:22 +0000 (07:44 +0000)]
[OpenCL] Test on half immediate support.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years agoIRGen: Add optnone attribute on function during O0
Mehdi Amini [Mon, 29 May 2017 05:38:20 +0000 (05:38 +0000)]
IRGen: Add optnone attribute on function during O0

Amongst other, this will help LTO to correctly handle/honor files
compiled with O0, helping debugging failures.
It also seems in line with how we handle other options, like how
-fnoinline adds the appropriate attribute as well.

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

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

7 years ago[coroutines] Support "coroutines" feature in module map requires clause
Eric Fiselier [Sun, 28 May 2017 21:07:22 +0000 (21:07 +0000)]
[coroutines] Support "coroutines" feature in module map requires clause

Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years ago[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend...
Eric Fiselier [Sun, 28 May 2017 18:21:12 +0000 (18:21 +0000)]
[coroutines] Diagnose invalid result  types for `await_resume` and `await_suspend` and add missing conversions.

Summary:
The expression `await_ready` is required to be contextually convertible to bool and `await_suspend` must be a prvalue of either `void` or `bool`.
This patch adds diagnostics for when those requirements are violated.

It also correctly performs the contextual conversion to bool on the result of `await_ready`

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[coroutines] www/cxx_status.html: add non-breaking hyphen
Gor Nishanov [Sun, 28 May 2017 17:35:23 +0000 (17:35 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen

Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years ago[coroutines] www/cxx_status.html: add non-breaking hyphen
Gor Nishanov [Sun, 28 May 2017 16:25:31 +0000 (16:25 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen

Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years agobaremetal.cpp: Fix tests where lib suffix is 64
Ismail Donmez [Sun, 28 May 2017 06:15:42 +0000 (06:15 +0000)]
baremetal.cpp: Fix tests where lib suffix is 64

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

7 years ago[coroutines] Mark cxx_status.html of Coroutines TS as (SVN)
Gor Nishanov [Sat, 27 May 2017 22:54:52 +0000 (22:54 +0000)]
[coroutines] Mark cxx_status.html of Coroutines TS as (SVN)

Summary: It is time!

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov, rsmith

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years agoRevert "[coroutines] Support "coroutines" feature in module map requires clause"
Eric Fiselier [Sat, 27 May 2017 03:04:51 +0000 (03:04 +0000)]
Revert "[coroutines] Support "coroutines" feature in module map requires clause"

This reverts commit r304054.

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

7 years ago[OpenMP] Create COMDAT group for OpenMP offload registration code to avoid multiple...
George Rokos [Sat, 27 May 2017 03:03:13 +0000 (03:03 +0000)]
[OpenMP] Create COMDAT group for OpenMP offload registration code to avoid multiple copies

Thanks to Sergey Dmitriev for submitting the patch.

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

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

7 years ago[coroutines] Support "coroutines" feature in module map requires clause
Eric Fiselier [Sat, 27 May 2017 02:46:17 +0000 (02:46 +0000)]
[coroutines] Support "coroutines" feature in module map requires clause

Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years agoResubmit r303861.
Konstantin Zhuravlyov [Fri, 26 May 2017 21:08:20 +0000 (21:08 +0000)]
Resubmit r303861.

[AMDGPU] add __builtin_amdgcn_s_getpc

Patch by Tim Corringham

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

7 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Fri, 26 May 2017 20:14:12 +0000 (20:14 +0000)]
Remove unused diagnostics. NFC.

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

7 years agoMake helper functions static. NFC.
Benjamin Kramer [Fri, 26 May 2017 20:08:24 +0000 (20:08 +0000)]
Make helper functions static. NFC.

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

7 years ago[scan-build] Patch to scan-build tool to support "--target=<value>" flag
Petr Hosek [Fri, 26 May 2017 19:25:32 +0000 (19:25 +0000)]
[scan-build] Patch to scan-build tool to support "--target=<value>" flag

The scan-build script provided by clang can be used to detect defects in
code in the compile time. However, we discovered that the
"--target=<value>" flag in clang is not properly handled by this script,
which results in failures when analyzing projects that have used this
flag in their makefile.

This single line of change allows scan-build script to properly handle
the "--target=<value>" flag.

Patch by Haowei Wu

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

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

7 years agoCodeGen: Define Swift's legal vector types for AArch64, ARM
Arnold Schwaighofer [Fri, 26 May 2017 18:11:54 +0000 (18:11 +0000)]
CodeGen: Define Swift's legal vector types for AArch64, ARM

rdar://32401301

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

7 years agoOnly define __SIZEOF_FLOAT128__ on x86 as intended in r304012
Reid Kleckner [Fri, 26 May 2017 17:48:01 +0000 (17:48 +0000)]
Only define __SIZEOF_FLOAT128__ on x86 as intended in r304012

GCC only defines it on x86.

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

7 years agoEnable __float128 for mingw for GCC compatibility and define __SIZEOF_FLOAT128__...
Reid Kleckner [Fri, 26 May 2017 17:38:15 +0000 (17:38 +0000)]
Enable __float128 for mingw for GCC compatibility and define __SIZEOF_FLOAT128__ on x86

GCC defines __FLOAT128__ on Power and __SIZEOF_FLOAT128__ on x86. We're
just following the inconsistency for now so users have some way to test.

Effectively merges this patch as requested by Martell Malone:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-clang/0107-enable-__float128-for-X86-MinGW.patch

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

7 years agoUpdate MS mangling EBNF, NFC
Reid Kleckner [Fri, 26 May 2017 17:11:10 +0000 (17:11 +0000)]
Update MS mangling EBNF, NFC

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

7 years agoAdding a const overload of DesignatedInitExpr::getDesignator().
Aaron Ballman [Fri, 26 May 2017 15:55:52 +0000 (15:55 +0000)]
Adding a const overload of DesignatedInitExpr::getDesignator().

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

7 years agoRevert "[OpenCL] An error shall occur if any scalar operand has greater rank than...
Renato Golin [Fri, 26 May 2017 15:32:45 +0000 (15:32 +0000)]
Revert "[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element"

This reverts commit r303986 as it broke all ARM and AArch64 buildbots...

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-39vma/builds/7007
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/6705
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7509
etc.

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

7 years ago[OpenCL] An error shall occur if any scalar operand has greater rank than the type...
Egor Churaev [Fri, 26 May 2017 13:30:26 +0000 (13:30 +0000)]
[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, bader, yaxunl

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

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

7 years ago[docs] Point coroutine link to an actual document
George Burgess IV [Fri, 26 May 2017 02:56:51 +0000 (02:56 +0000)]
[docs] Point coroutine link to an actual document

Unsure if there's a better document, but what we had before led to a
404. :)

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

7 years agoCreate valid LValue to represent null pointers in constant exprs
Tim Northover [Fri, 26 May 2017 02:16:00 +0000 (02:16 +0000)]
Create valid LValue to represent null pointers in constant exprs

We were leaving the SubobjectDesignator in a surprising situation, where
it was allegedly valid but didn't actually refer to a type. This caused
a crash later on.

This patch fills out the SubobjectDesignator with the pointee type (as
happens in other evaluations of constant pointers) so that we don't
crash later.

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

7 years agoFactor resolving of header directives -> files out of module map parser.
Richard Smith [Fri, 26 May 2017 00:01:53 +0000 (00:01 +0000)]
Factor resolving of header directives -> files out of module map parser.

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

7 years ago"*" => "+" to avoid matching on empty string.
Richard Trieu [Thu, 25 May 2017 23:25:36 +0000 (23:25 +0000)]
"*" => "+" to avoid matching on empty string.

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

7 years agoMake test/Driver/baremetal.cpp work when output directory isn't named 'bin'.
Richard Trieu [Thu, 25 May 2017 23:03:08 +0000 (23:03 +0000)]
Make test/Driver/baremetal.cpp work when output directory isn't named 'bin'.

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

7 years agoSwitch from using a DiagnosticTrap and a note for "while defining a special
Richard Smith [Thu, 25 May 2017 22:47:05 +0000 (22:47 +0000)]
Switch from using a DiagnosticTrap and a note for "while defining a special
member function" context notes to registering an entry on the context stack.

Also reorder the steps within defining special members to be consistent.

This has a few benefits: if multiple diagnostics are produced while checking
such a member, the note is now attached to the first such diagnostic rather
than the last, this prepares us for persisting these diagnostics between the
point at which we require the implicit instantiation of a template and the
point at which that instantiation is actually performed, and this fixes some
cases where we would fail to produce a full note stack leading back to user
code in the case of such a diagnostic.

The reordering exposed a case where we could recursively attempt to define a
defaulted destructor while we're already defining one (and other such cases
also appear to be possible, with or without this change), so this change also
reuses the "willHaveBody" flag on function declarations to track that we're in
the middle of synthesizing a body for the function and bails out if we try to
define a function that we're already defining.

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

7 years agoUpdate the getting started documentation to match the corresponding LLVM commit in...
Aaron Ballman [Thu, 25 May 2017 21:02:49 +0000 (21:02 +0000)]
Update the getting started documentation to match the corresponding LLVM commit in r303912.

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

7 years agoMake test/Driver/baremetal.cpp pass on Windows
Hans Wennborg [Thu, 25 May 2017 20:39:52 +0000 (20:39 +0000)]
Make test/Driver/baremetal.cpp pass on Windows

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

7 years agoRevert "[AMDGPU] add __builtin_amdgcn_s_getpc"
Reid Kleckner [Thu, 25 May 2017 20:28:26 +0000 (20:28 +0000)]
Revert "[AMDGPU] add __builtin_amdgcn_s_getpc"

This reverts commit r303861, the LLVM intrinsic was reverted.

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

7 years agoAppease more buildbots about r303873
Jonathan Roelofs [Thu, 25 May 2017 18:55:22 +0000 (18:55 +0000)]
Appease more buildbots about r303873

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

7 years agoRevert MSVC CXXOperatorNames patch due to issues with Chromium
Erich Keane [Thu, 25 May 2017 16:24:49 +0000 (16:24 +0000)]
Revert MSVC CXXOperatorNames patch due to issues with Chromium

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

7 years agoRelax testcase to appease buildbots
Jonathan Roelofs [Thu, 25 May 2017 16:20:51 +0000 (16:20 +0000)]
Relax testcase to appease buildbots

When lld isn't built, the tests as they were previously, were too picky about
the path to the linker.

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

7 years agoDon't defer to the GCC driver for linking arm-baremetal
Jonathan Roelofs [Thu, 25 May 2017 15:42:13 +0000 (15:42 +0000)]
Don't defer to the GCC driver for linking arm-baremetal

Also comes with a cmake cache for building the runtime bits:

 $ cmake <normal cmake flags> \
   -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \
   -C /path/to/clang/cmake/caches/BaremetalARM.cmake \
   /path/to/llvm

https://reviews.llvm.org/D33259

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

7 years agoMake git-clang-format python 3 compatible
Eric Fiselier [Thu, 25 May 2017 15:24:04 +0000 (15:24 +0000)]
Make git-clang-format python 3 compatible

Summary: This patch attempts to make `git-clang-format` both python2 and python3 compatible. Currently it only works in python2.

Reviewers: modocache, compnerd, djasper, jbcoe, srhines, ddunbar

Reviewed By: jbcoe

Subscribers: kimgr, mgorny, llvm-commits, cfe-commits

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

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

7 years ago[coroutines] Diagnose when promise types fail to declare either return_void or return...
Eric Fiselier [Thu, 25 May 2017 14:59:39 +0000 (14:59 +0000)]
[coroutines] Diagnose when promise types fail to declare either return_void or return_value.

Summary:
According to the PDTS it's perfectly legal to have a promise type that defines neither `return_value` nor `return_void`. However a coroutine that uses such a promise type will almost always have UB, because it can never `co_return`.

This patch changes Clang to diagnose such cases as an error. It also cleans up some of the diagnostic messages relating to member lookup in the promise type.

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[coroutines] Bump __cpp_coroutines version
Eric Fiselier [Thu, 25 May 2017 14:58:46 +0000 (14:58 +0000)]
[coroutines] Bump __cpp_coroutines version

Summary: This patch is needed so that Libc++ can actually tess if Clang supports coroutines, instead of just paying lip service with a partial implementation. Otherwise the libc++ test suite will fail against older versions of Clang

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[AMDGPU] add __builtin_amdgcn_s_getpc
Tim Corringham [Thu, 25 May 2017 14:16:11 +0000 (14:16 +0000)]
[AMDGPU] add __builtin_amdgcn_s_getpc

Summary: Added the builtin corresponding to the s_getpc intrinsic added in llvm D32862

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

7 years ago[X86] Adding avx512_vpopcntdq feature set and its intrinsics
Oren Ben Simhon [Thu, 25 May 2017 13:44:11 +0000 (13:44 +0000)]
[X86] Adding avx512_vpopcntdq feature set and its intrinsics

AVX512_VPOPCNTDQ is a new feature set that was published by Intel.
The patch represents the Clang side of the addition of six intrinsics for two new machine instructions (vpopcntd and vpopcntq).
It also includes the addition of the new feature set.

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

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

7 years ago[CodeGen] Pessimize aliasing for member unions (and may-alias) objects
Krzysztof Parzyszek [Thu, 25 May 2017 12:55:47 +0000 (12:55 +0000)]
[CodeGen] Pessimize aliasing for member unions (and may-alias) objects

Use the TBAA info of the omnipotent char for these objects.

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

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

7 years ago[OpenCL] reserve_id_t cannot be used as argument to kernel function
Egor Churaev [Thu, 25 May 2017 07:18:37 +0000 (07:18 +0000)]
[OpenCL] reserve_id_t cannot be used as argument to kernel function

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years ago[OpenCL] Added regression test on invalid vector initialization.
Egor Churaev [Thu, 25 May 2017 06:55:02 +0000 (06:55 +0000)]
[OpenCL] Added regression test on invalid vector initialization.

Summary: This patch increases code coverage.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, bader, yaxunl

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

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

7 years ago[coroutines] Fix fallthrough diagnostics for coroutines
Eric Fiselier [Thu, 25 May 2017 02:16:53 +0000 (02:16 +0000)]
[coroutines] Fix fallthrough diagnostics for coroutines

Summary:
This patch fixes a number of issues with the analysis warnings emitted when a coroutine may reach the end of the function w/o returning.

* Fix bug where coroutines with `return_value` are incorrectly diagnosed as missing `co_return`'s.
* Rework diagnostic message to no longer say "non-void coroutine", because that implies the coroutine doesn't have a void return type, which it might. In this case a non-void coroutine is one who's promise type does not contain `return_void()`

As a side-effect of this patch, coroutine bodies that contain an invalid coroutine promise objects are marked as invalid.

Reviewers: GorNishanov, rsmith, aaron.ballman, majnemer

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years agoRevert "Sema: allow imaginary constants via GNU extension if UDL overloads not present."
Tim Northover [Wed, 24 May 2017 22:18:35 +0000 (22:18 +0000)]
Revert "Sema: allow imaginary constants via GNU extension if UDL overloads not present."

This reverts commit r303697. It broke libc++ tests that were specifically
checking incompatibility in C++14 mode.

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

7 years agoBasic: fix whitespace in file header (NFC)
Saleem Abdulrasool [Wed, 24 May 2017 20:27:09 +0000 (20:27 +0000)]
Basic: fix whitespace in file header (NFC)

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

7 years ago[coroutines] Add support for coroutines with non-scalar parameters
Gor Nishanov [Wed, 24 May 2017 20:09:14 +0000 (20:09 +0000)]
[coroutines] Add support for coroutines with non-scalar parameters

Summary:
Simple types like int are handled by LLVM Coroutines just fine.
But for non-scalar parameters we need to create copies of those parameters in the coroutine frame and make all uses of those parameters to refer to parameter copies.

Reviewers: rsmith, EricWF, GorNishanov

Subscribers: cfe-commits

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

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

7 years agoFor Microsoft compatibility, set fno_operator_names
Erich Keane [Wed, 24 May 2017 19:31:19 +0000 (19:31 +0000)]
For Microsoft compatibility, set fno_operator_names

There's a Microsoft header in the Windows SDK which won't
compile with clang because it uses an operator name (and)
as a field name. This patch allows that file to compile by
setting the option which disables operator names.
The header which doesn't compile <Query.h> C:/Program Files (x86)/
Windows Kits/10/include/10.0.14393.0/um\Query.h:259:40:
error: expected member name or ';' after declaration specifiers

  /* [case()] */ NODERESTRICTION or;
                   ~~~~~~~~~~~~~~~ ^

                   1 error generated.

Contributed for Melanie Blower

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

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

7 years agoAddress follow-up feedback for r303712
Argyrios Kyrtzidis [Wed, 24 May 2017 18:35:01 +0000 (18:35 +0000)]
Address follow-up feedback for r303712

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

7 years agoFix one test case faiulre in commit 303766.
Tony Jiang [Wed, 24 May 2017 18:12:11 +0000 (18:12 +0000)]
Fix one test case faiulre in commit 303766.

It is clean when I build boostrap and run make checkall on my machine, I guess
it could be I only build bootstrap with assert, while the buildbots may build
without asserts, which could cause the difference.

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

7 years ago[OPENMP] Allow value of thread local variables in target regions.
Alexey Bataev [Wed, 24 May 2017 16:00:02 +0000 (16:00 +0000)]
[OPENMP] Allow value of thread local variables in target regions.

If the variable is marked as TLS variable and target device does not
support TLS, the error is emitted for the variable even if it is not
used in target regions. Patch fixes this and allows to use the values of
the TLS variables in target regions.

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

7 years ago[PowerPC] Implement vec_xxsldwi builtin.
Tony Jiang [Wed, 24 May 2017 15:54:13 +0000 (15:54 +0000)]
[PowerPC] Implement vec_xxsldwi builtin.

The vec_xxsldwi builtin is missing from altivec.h. This has been requested by
developers working on libvpx for VP9 support for Google.

The patch fixes PR: https://bugs.llvm.org/show_bug.cgi?id=32653
Differential Revision: https://reviews.llvm.org/D33236

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

7 years ago[coroutines] Make generic lambda coroutines work
Gor Nishanov [Wed, 24 May 2017 15:44:57 +0000 (15:44 +0000)]
[coroutines] Make generic lambda coroutines work

Summary:
1. Coroutine cannot be constexpr (added a check in SemaLambda.cpp not to mark coroutine as constexpr)
2. TransformCoroutineBodyStmt should transform ResultDecl and ReturnStmt

Reviewers: rsmith, GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, cfe-commits

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

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

7 years agoWarn about uses of `@available` that can't suppress the
Alex Lorenz [Wed, 24 May 2017 15:15:29 +0000 (15:15 +0000)]
Warn about uses of `@available` that can't suppress the
-Wunguarded-availability warnings

rdar://32306520

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

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

7 years ago[PowerPC] Implement vec_xxpermdi builtin.
Tony Jiang [Wed, 24 May 2017 15:13:32 +0000 (15:13 +0000)]
[PowerPC] Implement vec_xxpermdi builtin.

The vec_xxpermdi builtin is missing from altivec.h. This has been requested by
developers working on libvpx for VP9 support for Google.

The patch fixes PR: https://bugs.llvm.org/show_bug.cgi?id=32653
Differential Revision: https://reviews.llvm.org/D33053

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

7 years agoDriver must return non-zero code on errors in command line
Serge Pavlov [Wed, 24 May 2017 14:57:17 +0000 (14:57 +0000)]
Driver must return non-zero code on errors in command line

This is recommit of r302775, reverted in r302777 due to a fail in
clang-tidy. Original mesage is below.

Now if clang driver is given wrong arguments, in some cases it
continues execution and returns zero code. This change fixes this
behavior.

The fix revealed some errors in clang test set.

File test/Driver/gfortran.f90 added in r118203 checks forwarding
gfortran flags to GCC. Now driver reports error on this file, because
the option -working-directory implemented in clang differs from the
option with the same name implemented in gfortran, in clang the option
requires argument, in gfortran does not.

In the file test/Driver/arm-darwin-builtin.c clang is called with
options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed
in r191435 and now clang reports error on this test.

File arm-default-build-attributes.s uses option -verify, which is not
supported by driver, it is cc1 option.

Similarly, the file split-debug.h uses options -fmodules-embed-all-files
and -fmodule-format=obj, which are not supported by driver.

Other revealed errors are mainly mistypes.

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

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

7 years agoGeneralize two diagnostic messages to take function name as parameter.
Tony Jiang [Wed, 24 May 2017 14:45:57 +0000 (14:45 +0000)]
Generalize two diagnostic messages to take function name as parameter.

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

7 years ago[coroutines] Improved diagnostics when unhandled_exception is missing in the promise_type
Gor Nishanov [Wed, 24 May 2017 14:34:19 +0000 (14:34 +0000)]
[coroutines] Improved diagnostics when unhandled_exception is missing in the promise_type

Summary: Now we helpfully provide a note pointing at the promise_type in question.

Reviewers: EricWF, GorNishanov

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[index] The references to explicit class properties should be recorded
Alex Lorenz [Wed, 24 May 2017 14:23:40 +0000 (14:23 +0000)]
[index] The references to explicit class properties should be recorded

rdar://32376363

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

7 years ago[coroutines] [NFC] Add tests for return_void, unhandled_exception and promise dtor
Gor Nishanov [Wed, 24 May 2017 14:19:48 +0000 (14:19 +0000)]
[coroutines] [NFC] Add tests for return_void, unhandled_exception and promise dtor

Summary:
* Test that coroutine promise destructor is called.
* Test that we call return_void on fallthrough
* Test that we call unhandled exception in a try catch surrounding the body

Reviewers: EricWF, GorNishanov

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[clang-format] Remove unused using directive, NFC
Krasimir Georgiev [Wed, 24 May 2017 12:15:42 +0000 (12:15 +0000)]
[clang-format] Remove unused using directive, NFC

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

7 years agoMethod loadFromCommandLine should be able to report errors
Serge Pavlov [Wed, 24 May 2017 11:57:37 +0000 (11:57 +0000)]
Method loadFromCommandLine should be able to report errors

Now FixedCompilationDatabase::loadFromCommandLine has no means to report
which error occurred if it fails to create compilation object. This is
a block for implementing D33013, because after that change driver will
refuse to create compilation if command line contains erroneous options.

This change adds additional argument to loadFromCommandLine, which is
assigned error message text if compilation object was not created. This is
the same way as other methods of CompilationDatabase report failure.

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

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

7 years agoclang-format: Introduce BreakConstructorInitializers option
Francois Ferrand [Wed, 24 May 2017 11:36:58 +0000 (11:36 +0000)]
clang-format: Introduce BreakConstructorInitializers option

Summary:
This option replaces the BreakConstructorInitializersBeforeComma option with an enum, thus introducing a mode where the colon stays on the same line as constructor declaration:

  // When it fits on line:
  Constructor() : initializer1(), initializer2() {}

  // When it does not fit:
  Constructor() :
      initializer1(), initializer2()
  {}

  // When ConstructorInitializerAllOnOneLineOrOnePerLine = true:
  Constructor() :
      initializer1(),
      initializer2()
  {}

Reviewers: krasimir, djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoFix 'set but not used' [-Wunused-but-set-variable] warning
Simon Pilgrim [Wed, 24 May 2017 10:38:09 +0000 (10:38 +0000)]
Fix 'set but not used' [-Wunused-but-set-variable] warning

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

7 years ago[XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=
Dean Michael Berris [Wed, 24 May 2017 05:46:36 +0000 (05:46 +0000)]
[XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=

Summary:
This change allows us to add arg1 logging support to functions through
the special case list provided through -fxray-always-instrument=. This
is useful for adding arg1 logging to functions that are either in
headers that users don't have control over (i.e. cannot change the
source) or would rather not do.

It only takes effect when the pattern is matched through the "fun:"
special case, as a category. As in:

  fun:*pattern=arg1

Reviewers: pelikan, rnk

Subscribers: cfe-commits

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

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

7 years ago[coroutines] Implement correct GRO lifetime
Gor Nishanov [Wed, 24 May 2017 02:38:26 +0000 (02:38 +0000)]
[coroutines] Implement correct GRO lifetime

Summary:
Sema creates a declaration for gro variable as:

auto $gro = $promise.get_return_object();

However, gro variable has to outlive coroutine frame and coroutine promise, but,
it can only be initialized after the coroutine promise was created, thus, we
split its emission in two parts: EmitGroAlloca emits an alloca and sets up
the cleanups. Later when the coroutine promise is available we initialize
the gro and set the flag that the cleanup is now active.

Duplicate of: https://reviews.llvm.org/D31670 (which arc patch refuses to apply for some reason)

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: EricWF, cfe-commits

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

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

7 years ago[coroutines] Fix leak in CGCoroutine.cpp
Gor Nishanov [Wed, 24 May 2017 01:54:37 +0000 (01:54 +0000)]
[coroutines] Fix leak in CGCoroutine.cpp

FinalBB need to be emitted even when unused to make sure it is deleted

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

7 years agoChange __has_feature(objc_diagnose_if_attr) to __has_feature(attribute_diagnose_if_ob...
Argyrios Kyrtzidis [Wed, 24 May 2017 01:38:00 +0000 (01:38 +0000)]
Change __has_feature(objc_diagnose_if_attr) to __has_feature(attribute_diagnose_if_objc) for consistency with rest of attribute checks.

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

7 years agoEnhance the 'diagnose_if' attribute so that we can apply it for ObjC methods and...
Argyrios Kyrtzidis [Wed, 24 May 2017 00:46:27 +0000 (00:46 +0000)]
Enhance the 'diagnose_if' attribute so that we can apply it for ObjC methods and properties as well

This is an initial commit to allow using it with constant expressions, a follow-up commit will enable full support for it in ObjC methods.

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

7 years ago[Modules] Fix overly conservative assertion for import diagnostic
Bruno Cardoso Lopes [Tue, 23 May 2017 23:53:17 +0000 (23:53 +0000)]
[Modules] Fix overly conservative assertion for import diagnostic

We currenltly assert when want to diagnose a missing import and the decl
in question is already visible. It turns out that the decl in question
might be visible because another decl from the same module actually made
the module visible in a previous error diagnostic.

Remove the assertion and avoid re-exporting the module if it's already
visible.

rdar://problem/27975402

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

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

7 years ago[modules] When reparenting a local declaration, don't mark the declaration as
Richard Smith [Tue, 23 May 2017 22:02:49 +0000 (22:02 +0000)]
[modules] When reparenting a local declaration, don't mark the declaration as
being visible with its owning module if we're not tracking owning modules for
local declarations.

This avoids the possibility of a declaration being (meaninglessly) marked as
hidden with no owning module, which would otherwise lead to violated AST
invariants (checked by the added assertion).

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

7 years agoSema: allow imaginary constants via GNU extension if UDL overloads not present.
Tim Northover [Tue, 23 May 2017 21:41:49 +0000 (21:41 +0000)]
Sema: allow imaginary constants via GNU extension if UDL overloads not present.

C++14 added user-defined literal support for complex numbers so that you can
write something like "complex<double> val = 2i". However, there is an existing
GNU extension supporting this syntax and interpreting the result as a _Complex
type.

This changes parsing so that such literals are interpreted in terms of C++14's
operators if an overload is present but otherwise falls back to the original
GNU extension.

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

7 years ago[Frontend] Don't index into an empty string.
Benjamin Kramer [Tue, 23 May 2017 20:48:21 +0000 (20:48 +0000)]
[Frontend] Don't index into an empty string.

Found by msan!

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

7 years agoRemove trailing whitespace
Yuka Takahashi [Tue, 23 May 2017 18:52:27 +0000 (18:52 +0000)]
Remove trailing whitespace

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

7 years ago[GSoC] Shell autocompletion for clang
Yuka Takahashi [Tue, 23 May 2017 18:39:08 +0000 (18:39 +0000)]
[GSoC] Shell autocompletion for clang

Summary:
This is a first patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.

Simple flag completion and path completion is available in this patch.

Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma

Subscribers: llvm-commits

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

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

7 years agoRemoved fallthrough annotation which does not directly precede switch label.
Galina Kistanova [Tue, 23 May 2017 16:56:10 +0000 (16:56 +0000)]
Removed fallthrough annotation which does not directly precede switch label.

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

7 years ago[index] The references to enum constants from member enums that are
Alex Lorenz [Tue, 23 May 2017 16:47:01 +0000 (16:47 +0000)]
[index] The references to enum constants from member enums that are
from template instantiations should refer to the enum constant in the pattern
enum in the base template

rdar://32325459

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