]> granicus.if.org Git - clang/log
clang
7 years ago[OpenCL] Introduce ReadPipeType and WritePipeType.
Joey Gouly [Fri, 18 Nov 2016 14:10:54 +0000 (14:10 +0000)]
[OpenCL] Introduce ReadPipeType and WritePipeType.

This allows Sema to diagnose passing a read_only pipe to a
write_only pipe argument.

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

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 18 Nov 2016 11:18:28 +0000 (11:18 +0000)]
Wdocumentation fix

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

7 years agoAdd doxygen comments for lzcntintrin.h's intrinsics.
Ekaterina Romanova [Fri, 18 Nov 2016 06:26:01 +0000 (06:26 +0000)]
Add doxygen comments for lzcntintrin.h's intrinsics.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Charles Li.

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

7 years ago[AVX-512] Replace masked 16-bit element variable shift builtins with new unmasked...
Craig Topper [Fri, 18 Nov 2016 05:04:51 +0000 (05:04 +0000)]
[AVX-512] Replace masked 16-bit element variable shift builtins with new unmasked versions and selects.

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

7 years agoAdd doxygen comments to fxsrintrin.h's intrinsics.
Ekaterina Romanova [Fri, 18 Nov 2016 01:42:01 +0000 (01:42 +0000)]
Add doxygen comments to fxsrintrin.h's intrinsics.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Paul Robinson and Charles Li.

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

7 years ago[CUDA] Attempt to fix test failures in cuda-macos-includes.cu.
Justin Lebar [Fri, 18 Nov 2016 01:11:32 +0000 (01:11 +0000)]
[CUDA] Attempt to fix test failures in cuda-macos-includes.cu.

Run clang -cc1 -E instead of -S, in an attempt to make this test work
cross-platform.

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

7 years agoForward ns_consumed delegate arguments with a move.
John McCall [Fri, 18 Nov 2016 01:08:24 +0000 (01:08 +0000)]
Forward ns_consumed delegate arguments with a move.

StartFunction enters a release cleanup for ns_consumed arguments in
ARC, so we need to balance that somehow.  We could teach StartFunction
that it's emitting a delegating function, so that the cleanup is
unnecessary, but that would be invasive and somewhat fraught.  We could
balance the consumed argument with an extra retain, but clearing the
original variable should be easier to optimize and avoid some extra work
at -O0.  And there shouldn't be any difference as long as nothing else
uses the argument, which should always be true for the places we emit
delegate arguments.

Fixes PR 27887.

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

7 years ago[CUDA] Wrapper header changes necessary to support MacOS.
Justin Lebar [Fri, 18 Nov 2016 00:41:35 +0000 (00:41 +0000)]
[CUDA] Wrapper header changes necessary to support MacOS.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Use the right section and constant names for fatbins when compiling for macos.
Justin Lebar [Fri, 18 Nov 2016 00:41:31 +0000 (00:41 +0000)]
[CUDA] Use the right section and constant names for fatbins when compiling for macos.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Initialize our header search using the host triple.
Justin Lebar [Fri, 18 Nov 2016 00:41:27 +0000 (00:41 +0000)]
[CUDA] Initialize our header search using the host triple.

Summary:
This used to work because system headers are found in a (somewhat)
predictable set of locations on Linux.  But this is not the case on
MacOS; without this change, we don't look in the right places for our
headers when doing device-side compilation on Mac.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Driver changes to support CUDA compilation on MacOS.
Justin Lebar [Fri, 18 Nov 2016 00:41:22 +0000 (00:41 +0000)]
[CUDA] Driver changes to support CUDA compilation on MacOS.

Summary:
Compiling CUDA device code requires us to know the host toolchain,
because CUDA device-side compiles pull in e.g. host headers.

When we only supported Linux compilation, this worked because
CudaToolChain, which is responsible for device-side CUDA compilation,
inherited from the Linux toolchain.  But in order to support MacOS,
CudaToolChain needs to take a HostToolChain pointer.

Because a CUDA toolchain now requires a host TC, we no longer will
create a CUDA toolchain from Driver::getToolChain -- you have to go
through CreateOffloadingDeviceToolChains.  I am *pretty* sure this is
correct, and that previously any attempt to create a CUDA toolchain
through getToolChain() would eventually have resulted in us throwing
"error: unsupported use of NVPTX for host compilation".

In any case hacking getToolChain to create a CUDA+host toolchain would
be wrong, because a Driver can be reused for multiple compilations,
potentially with different host TCs, and getToolChain will cache the
result, causing us to potentially use a stale host TC.

So that's the main change in this patch.

In addition, we have to pull CudaInstallationDetector out of Generic_GCC
and into a top-level class.  It's now used by the Generic_GCC and MachO
toolchains.

Reviewers: tra

Subscribers: rryan, hfinkel, sfantao

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

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

