]> granicus.if.org Git - clang/log
clang
7 years ago[Frontend] Add a predefined macro that describes the Objective-C bool type
Alex Lorenz [Mon, 21 Nov 2016 11:05:15 +0000 (11:05 +0000)]
[Frontend] Add a predefined macro that describes the Objective-C bool type

This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes
the Objective-C boolean type: its value is zero if the Objective-C boolean uses
the signed character type, otherwise its value is one as the Objective-C boolean
uses the builtin boolean type.

rdar://21170440

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

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

7 years ago[XRay] Support AArch64 in Clang
Dean Michael Berris [Mon, 21 Nov 2016 03:24:59 +0000 (03:24 +0000)]
[XRay] Support AArch64 in Clang

This patch adds XRay support in Clang for AArch64 target.
This patch is one of a series:

LLVM: https://reviews.llvm.org/D26412
compiler-rt: https://reviews.llvm.org/D26413

Author: rSerge

Reviewers: rengolin, dberris

Subscribers: aemerson, cfe-commits, iid_iunknown

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

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

7 years agoAdd doxygen comments to immintrin.h's intrinsics.
Ekaterina Romanova [Sun, 20 Nov 2016 08:35:05 +0000 (08:35 +0000)]
Add doxygen comments to immintrin.h's intrinsics.

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

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

7 years ago[CMake] Fixing clang standalone build
Chris Bieneman [Sat, 19 Nov 2016 21:14:59 +0000 (21:14 +0000)]
[CMake] Fixing clang standalone build

I broke this in r287406 and r287407.

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

7 years agoRemove alignment from ctors/dtors lists in an attempt to placate LTO.
John McCall [Sat, 19 Nov 2016 20:12:25 +0000 (20:12 +0000)]
Remove alignment from ctors/dtors lists in an attempt to placate LTO.

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

7 years agoChange setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
Mehdi Amini [Sat, 19 Nov 2016 18:19:41 +0000 (18:19 +0000)]
Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)

Summary:
This makes it explicit that ownership is taken. Also replace all `new`
with make_unique<> at call sites.

Reviewers: anemet

Subscribers: llvm-commits

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

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

7 years agoIntroduce a helper class for building complex constant initializers. NFC.
John McCall [Sat, 19 Nov 2016 08:17:24 +0000 (08:17 +0000)]
Introduce a helper class for building complex constant initializers.  NFC.

I've adopted this in most of the places it makes sense, but v-tables
and CGObjCMac will need a second pass.

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

7 years agoDoxygen comments for avxintrin.h.
Ekaterina Romanova [Sat, 19 Nov 2016 04:59:08 +0000 (04:59 +0000)]
Doxygen comments for avxintrin.h.

Added doxygen comments to avxintrin.h's intrinsics. As of now, all the intrinsics in this file that were documented by Sony's intrinsics guide should have corresponding doxygen comments.

Note: The doxygen comments are automatically generated based on Sony's intrinsic
s document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

Reviewed by Wolfgang Pieb.

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

7 years agoSema: As of MSVC 2015, a user-declared move operation causes the deletion of both...
Peter Collingbourne [Sat, 19 Nov 2016 00:30:56 +0000 (00:30 +0000)]
Sema: As of MSVC 2015, a user-declared move operation causes the deletion of both copy operations.

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

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

7 years ago[Sema] Don't allow applying address-of operator to a call to a function
Akira Hatanaka [Sat, 19 Nov 2016 00:13:03 +0000 (00:13 +0000)]
[Sema] Don't allow applying address-of operator to a call to a function
with __unknown_anytype return type.

When the following code is compiled, Sema infers that the type of
__unknown_anytype is double:

extern __unknown_anytype func();
double *d = (double*)&func();

This triggers an assert in CodeGenFunction::EmitCallExprLValue because
it doesn't expect to see a call to a function with a non-reference
scalar return type.

This commit prevents the assert by making VisitUnaryAddrOf error out if
the address-of operator is applied to a call to a function with
__unknown_anytype return type.

rdar://problem/20287610

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

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

7 years ago[CMake] clang depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:16 +0000 (23:31 +0000)]
[CMake] clang depends on intrinsics_gen

cc1_main.cpp has the following include chain:

llvm/LinkAllPasses.h
llvm/Analysis/AliasSetTracker.h
llvm/Analysis/AliasAnalysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang needs to depend on intrinsics_gen.

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

7 years ago[CMake] clang-offload-bundler depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:14 +0000 (23:31 +0000)]
[CMake] clang-offload-bundler depends on intrinsics_gen

ClangOffloadBundler.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang-offload-bundler needs to depend on intrinsics_gen.

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

7 years ago[AMDGPU] Change frexp.exp builtin to return i16 for f16 input
Konstantin Zhuravlyov [Fri, 18 Nov 2016 22:31:51 +0000 (22:31 +0000)]
[AMDGPU] Change frexp.exp builtin to return i16 for f16 input

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

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

7 years ago[analyzer] Refactor recursive symbol reachability check to use symbol_iterator
Dominic Chen [Fri, 18 Nov 2016 21:07:03 +0000 (21:07 +0000)]
[analyzer] Refactor recursive symbol reachability check to use symbol_iterator

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

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

7 years ago[ARM] Fix sema check of ARM special register names
Oleg Ranevskyy [Fri, 18 Nov 2016 21:00:08 +0000 (21:00 +0000)]
[ARM] Fix sema check of ARM special register names

Summary:
This is a simple sema check patch for arguments of `__builtin_arm_rsr` and the related builtins, which currently do not allow special registers with indexes >7.

Some of the possible register name formats these builtins accept are:
```
{c}p<coprocessor>:<op1>:c<CRn>:c<CRm>:<op2>
```
```
o0:op1:CRn:CRm:op2
```
where `op1` / `op2` are integers in the range [0, 7] and `CRn` / `CRm` are integers in the range [0, 15].

The current sema check does not allow `CRn` > 7 and accepts `op2` up to 15.

Reviewers: LukeCheeseman, rengolin

Subscribers: asl, aemerson, rengolin, cfe-commits

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

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

7 years agoAdapt to llvm NamedRegionTimer changes
Matthias Braun [Fri, 18 Nov 2016 19:43:25 +0000 (19:43 +0000)]
Adapt to llvm NamedRegionTimer changes

We have to specify a name and description for the timers and groups now.

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

7 years ago[CMake] Fixing variable names that were mistyped
Chris Bieneman [Fri, 18 Nov 2016 19:20:39 +0000 (19:20 +0000)]
[CMake] Fixing variable names that were mistyped

This is a silly bug that I'm sure I caused...

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

7 years agoLTO support for -fsave-optimization-record on Darwin
Adam Nemet [Fri, 18 Nov 2016 18:17:36 +0000 (18:17 +0000)]
LTO support for -fsave-optimization-record on Darwin

I guess this would have to be added for each linker.

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

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

7 years agoFix a comment for -fsave-optimization-record
Adam Nemet [Fri, 18 Nov 2016 18:17:33 +0000 (18:17 +0000)]
Fix a comment for -fsave-optimization-record

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

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

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