7 years agoMinor changes in x86 intrinsics headers; NFC
Ekaterina Romanova [Thu, 17 Nov 2016 23:02:00 +0000 (23:02 +0000)]
Minor changes in x86 intrinsics headers; NFC

I made several changes for consistency with the rest of x86 instrinsics header files. Some of these changes help to render doxygen comments better.

1. avxintrin.h –  Moved the opening bracket on a separate line for several
                  intrinsics (for consistency with the rest of the intrinsics).

2. emmintrin.h -  Moved the doxygen comment next to the body of the function;
               -  Added braces after extern "C"  even though there is only
                  one declaration each time

3. xmmintrin.h -  Moved the doxygen comment next to the body of the function;
               -  Added intrinsic prototypes for a couple of macro definitions
                  into the doxygen comment;
               -  Added braces after extern "C"  even though there is only one
                  declaration each time

4. ammintrin.h –  Removed extra line between the doxygen comment and the body
                  of the functions (for consistency with the rest of the files).

Desk reviewed by Paul Robinson.

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

7 years ago[Preprocessor] Support for '-dI' flag
Bruno Cardoso Lopes [Thu, 17 Nov 2016 22:45:31 +0000 (22:45 +0000)]
[Preprocessor] Support for '-dI' flag

Re-introduce r285411.

Implement the -dI as supported by GCC: Output ‘#include’ directives in addition
to the result of preprocessing.

This change aims to add this option, pass it through to the preprocessor via
the options class, and when inclusions occur we output some information (+ test
cases).

Patch by Steve O'Brien!

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

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

7 years ago[CrashReproducer][Darwin] Suggest attaching .crash diagnostic file
Bruno Cardoso Lopes [Thu, 17 Nov 2016 21:41:22 +0000 (21:41 +0000)]
[CrashReproducer][Darwin] Suggest attaching .crash diagnostic file

In addition to the preprocessed sources file and reproducer script, also
point to the .crash diagnostic files on Darwin. Example:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cpp
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cache
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.sh
clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.crash

When no match is found for the .crash, point the user to a directory
where those can be found. Example:

clang-4.0: note: diagnostic msg: Crash backtrace is located in
clang-4.0: note: diagnostic msg: /Users/bruno/Library/Logs/DiagnosticReports/clang-4.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-4.0: note: diagnostic msg: (choose the .crash file that corresponds to your crash)

rdar://problem/27286266

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

7 years agoFixes for r287241. Use placement new. Apply clang-format.
Malcolm Parsons [Thu, 17 Nov 2016 21:00:09 +0000 (21:00 +0000)]
Fixes for r287241. Use placement new. Apply clang-format.

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

7 years agoObjC Module: try to make objc module deterministic.
Manman Ren [Thu, 17 Nov 2016 18:41:18 +0000 (18:41 +0000)]
ObjC Module: try to make objc module deterministic.

Make sure that comparing selectors in DeclarationName does its job.
rdar://problem/28988750

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

7 years agoUse unique_ptr for cached tokens for default arguments in C++.
Malcolm Parsons [Thu, 17 Nov 2016 17:52:58 +0000 (17:52 +0000)]
Use unique_ptr for cached tokens for default arguments in C++.

Summary:
This changes pointers to cached tokens for default arguments in C++ from raw pointers to unique_ptrs.  There was a fixme in the code where the cached tokens are created  about using a smart pointer.

The change is straightforward, though I did have to track down and fix a memory corruption caused by the change.  memcpy was being used to copy parameter information.  This duplicated the unique_ptr, which led to the cached token buffer being deleted prematurely.

Patch by David Tarditi!

Reviewers: malcolm.parsons

Subscribers: arphaman, malcolm.parsons, cfe-commits

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

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

7 years agoSema: correct typo correction for ivars in @implementation
Saleem Abdulrasool [Thu, 17 Nov 2016 17:10:54 +0000 (17:10 +0000)]
Sema: correct typo correction for ivars in @implementation

The previous typo correction handling assumed that ivars are only declared in
the interface declaration rather than as a private ivar in the implementation.
Adjust the handling to permit both interfaces.  Assert earlier that the
interface has been acquired to ensure that we can identify when both possible
casts have failed.

Addresses PR31040!

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

7 years agoLink include-fixer into libclang if clang-tools-extra is checked out.
Benjamin Kramer [Thu, 17 Nov 2016 15:22:36 +0000 (15:22 +0000)]
Link include-fixer into libclang if clang-tools-extra is checked out.

include-fixer only slightly bloats the size of libclang, but since
libclang has no explicit plugin mechanism it's the only way of getting
this to work. Clang-tidy is already there and so far there weren't many
complaints ;)

This is designed to be easy to remove again if libclang ever grows
proper plugin support.

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

7 years ago[OPENMP] Fixed codegen for 'omp cancel' construct.
Alexey Bataev [Thu, 17 Nov 2016 15:12:05 +0000 (15:12 +0000)]
[OPENMP] Fixed codegen for 'omp cancel' construct.

If 'omp cancel' construct is used in a worksharing construct it may
cause hanging of the software in case if reduction clause is used. Patch fixes this problem by avoiding extra reduction processing for branches that were canceled.

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

7 years agoRemove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
Richard Smith [Thu, 17 Nov 2016 02:16:09 +0000 (02:16 +0000)]
Remove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
is completely irrelevant, producing (effectively) false positives, and -Wmost
is used pretty widely. We should somehow turn it back on by default when
targeting the MS ABI, however, since it indicates the program will not do as
intended in those cases.

(Or perhaps we should just treat enum bitfields as having the signedness of the
enum, even when targeting the MS ABI...)

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

7 years ago[Sema] Fix a bug in enable_if condition instantiation.
George Burgess IV [Thu, 17 Nov 2016 01:33:54 +0000 (01:33 +0000)]
[Sema] Fix a bug in enable_if condition instantiation.

During template instantiation, we currently fall back to just calling
Sema::SubstExpr for enable_if attributes that aren't value-dependent or
type-dependent. Since Sema::SubstExpr strips off any implicit casts
we've added to an expression, it's possible that this behavior will
leave us with an enable_if condition that's just a DeclRefExpr.
Conditions like that deeply confuse Sema::CheckEnableIf.

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

7 years agoExplicitly specify that ubsan-vtable-checks is x86-64.
Ivan Krasin [Thu, 17 Nov 2016 01:09:04 +0000 (01:09 +0000)]
Explicitly specify that ubsan-vtable-checks is x86-64.

This should fix a failure on PowerPC introduced by r287181.

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

7 years agoInsert a type check before reading vtable.
Ivan Krasin [Thu, 17 Nov 2016 00:39:48 +0000 (00:39 +0000)]
Insert a type check before reading vtable.

Summary:
this is to prevent a situation when a pointer is invalid or null,
but we get to reading from vtable before we can check that
(possibly causing a segfault without a good diagnostics).

Reviewers: pcc

Subscribers: cfe-commits

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

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

7 years ago[CMake] Support lld with LTO bootstrap
Petr Hosek [Wed, 16 Nov 2016 23:59:06 +0000 (23:59 +0000)]
[CMake] Support lld with LTO bootstrap

lld has LTO support, if requested we should add a dependency on lld
rather than LLVMgold when doing LTO bootstrap build.

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

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

7 years agoAdd warning when assigning enums to bitfields without an explicit unsigned underlying...
Reid Kleckner [Wed, 16 Nov 2016 23:40:00 +0000 (23:40 +0000)]
Add warning when assigning enums to bitfields without an explicit unsigned underlying type

Summary:
Add a warning when assigning enums to bitfields without an explicit
unsigned underlying type. This is to prevent problems with MSVC
compatibility, since the Microsoft ABI defaults to storing enums with a
signed type, causing inconsistencies with saving to/reading from
bitfields.

Also disabled the warning in the dr0xx.cpp test which throws the error,
and added a test for the warning.

The warning can be disabled with -Wno-signed-enum-bitfield.

Patch by Sasha Bermeister!

Reviewers: rnk, aaron.ballman

Subscribers: mehdi_amini, aaron.ballman, cfe-commits, thakis, dcheng

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

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

7 years ago[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback
Anna Zaks [Wed, 16 Nov 2016 22:59:01 +0000 (22:59 +0000)]
[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback

Remove the check::RegionChanges::wantsRegionChangeUpdate callback as it is no
longer used (since checkPointerEscape has been added).

A patch by Krzysztof Wiśniewski!

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

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

7 years agoUse the member function location in enable_if diagnostics.
George Burgess IV [Wed, 16 Nov 2016 21:31:25 +0000 (21:31 +0000)]
Use the member function location in enable_if diagnostics.

Before:
<stdin>:3:3: error: no matching member function for call to 'bar'
  Foo().bar();
  ^

After:
<stdin>:3:9: error: no matching member function for call to 'bar'
  Foo().bar();
        ^

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

7 years agoRelax testcase.
Adrian Prantl [Wed, 16 Nov 2016 19:31:44 +0000 (19:31 +0000)]
Relax testcase.
This removes checks that are irrelevant for what is being tested.

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

7 years agoAdd the missing FileCheck invocation to this testcase.
Adrian Prantl [Wed, 16 Nov 2016 19:26:11 +0000 (19:26 +0000)]
Add the missing FileCheck invocation to this testcase.

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

7 years agoRangify for loops, NFC.
Yaron Keren [Wed, 16 Nov 2016 19:24:10 +0000 (19:24 +0000)]
Rangify for loops, NFC.

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

7 years agoFix PR31029 by attaching an artificial debug location to msabi thunks.
Adrian Prantl [Wed, 16 Nov 2016 18:49:47 +0000 (18:49 +0000)]
Fix PR31029 by attaching an artificial debug location to msabi thunks.
This was a latent bug that was recently uncovered by r286400.

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

7 years agoFixed layout of test/ASTMerge.
Sean Callanan [Wed, 16 Nov 2016 18:21:00 +0000 (18:21 +0000)]
Fixed layout of test/ASTMerge.

As outlined in a previous RFC, the test/ASTMerge/Inputs folder is getting full and the tests are starting to become interdependent. This is undesirable because

- it makes it harder to write new tests
- it makes it harder to figure out at a glance what old tests are doing, and
- it adds the risk of breaking one test while changing a different one, because of the interdependencies.

To fix this, according to the conversation in the RFC, I have changed the layout from

a.c
Inputs/a1.c
Inputs/a2.c

to

a/test.c
a/Inputs/a1.c
a/Inputs/a2.c
for all existing tests. I have also eliminated interdependencies by replicating the input files for each test that uses them.

https://reviews.llvm.org/D26571

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

7 years ago[Frontend] Allow attaching an external sema source to compiler instance and extra...
Benjamin Kramer [Wed, 16 Nov 2016 18:15:26 +0000 (18:15 +0000)]
[Frontend] Allow attaching an external sema source to compiler instance and extra diags to TypoCorrections

This can be used to append alternative typo corrections to an existing diag.
include-fixer can use it to suggest includes to be added.

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

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

7 years agotarget-data test update for TCE and TCELE
Pekka Jaaskelainen [Wed, 16 Nov 2016 16:21:59 +0000 (16:21 +0000)]
target-data test update for TCE and TCELE

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

7 years agoRemove duplicate condition (PR30648). NFCI.
Simon Pilgrim [Wed, 16 Nov 2016 16:11:08 +0000 (16:11 +0000)]
Remove duplicate condition (PR30648). NFCI.

We only need to check that the bitstream entry is a Record.

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

7 years agoAdd a little endian variant of TCE.
Pekka Jaaskelainen [Wed, 16 Nov 2016 15:22:31 +0000 (15:22 +0000)]
Add a little endian variant of TCE.

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

7 years ago[www] Fix spelling error in checker release notes.
Devin Coughlin [Wed, 16 Nov 2016 14:23:41 +0000 (14:23 +0000)]
[www] Fix spelling error in checker release notes.

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

7 years agoRangify for loop, NFC.
Yaron Keren [Wed, 16 Nov 2016 13:45:34 +0000 (13:45 +0000)]
Rangify for loop, NFC.

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

7 years ago[OpenCL] Use the semantic spelling of the Access attribute, rather than a string.
Joey Gouly [Wed, 16 Nov 2016 11:34:09 +0000 (11:34 +0000)]
[OpenCL] Use the semantic spelling of the Access attribute, rather than a string.

Also fix a latent bug, due to an incorrect traversal of the AttributeList.

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

7 years ago[X86][AVX512] Replace lossless i32/u32 to f64 conversion intrinsics with generic IR
Simon Pilgrim [Wed, 16 Nov 2016 09:27:40 +0000 (09:27 +0000)]
[X86][AVX512] Replace lossless i32/u32 to f64 conversion intrinsics with generic IR

Both the (V)CVTDQ2PD (i32 to f64) and (V)CVTUDQ2PD (u32 to f64) conversion instructions are lossless and can be safely represented as generic __builtin_convertvector calls instead of x86 intrinsics without affecting final codegen.

This patch removes the clang builtins and their use in the headers - a future patch will deal with removing the llvm intrinsics.

This is an extension patch to D20528 which dealt with the equivalent sse/avx cases.

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

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

7 years agoImprove handling of __FUNCTION__ and other predefined expression for Objective-C...
Mehdi Amini [Wed, 16 Nov 2016 07:07:28 +0000 (07:07 +0000)]
Improve handling of __FUNCTION__ and other predefined expression for Objective-C Blocks

Instead of always displaying the mangled name, try to do better
and get something closer to regular functions.

Recommit r287039 (that was reverted in r287039) with a tweak to
be more generic, and test fixes!

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

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

7 years ago[Driver] Infer the correct option to ld64 for -fembed-bitcode
Steven Wu [Wed, 16 Nov 2016 06:06:44 +0000 (06:06 +0000)]
[Driver] Infer the correct option to ld64 for -fembed-bitcode

Summary:
-fembed-bitcode infers -bitcode_bundle to ld64 but it is not correctly
passed when using LTO. LTO is a special case of -fembed-bitcode which
it doesn't require embed the bitcode in a special section in the object
file but it requires linker to save that as part of the final executable.

rdar://problem/29274226

Reviewers: mehdi_amini

Subscribers: cfe-commits

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

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

7 years agoRevert "[OPENMP] Fixed codegen for 'omp cancel' construct."
Vitaly Buka [Wed, 16 Nov 2016 01:01:22 +0000 (01:01 +0000)]
Revert "[OPENMP] Fixed codegen for 'omp cancel' construct."

Summary:
r286944 introduced bugs detected by ASAN as use-after-return.
r287025 have not fixed them completely.

This reverts commit r286944 and r287025.

Reviewers: ABataev

Subscribers: cfe-commits

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

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

7 years agoOutline evaluation of calls to builtins to avoid inflating stack usage for the
Richard Smith [Wed, 16 Nov 2016 00:57:23 +0000 (00:57 +0000)]
Outline evaluation of calls to builtins to avoid inflating stack usage for the
common case of a call to a non-builtin, particularly for unoptimized ASan
builds (where the per-variable stack usage can be quite high).

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

7 years ago[www] Update analyzer website for release of checker-279
Devin Coughlin [Wed, 16 Nov 2016 00:47:56 +0000 (00:47 +0000)]
[www] Update analyzer website for release of checker-279

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

7 years agoPR23281: Fix implementation of DR1891 to implement the intent: that is, a
Richard Smith [Wed, 16 Nov 2016 00:03:24 +0000 (00:03 +0000)]
PR23281: Fix implementation of DR1891 to implement the intent: that is, a
lambda-expression does not have a move-assignment operator.

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

7 years ago[analyzer] NumberObjectConversion: Workaround for a linker error with modules.
Artem Dergachev [Tue, 15 Nov 2016 22:22:57 +0000 (22:22 +0000)]
[analyzer] NumberObjectConversion: Workaround for a linker error with modules.

A combination of C++ modules, variadic functions with more than one argument,
and const globals in headers (all three being necessary) causes some releases
of clang to misplace the matcher objects, which causes the linker to fail.

No functional change - the extra allOf() matcher is no-op here.

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

7 years agoRevert "Improve handling of __FUNCTION__ and other predefined expression for Objectiv...
Mehdi Amini [Tue, 15 Nov 2016 22:19:50 +0000 (22:19 +0000)]
Revert "Improve handling of __FUNCTION__ and other predefined expression for Objective-C Blocks"

This reverts commit r287039, tests are broken.

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

7 years agoImprove handling of __FUNCTION__ and other predefined expression for Objective-C...
Mehdi Amini [Tue, 15 Nov 2016 21:47:11 +0000 (21:47 +0000)]
Improve handling of __FUNCTION__ and other predefined expression for Objective-C Blocks

Instead of always displaying the mangled name, try to do better
and get something closer to regular functions.

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

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

7 years ago[AArch64] Add driver tests for Qualcomm's Falkor CPU.
Chad Rosier [Tue, 15 Nov 2016 21:34:31 +0000 (21:34 +0000)]
[AArch64] Add driver tests for Qualcomm's Falkor CPU.

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

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

7 years ago[OPENMP] Fix stack use after delete, NFC.
Alexey Bataev [Tue, 15 Nov 2016 20:57:18 +0000 (20:57 +0000)]
[OPENMP] Fix stack use after delete, NFC.

Fixed possible use of stack variable after deletion.

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

7 years ago[libclang] Generalize clang_getNumTemplateArguments and clang_getTemplateArgumentAsTy...
Argyrios Kyrtzidis [Tue, 15 Nov 2016 20:51:46 +0000 (20:51 +0000)]
[libclang] Generalize clang_getNumTemplateArguments and clang_getTemplateArgumentAsType to other kind of specializations.

Patch by Emilio Cobos Álvarez!
https://reviews.llvm.org/D26663

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

7 years agoAdd comments on how to print error retuned by tooling::Replacements::add().
Eric Liu [Tue, 15 Nov 2016 19:05:40 +0000 (19:05 +0000)]
Add comments on how to print error retuned by tooling::Replacements::add().

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

7 years ago[AMDGPU] Add wave barrier builtin
Stanislav Mekhanoshin [Tue, 15 Nov 2016 18:58:03 +0000 (18:58 +0000)]
[AMDGPU] Add wave barrier builtin

The wave barrier represents the discardable barrier. Its main purpose is to
carry convergent attribute, thus preventing illegal CFG optimizations. All lanes
in a wave come to convergence point simultaneously with SIMT, thus no special
instruction is needed in the ISA. The barrier is discarded during code generation.

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

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

7 years ago[Modules] Replace arrays with init lists.
Benjamin Kramer [Tue, 15 Nov 2016 18:56:39 +0000 (18:56 +0000)]
[Modules] Replace arrays with init lists.

Thi way the compiler can pick the optimal storage duration. It's also
more readable. No functional change intended.

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

7 years ago[analyzer] Add check for when block is called with too few arguments.
Devin Coughlin [Tue, 15 Nov 2016 18:40:46 +0000 (18:40 +0000)]
[analyzer] Add check for when block is called with too few arguments.

The CallAndMessageChecker has an existing check for when a function pointer
is called with too few arguments. Extend this logic to handle the block
case, as well. While we're at it, do a drive-by grammar correction
("less" --> "fewer") on the diagnostic text.

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

7 years agoFixed spelling in comments. NFCI.
Simon Pilgrim [Tue, 15 Nov 2016 18:28:07 +0000 (18:28 +0000)]
Fixed spelling in comments. NFCI.

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

7 years agovector load store with length (left justified) clang portion
Zaara Syeda [Tue, 15 Nov 2016 18:04:13 +0000 (18:04 +0000)]
vector load store with length (left justified) clang portion

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

7 years agotest commmit
Zaara Syeda [Tue, 15 Nov 2016 15:57:33 +0000 (15:57 +0000)]
test commmit

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

7 years ago[clang-format] Fixed line merging of more than two lines
Cameron Desrochers [Tue, 15 Nov 2016 15:07:07 +0000 (15:07 +0000)]
[clang-format] Fixed line merging of more than two lines

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

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

7 years ago[PowerPC] Implement BE VSX load/store builtins - clang portion.
Tony Jiang [Tue, 15 Nov 2016 14:30:56 +0000 (14:30 +0000)]
[PowerPC] Implement BE VSX load/store builtins - clang portion.

This patch implements all the overloads for vec_xl_be and vec_xst_be. On BE,
they behaves exactly the same with vec_xl and vec_xst, therefore they are
simply implemented by defining a matching macro. On LE, they are implemented
by defining new builtins and intrinsics. For int/float/long long/double, it
is just a load (lxvw4x/lxvd2x) or store(stxvw4x/stxvd2x). For char/char/short,
we also need some extra shuffling before or after call the builtins to get the
desired BE order. For int128, simply call vec_xl or vec_xst.

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

7 years ago[OPENMP] Fix for PR30632: Name mangling issue.
Alexey Bataev [Tue, 15 Nov 2016 13:15:20 +0000 (13:15 +0000)]
[OPENMP] Fix for PR30632: Name mangling issue.

Reworked fix after comments from Richard Smith. We must skip all
CapturedDecl-based contexts when trying to get correct mangling number
context.

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

7 years ago[test] Correctly include build llvm_shlib_dir in stand-alone builds
Michal Gorny [Tue, 15 Nov 2016 12:54:10 +0000 (12:54 +0000)]
[test] Correctly include build llvm_shlib_dir in stand-alone builds

Add the build llvm_shlib_dir into LD_LIBRARY_PATH before the directory
specified as llvm_libs_dir, in order to fix stand-alone builds
attempting to use installed clang libraries.

In case of stand-alone builds llvm_libs_dir specifies the location of
installed LLVM libraries which can also contain an older version
(previous build) of clang libraries. Therefore, ensure to specify
llvm_shlib_dir (which is always the build tree path) before
the potentially-system llvm_libs_dir.

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

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

7 years ago[OPENMP] Fixed codegen for 'omp cancel' construct.
Alexey Bataev [Tue, 15 Nov 2016 09:11:50 +0000 (09:11 +0000)]
[OPENMP] Fixed codegen for 'omp cancel' construct.

If 'omp cancel' construct is used in a worksharing construct it may cause
hanging of the software in case if reduction clause is used. Patch fixes
this problem by avoiding extra reduction processing for branches that
were canceled.

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

7 years ago[analyzer] Rename assumeWithinInclusiveRange*()
Dominic Chen [Tue, 15 Nov 2016 01:54:41 +0000 (01:54 +0000)]
[analyzer] Rename assumeWithinInclusiveRange*()

Summary: The name is slightly confusing, since the constraint is not necessarily within the range unless `Assumption` is true. Split out renaming for ConstraintManager.h from D26061

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Minor optimization: avoid setting state if unchanged
Dominic Chen [Tue, 15 Nov 2016 01:40:58 +0000 (01:40 +0000)]
[analyzer] Minor optimization: avoid setting state if unchanged

Summary: Split out optimization from D26061

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Fix crash in NullabilityChecker calling block with too few arguments
Devin Coughlin [Mon, 14 Nov 2016 22:46:02 +0000 (22:46 +0000)]
[analyzer] Fix crash in NullabilityChecker calling block with too few arguments

Fix a crash when checking parameter nullability on a block invocation
with fewer arguments than the block declaration requires.

rdar://problem/29237566

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

7 years ago[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET when building compiler-rt from...
Kuba Brecka [Mon, 14 Nov 2016 22:38:57 +0000 (22:38 +0000)]
[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET when building compiler-rt from clang/runtime/CMakeLists.txt

This breaks some Swift builds, because Swift's build scripts explicitly set CMAKE_OSX_DEPLOYMENT_TARGET. This however isn't propagated to the compiler-rt build, causing build errors.

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

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

7 years ago[PPC] altivec.h functions for converting half precision to single precision.
Sean Fertile [Mon, 14 Nov 2016 18:47:15 +0000 (18:47 +0000)]
[PPC] altivec.h functions for converting half precision to single precision.

Adds 2 vector functions for converting from a vector of unsigned short to a
vector of float. One converts the low 4 halfwords and one converts the high
4 halfwords.

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

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

7 years agoFix OpenCL test for buildbot by removing extra (erroneous) RUN line
Anastasia Stulova [Mon, 14 Nov 2016 18:11:09 +0000 (18:11 +0000)]
Fix OpenCL test for buildbot by removing extra (erroneous) RUN line

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

7 years ago[OpenCL] Fix for integer parameters of enqueue_kernel
Anastasia Stulova [Mon, 14 Nov 2016 17:39:58 +0000 (17:39 +0000)]
[OpenCL] Fix for integer parameters of enqueue_kernel

Make handling integer parameters more flexible:

- For the number of events argument allow to pass larger
integers than 32 bits as soon as compiler can prove that
the range fits in 32 bits. If not, the diagnostic will be given.

- Change type of the arguments specifying the sizes of
the corresponding block arguments to be size_t.

Review: https://reviews.llvm.org/D26509

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

7 years ago[clang docs] Minor fix in ClangCheck.rst
Mandeep Singh Grang [Mon, 14 Nov 2016 17:31:24 +0000 (17:31 +0000)]
[clang docs] Minor fix in ClangCheck.rst

Reviewers: djasper, rengolin

Subscribers: Eugene.Zelenko

Tags: #clang-c

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

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

7 years agoFix the unit test darwin-multiarch-arm.c for windows
Sumanth Gundapaneni [Mon, 14 Nov 2016 17:09:39 +0000 (17:09 +0000)]
Fix the unit test darwin-multiarch-arm.c for windows

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

7 years ago[OpenCL] Change to clk_event parameter in enqueue_kernel.
Anastasia Stulova [Mon, 14 Nov 2016 15:34:01 +0000 (15:34 +0000)]
[OpenCL] Change to clk_event parameter in enqueue_kernel.

- Accept NULL pointer as a valid parameter value for clk_event.
- Generate clk_event_t arguments of internal
__enqueue_kernel_XXX function as pointers in generic address space.

Review: https://reviews.llvm.org/D26507

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

7 years ago[PPC] add extract sig/exp test data class for vec float and vec double.
Sean Fertile [Mon, 14 Nov 2016 14:43:27 +0000 (14:43 +0000)]
[PPC] add extract sig/exp test data class for vec float and vec double.

 Add vector extract exponent/significand functions to altivec.h, as well as
 functions (and related constants) to test the data class of vector float
 and vector double.

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

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

7 years agoFix r286819 (accidentally patched multiple times.
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:14:38 +0000 (13:14 +0000)]
Fix r286819 (accidentally patched multiple times.

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

7 years ago[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:08:30 +0000 (13:08 +0000)]
[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD

It doesn't make sense to use the target's address space ids in this context as
this is metadata that should be referring to the "logical" OpenCL address spaces.
For flat AS machines like all "CPUs" in general, the logical AS info gets lost as
there's only one address space (0).

This commit changes the logic such that we always use the SPIR address space
ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo()
and the other detection needs.

https://reviews.llvm.org/D26157

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

7 years agoRevert "Improve handling of floating point literals in OpenCL to only use double...
Renato Golin [Mon, 14 Nov 2016 12:19:18 +0000 (12:19 +0000)]
Revert "Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64."

This reverts commit r286815, as it broke all ARM and AArch64 bots.

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

7 years agoImprove handling of floating point literals in OpenCL to only use double precision...
Neil Hickey [Mon, 14 Nov 2016 11:15:51 +0000 (11:15 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.

This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.

Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.

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

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

7 years agoRemove some false positives when taking the address of packed members
Roger Ferrer Ibanez [Mon, 14 Nov 2016 08:53:27 +0000 (08:53 +0000)]
Remove some false positives when taking the address of packed members

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

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

7 years agoAdd explicit (void) cast to result of unique_ptr::release()
Eric Fiselier [Mon, 14 Nov 2016 07:03:50 +0000 (07:03 +0000)]
Add explicit (void) cast to result of unique_ptr::release()

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

7 years ago[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builti...
Craig Topper [Sun, 13 Nov 2016 07:26:34 +0000 (07:26 +0000)]
[AVX-512] Replace masked dword and qword variable shift builtins with unmasked builtins and a select.

This is part of a set of changes to allow InstCombine in the backend to optimize variable shifts without having to know about masking.

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

7 years ago[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier...
Craig Topper [Sun, 13 Nov 2016 07:26:31 +0000 (07:26 +0000)]
[X86] Remove extra escaped new lines in intrinsic headers left over from an earlier conversion away from a macro. NFC

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

7 years agoBitcode: Change module reader functions to return an llvm::Expected.
Peter Collingbourne [Sun, 13 Nov 2016 07:00:17 +0000 (07:00 +0000)]
Bitcode: Change module reader functions to return an llvm::Expected.

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

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

7 years agoFix PR28366: Handle variables from enclosing local scopes more gracefully during...
Faisal Vali [Sun, 13 Nov 2016 06:09:16 +0000 (06:09 +0000)]
Fix PR28366: Handle variables from enclosing local scopes more gracefully during constant expression evaluation.

Only look for a variable's value in the constant expression evaluation activation frame, if the variable was indeed declared in that frame, otherwise it might be a constant expression and be usable within a nested local scope or emit an error.

void f(char c) {
  struct X {
    static constexpr char f() {
      return c; // error gracefully here as opposed to crashing.
    }
  };
  int I = X::f();
}

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

7 years ago[AMDGPU] Add f16 builtin functions (VI+)
Konstantin Zhuravlyov [Sun, 13 Nov 2016 02:37:05 +0000 (02:37 +0000)]
[AMDGPU] Add f16 builtin functions (VI+)

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

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

7 years ago[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.
Craig Topper [Sun, 13 Nov 2016 00:35:01 +0000 (00:35 +0000)]
[AVX-512] Add returns to shift intrinsics that converted from macros in r286714.

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

7 years agoRevert r286735 due to test failure
Brad Smith [Sun, 13 Nov 2016 00:16:21 +0000 (00:16 +0000)]
Revert r286735 due to test failure

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

7 years agoLink static PIE programs against rcrt0.o on OpenBSD
Brad Smith [Sat, 12 Nov 2016 23:52:03 +0000 (23:52 +0000)]
Link static PIE programs against rcrt0.o on OpenBSD

Patch by Stefan Kempf.

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

7 years ago[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask...
Craig Topper [Sat, 12 Nov 2016 23:24:34 +0000 (23:24 +0000)]
[AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting the mask argument of a vfmadd intrinsic.

Summary: Inverting the mask argument does not reflect the intended semantics of the intrinsic.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

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

7 years agoUse descriptive message if list initializer is incorrectly parenthesized.
Serge Pavlov [Sat, 12 Nov 2016 15:38:55 +0000 (15:38 +0000)]
Use descriptive message if list initializer is incorrectly parenthesized.

If initializer contains parentheses around braced list where it is not allowed,
as in construct int({0}), clang issued message like `functional-style cast
from 'void' to 'int' is not allowed`, which does not help much. Both gcc and
msvc issue message `list-initializer for non-class type must not be
parenthesized`, which is more descriptive. This change implements similar
message for clang.

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

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

7 years agoAs we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8
Sylvestre Ledru [Sat, 12 Nov 2016 10:38:18 +0000 (10:38 +0000)]
As we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8

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

7 years agoAdd the new option -Og in the release notes. See r286602 for more information
Sylvestre Ledru [Sat, 12 Nov 2016 10:37:17 +0000 (10:37 +0000)]
Add the new option -Og in the release notes. See r286602 for more information

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

7 years agoAdd support of the next Ubuntu (17.04 - Zesty Zapus)
Sylvestre Ledru [Sat, 12 Nov 2016 09:26:30 +0000 (09:26 +0000)]
Add support of the next Ubuntu (17.04 - Zesty Zapus)

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

7 years agoclang-format: Support ObjC selectors with unnamed parameters.
Daniel Jasper [Sat, 12 Nov 2016 07:38:22 +0000 (07:38 +0000)]
clang-format: Support ObjC selectors with unnamed parameters.

This fixes llvm.org/PR28063.

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

7 years ago[AVX-512] Convert the rest of the masked shift by immediate and by single element...
Craig Topper [Sat, 12 Nov 2016 07:16:59 +0000 (07:16 +0000)]
[AVX-512] Convert the rest of the masked shift by immediate and by single element builtins over to the newly added unmasked builtins and a select.

This should also fix PR30691 since the new builtins are handled like the legacy builtins in the backend.

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

7 years ago[analyzer] Update 'Automated' to 'Automatic' from r286694.
Devin Coughlin [Sat, 12 Nov 2016 01:50:04 +0000 (01:50 +0000)]
[analyzer] Update 'Automated' to 'Automatic' from r286694.

ARC is 'Automatic Reference Counting' and not 'Automated Reference Counting'.

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

7 years ago[c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.
Richard Smith [Sat, 12 Nov 2016 01:39:56 +0000 (01:39 +0000)]
[c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.

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

7 years ago[analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.
Devin Coughlin [Sat, 12 Nov 2016 01:23:01 +0000 (01:23 +0000)]
[analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.

The name of the NullableReturnedFromNonnullChecker in Checkers.td
was accidentally "NullablePassedToNonnull", which made it impossible
to explicitly turn the checker on.

rdar://problem/28354459

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