]> granicus.if.org Git - clang/log
clang
8 years ago[Xray] Don't generate output for xray tests
Benjamin Kramer [Thu, 27 Oct 2016 08:49:18 +0000 (08:49 +0000)]
[Xray] Don't generate output for xray tests

Patch by Sam McCall!

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

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

8 years agoMark invalid RecordDecls as completed.
Erik Verbruggen [Thu, 27 Oct 2016 08:37:14 +0000 (08:37 +0000)]
Mark invalid RecordDecls as completed.

Sema::ActOnTag creates TagDecls for records. However, if those record
declarations are invalid, and the parser is in C++ mode, it would
silently drop the TagDecl (and leave it as "beingDefined"). The problem
is that other code (e.g. the ASTWriter) will serialize all types, and
expects them to be complete. So, leaving them open would result in
failing asserts.

Fixes PR20320

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

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

8 years ago[coroutines] Build fallthrough and set_exception statements.
Eric Fiselier [Thu, 27 Oct 2016 07:30:31 +0000 (07:30 +0000)]
[coroutines] Build fallthrough and set_exception statements.

Summary:
This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::current_exception())` call for handling uncaught exceptions.

The fall-through statement is built and checked according to:
> [dcl.fct.def.coroutine]/4
> The unqualified-ids return_void and return_value are looked up in the scope of class P. If
> both are found, the program is ill-formed. If the unqualified-id return_void is found, flowing
> off the end of a coroutine is equivalent to a co_return with no operand. Otherwise, flowing off
> the end of a coroutine results in undefined behavior.

Similarly the `set_exception` call is only built when that unqualified-id is found in the scope of class P.

Additionally this patch adds fall-through warnings for non-void returning coroutines. Since it's surprising undefined behavior I thought it would be important to add the warning right away.

Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

8 years ago[PPC] add vector byte reverse functions to altivec.h
Nemanja Ivanovic [Thu, 27 Oct 2016 06:23:57 +0000 (06:23 +0000)]
[PPC] add vector byte reverse functions to altivec.h

This patch corresponds to review https://reviews.llvm.org/D25915.
Committing on behalf of Sean Fertile.

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

8 years ago[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is...
Dean Michael Berris [Thu, 27 Oct 2016 04:56:14 +0000 (04:56 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed

Summary:
Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Reviewers: rsmith, aaron.ballman, rnk, dberris

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

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

8 years agoRemove check for -o option in offloading actions builder.
Samuel Antao [Thu, 27 Oct 2016 01:08:58 +0000 (01:08 +0000)]
Remove check for -o option in offloading actions builder.

This check is also present when jobs are built, so the offloading builder check is not needed anymore.

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

8 years agoFix bug when compiling CUDA code with -emit-llvm and -o.
Samuel Antao [Thu, 27 Oct 2016 00:53:34 +0000 (00:53 +0000)]
Fix bug when compiling CUDA code with -emit-llvm and -o.

In this case the device code is not injected into an host action and therefore the
user should get an error as -o can't be used when generating two outputs.

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

8 years agoRefactor call emission to package the function pointer together with
John McCall [Wed, 26 Oct 2016 23:46:34 +0000 (23:46 +0000)]
Refactor call emission to package the function pointer together with
abstract information about the callee.  NFC.

The goal here is to make it easier to recognize indirect calls and
trigger additional logic in certain cases.  That logic will come in
a later patch; in the meantime, I felt that this was a significant
improvement to the code.

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

8 years agoUnconditionally pass `-lto_library` to the linker on Darwin
Mehdi Amini [Wed, 26 Oct 2016 23:23:08 +0000 (23:23 +0000)]
Unconditionally pass `-lto_library` to the linker on Darwin

We're only doing it with -flto currently, however it never "hurt"
to pass it, and users that are linking without -flto can get in
trouble if one of the dependency (a static library for instance)
contains bitcode.

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

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

8 years ago[analyzer] Report CFNumberGetValue API misuse
Anna Zaks [Wed, 26 Oct 2016 22:51:47 +0000 (22:51 +0000)]
[analyzer] Report CFNumberGetValue API misuse

This patch contains 2 improvements to the CFNumber checker:
 - Checking of CFNumberGetValue misuse.
 - Treating all CFNumber API misuse errors as non-fatal. (Previously we treated errors that could cause uninitialized memory as syncs and the truncation errors as non-fatal.)

This implements a subset of functionality from https://reviews.llvm.org/D17954.

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

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

8 years ago[CUDA] Move device placement new definitions into a wrapper header.
Justin Lebar [Wed, 26 Oct 2016 22:13:26 +0000 (22:13 +0000)]
[CUDA] Move device placement new definitions into a wrapper header.

Previously, these were always included -- after this change, you have to
 #include <new>, which is consistent with how things ought to work.

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

8 years ago[CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma...
Justin Lebar [Wed, 26 Oct 2016 22:13:20 +0000 (22:13 +0000)]
[CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma once.

This is consistent with the rest of our internal headers.

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

8 years ago[RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr
Malcolm Parsons [Wed, 26 Oct 2016 20:39:54 +0000 (20:39 +0000)]
[RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr

Summary:
The matcher
varDecl(hasDescendant(
    callExpr(hasDeclaration(functionDecl(unless(isNoThrow()))))))
didn't match calls from default arguments because the expression
for a CXXDefaultArgExpr was not visited.

Reviewers: klimek, jdennett, alexfh, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years ago[PowerPC] Implement vector_insert_exp builtins - clang portion
Nemanja Ivanovic [Wed, 26 Oct 2016 19:27:11 +0000 (19:27 +0000)]
[PowerPC] Implement vector_insert_exp builtins - clang portion

This patch corresponds to review https://reviews.llvm.org/D25956.
Committing on behalf of Zaara Syeda.

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

8 years ago[PPC] Implement vector reverse elements builtins (vec_reve)
Nemanja Ivanovic [Wed, 26 Oct 2016 18:25:45 +0000 (18:25 +0000)]
[PPC] Implement vector reverse elements builtins (vec_reve)

This patch corresponds to review https://reviews.llvm.org/D25906.
Committing on behalf of Tony Jiang.

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

8 years agoAMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.
Yaxun Liu [Wed, 26 Oct 2016 16:40:21 +0000 (16:40 +0000)]
AMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.

Patch by Laurent Morichetti.

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

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

8 years ago[CMake] Adding example distribution CMake cache files
Chris Bieneman [Wed, 26 Oct 2016 15:41:38 +0000 (15:41 +0000)]
[CMake] Adding example distribution CMake cache files

These cache file are provided as an example of how to set up simple multi-stage CMake builds. I have a batch of documentation updates for LLVM.org which reference these files.

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

8 years ago[PP] Replace some index based for loops with range based ones
Erik Verbruggen [Wed, 26 Oct 2016 13:06:13 +0000 (13:06 +0000)]
[PP] Replace some index based for loops with range based ones

While in the area, also change some unsigned variables to size_t, and
introduce an LLVM_FALLTHROUGH instead of a comment stating that.

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

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

8 years agoFix use-after-scope in ASTContext.
Benjamin Kramer [Wed, 26 Oct 2016 12:51:45 +0000 (12:51 +0000)]
Fix use-after-scope in ASTContext.

Extend lifetime of ExceptionTypeStorage, as it is referenced by
CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an
ArrayRef)

Patch by Sam McCall!

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

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

8 years ago[PP] Remove another unused parameter
Erik Verbruggen [Wed, 26 Oct 2016 11:46:10 +0000 (11:46 +0000)]
[PP] Remove another unused parameter

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

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

8 years ago[modules] PR28812: Modules can return duplicate field decls.
Vassil Vassilev [Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)]
[modules] PR28812: Modules can return duplicate field decls.

If two modules contain duplicate class definitions the lookup result can contain
more than 2 elements. Sift the lookup results until we find a field decl.

It is not necessary to do ODR checks in place as they done elsewhere.

This should fix issues when compiling with libstdc++ 5.2 and 6.2.

Patch developed in collaboration with Richard Smith!

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

8 years ago[PP] Replace some uses of unsigned with size_t
Erik Verbruggen [Wed, 26 Oct 2016 09:58:31 +0000 (09:58 +0000)]
[PP] Replace some uses of unsigned with size_t

All values are returned by a method as size_t, and subsequently passed
to functions taking a size_t, or used where a size_t is also valid.
Better still, two loops (which had an unsigned), can be replaced by
a range-based for loop.

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

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

8 years agoPP: Remove unused parameters from methods
Erik Verbruggen [Wed, 26 Oct 2016 08:52:41 +0000 (08:52 +0000)]
PP: Remove unused parameters from methods

NFC

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

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

8 years agoBug 28065 - clang-format incorrectly aligns backslash.
Andi-Bogdan Postelnicu [Wed, 26 Oct 2016 07:44:51 +0000 (07:44 +0000)]
Bug 28065 - clang-format incorrectly aligns backslash.

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

8 years ago[CodeGen] Don't emit lifetime intrinsics for some local variables
Vitaly Buka [Wed, 26 Oct 2016 05:42:30 +0000 (05:42 +0000)]
[CodeGen] Don't emit lifetime intrinsics for some local variables

Summary:
Current generation of lifetime intrinsics does not handle cases like:

```
  {
    char x;
  l1:
    bar(&x, 1);
  }
  goto l1;

```
We will get code like this:

```
  %x = alloca i8, align 1
  call void @llvm.lifetime.start(i64 1, i8* nonnull %x)
  br label %l1
l1:
  %call = call i32 @bar(i8* nonnull %x, i32 1)
  call void @llvm.lifetime.end(i64 1, i8* nonnull %x)
  br label %l1
```

So the second time bar was called for x which is marked as dead.
Lifetime markers here are misleading so it's better to remove them at all.
This type of bypasses are rare, e.g. code detects just 8 functions building
clang (2329 targets).

PR28267

Reviewers: eugenis

Subscribers: beanz, mgorny, cfe-commits

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

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

8 years ago[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.
Craig Topper [Wed, 26 Oct 2016 05:35:38 +0000 (05:35 +0000)]
[AVX-512] Fix the operand order for all calls to __builtin_ia32_vfmaddss3_mask.

Summary: The preserved input should be the first argument and the vector inputs should be in the same order as the intrinsics it is used to implement.

Reviewers: igorb, delena

Subscribers: cfe-commits

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

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

8 years agoUse printf instead of "echo -ne".
Rui Ueyama [Wed, 26 Oct 2016 03:38:48 +0000 (03:38 +0000)]
Use printf instead of "echo -ne".

Not all echo commands support "-e".

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

8 years ago[modules] Fix assert if multiple update records provide a definition for a
Richard Smith [Wed, 26 Oct 2016 02:31:56 +0000 (02:31 +0000)]
[modules] Fix assert if multiple update records provide a definition for a
class template specialization and that specialization has attributes.

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

8 years ago[Sema] Handle CaseStmt and DefaultStmt as SwitchCase
Vitaly Buka [Wed, 26 Oct 2016 02:00:00 +0000 (02:00 +0000)]
[Sema] Handle CaseStmt and DefaultStmt as SwitchCase

Summary: rsmith

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

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

8 years ago[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place
Vitaly Buka [Wed, 26 Oct 2016 01:59:57 +0000 (01:59 +0000)]
[CodeGen] Move shouldEmitLifetimeMarkers into more convenient place

Summary: D24693 will need access to it from other places

Reviewers: eugenis

Subscribers: cfe-commits

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

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

8 years ago[cxx_status] update comment
Richard Smith [Wed, 26 Oct 2016 01:37:36 +0000 (01:37 +0000)]
[cxx_status] update comment

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

8 years agoTreat module headers wrapped by our builtin headers as implicitly being textual
Richard Smith [Wed, 26 Oct 2016 01:08:55 +0000 (01:08 +0000)]
Treat module headers wrapped by our builtin headers as implicitly being textual
headers. We previously got this check backwards and treated the wrapper header
as being textual.

This is important because our wrapper headers sometimes inject macros into the
system headers that they #include_next, and sometimes replace them entirely.

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

8 years agoImplement name mangling proposal for exception specifications from cxx-abi-dev 2016...
Richard Smith [Wed, 26 Oct 2016 01:05:54 +0000 (01:05 +0000)]
Implement name mangling proposal for exception specifications from cxx-abi-dev 2016-10-11.

This has the following ABI impact:

 1) Functions whose parameter or return types are non-throwing function pointer
    types have different manglings in c++1z mode from prior modes. This is
    necessary because c++1z permits overloading on the noexceptness of function
    pointer parameter types. A warning is issued for cases that will change
    manglings in c++1z mode.

 2) Functions whose parameter or return types contain instantiation-dependent
    exception specifications change manglings in all modes. This is necessary
    to support overloading on / SFINAE in these exception specifications, which
    a careful reading of the standard indicates has essentially always been
    permitted.

Note that, in order to be affected by these changes, the code in question must
specify an exception specification on a function pointer/reference type that is
written syntactically within the declaration of another function. Such
declarations are very rare, and I have so far been unable to find any code
that would be affected by this. (Note that such things will probably become
more common in C++17, since it's a lot easier to get a noexcept function type
as a function parameter / return type there.)

This change does not affect the set of symbols produced by a build of clang,
libc++, or libc++abi.

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

8 years ago[Myriad] add empty file to simulated bin dir
Douglas Katzman [Tue, 25 Oct 2016 23:59:11 +0000 (23:59 +0000)]
[Myriad] add empty file to simulated bin dir

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

8 years ago[Myriad] Find libc++ adjacent to libstdc++
Douglas Katzman [Tue, 25 Oct 2016 23:02:30 +0000 (23:02 +0000)]
[Myriad] Find libc++ adjacent to libstdc++

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

8 years ago[codeview] emit debug info for indirect virtual base classes
Bob Haarman [Tue, 25 Oct 2016 22:19:32 +0000 (22:19 +0000)]
[codeview] emit debug info for indirect virtual base classes

Summary:
Fixes PR28281.

MSVC lists indirect virtual base classes in the field list of a class.
This change makes Clang emit the information necessary for LLVM to
emit such records.

Reviewers: rnk, ruiu, zturner

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

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

8 years agoUse linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.
Stephen Hines [Tue, 25 Oct 2016 21:44:35 +0000 (21:44 +0000)]
Use linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.

Summary:
This is only forced on if there is no non-Cortex-A53 CPU specified as
well. Android's platform and NDK builds need to assume that the code can
be run on Cortex-A53 devices, so we always enable the fix unless we know
specifically that the code is only running on a different kind of CPU.

Reviewers: cfe-commits

Subscribers: aemerson, rengolin, tberghammer, pirama, danalbert

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

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

8 years agoCodeGen: be more conservative about setting section
Saleem Abdulrasool [Tue, 25 Oct 2016 21:43:28 +0000 (21:43 +0000)]
CodeGen: be more conservative about setting section

The section names currently are MachO specific.  Only set the section on the
variables if the file format is MachO.

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

8 years ago[OpenCL] Add missing atom_xor for 64 bit to opencl-c.h
Yaxun Liu [Tue, 25 Oct 2016 21:37:05 +0000 (21:37 +0000)]
[OpenCL] Add missing atom_xor for 64 bit to opencl-c.h

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

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

8 years ago[index] Fixes for locations and relations in Objective C categories and getters/setters
Argyrios Kyrtzidis [Tue, 25 Oct 2016 21:11:22 +0000 (21:11 +0000)]
[index] Fixes for locations and relations in Objective C categories and getters/setters

- Add entries for protocols on categories
- Add relation between categories and class they extend
- Add relation between getters/setters and their corresponding property
- Use category name location as the location of category decls/defs if it has one

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

8 years agoReapply r284265: "[Sema] Refactor context checking for availability diagnostics"
Erik Pilkington [Tue, 25 Oct 2016 19:05:50 +0000 (19:05 +0000)]
Reapply r284265: "[Sema] Refactor context checking for availability diagnostics"

The problem with the original commit was that some of Apple's headers depended
on an incorrect behaviour, this commit adds a temporary workaround until those
headers are fixed.

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

8 years ago[Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older
Michal Gorny [Tue, 25 Oct 2016 15:33:32 +0000 (15:33 +0000)]
[Driver] Disable OpenSUSE rules for OpenSUSE/SLES 10 and older

Disable the OpenSUSE rules for OpenSUSE versions older than 11 as they
are incompatible with the old binutils on that distribution.

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

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

8 years ago[Driver] Support obtaining active toolchain from gcc-config on Gentoo
Michal Gorny [Tue, 25 Oct 2016 15:07:41 +0000 (15:07 +0000)]
[Driver] Support obtaining active toolchain from gcc-config on Gentoo

Support using gcc-config to determine the correct GCC toolchain location
on Gentoo. In order to do that, attempt to read gcc-config configuration
form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is
provided.

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

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

8 years agoCodeGen: mark protocols as common data
Saleem Abdulrasool [Tue, 25 Oct 2016 14:50:44 +0000 (14:50 +0000)]
CodeGen: mark protocols as common data

This allows for the coalescing of the protocol declarations.  When the protocols
are declared in headers, multiple definitions of the protocol would be emitted.
Marking them as common data indicates that any one can be selected.

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

8 years agoFix MSVC unused variable warning.
Simon Pilgrim [Tue, 25 Oct 2016 12:59:15 +0000 (12:59 +0000)]
Fix MSVC unused variable warning.

LLVM_ATTRIBUTE_UNUSED doesn't work for non-gcc style compilers.

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

8 years agoRe-apply patch r279045.
Kelvin Li [Tue, 25 Oct 2016 12:50:55 +0000 (12:50 +0000)]
Re-apply patch r279045.

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

8 years agoFix diagnostic format string for err_os_log_argument_to_big
Benjamin Kramer [Tue, 25 Oct 2016 12:39:28 +0000 (12:39 +0000)]
Fix diagnostic format string for err_os_log_argument_to_big

Patch by Sam McCall, test case by me.

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

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

8 years agoInclude full filename range for missing includes
Erik Verbruggen [Tue, 25 Oct 2016 10:13:10 +0000 (10:13 +0000)]
Include full filename range for missing includes

For the purpose of highlighting in an IDE.

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

8 years agoFix 'unknown documentation command' warning ranges
Erik Verbruggen [Tue, 25 Oct 2016 10:06:11 +0000 (10:06 +0000)]
Fix 'unknown documentation command' warning ranges

Warnings generated by -Wdocumentation-unknown-command did only have a
start location, not a full source range. This resulted in only the
"carret" being show in messages, and IDEs highlighting only the single
initial character.

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

8 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Tue, 25 Oct 2016 07:56:04 +0000 (07:56 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed after LGTM and check-all

Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.

Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.

Reviwer: 1. igorb
         2. craig.topper
Differential Revision: https://reviews.llvm.org/D25527

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

8 years agoFix handling of %% format specifier in os_log builtins.
Mehdi Amini [Tue, 25 Oct 2016 00:48:48 +0000 (00:48 +0000)]
Fix handling of %% format specifier in os_log builtins.

Returning `false` was stopping the parsing of further arguments,
which wasn't intended.

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

8 years agoAdd dependency from clangCodeGen to clangAnalysis
Mehdi Amini [Mon, 24 Oct 2016 23:38:32 +0000 (23:38 +0000)]
Add dependency from clangCodeGen to clangAnalysis

This is unbreaking the build with shared library after r285019.

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

8 years agotest/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp
Mehdi Amini [Mon, 24 Oct 2016 23:38:24 +0000 (23:38 +0000)]
test/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp

Unadvertently removed in r285019

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

8 years ago[Basic] Support 32-bit x86 and ARM targets for Fuchsia
Petr Hosek [Mon, 24 Oct 2016 22:55:57 +0000 (22:55 +0000)]
[Basic] Support 32-bit x86 and ARM targets for Fuchsia

Fuchsia has experimental support for 32-bit x86 and ARM targets, add
them to the list of supported targets.

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

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

8 years agoLink clangCodeGen with clangAnalysis required after r284990.
Artem Belevich [Mon, 24 Oct 2016 22:52:39 +0000 (22:52 +0000)]
Link clangCodeGen with clangAnalysis required after r284990.

Fixes build break for configurations that use shared libraries.

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

8 years ago[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
Akira Hatanaka [Mon, 24 Oct 2016 21:45:54 +0000 (21:45 +0000)]
[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

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

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

8 years agoCodeGen: remove incorrect temporary Twine
Saleem Abdulrasool [Mon, 24 Oct 2016 21:25:57 +0000 (21:25 +0000)]
CodeGen: remove incorrect temporary Twine

Twines should not be stack allocated.  This somehow managed to get past me.

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

8 years agoFix test on non-X86 platforms
Mehdi Amini [Mon, 24 Oct 2016 21:22:01 +0000 (21:22 +0000)]
Fix test on non-X86 platforms

This is a fixup for r285019, adding an `#ifdef __x86_64__` since
the os_log builtin is platform specific.

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

8 years agoCodeGen: centralise label construction for method lists
Saleem Abdulrasool [Mon, 24 Oct 2016 20:47:58 +0000 (20:47 +0000)]
CodeGen: centralise label construction for method lists

Move all the label construction for the various method list emission into
EmitMethodList.  Rather than have all the names be constructed in pieces in all
of the callers of EmitMethodList, have this occur in one site.  This also makes
the calls much easier to understand as we simplify identify the type of the
method list being emitted and the interface name for which it is being emitted.
NFC.

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

8 years agoFix bug where one of the cases where we mangle a <bare-unresolved-name> failed
Richard Smith [Mon, 24 Oct 2016 20:47:04 +0000 (20:47 +0000)]
Fix bug where one of the cases where we mangle a <bare-unresolved-name> failed
to emit the <template-args> portion. Refactor so that mangleUnresolvedName
actually emits the entire <unresolved-name>, so this mistake is harder to make
again.

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

8 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 20:39:34 +0000 (20:39 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

This reverts commit r285007 and reapply r284990, with a fix for the
opencl test that I broke. Original commit message follows:

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

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

8 years agoFix mangling of implicit calls to operator-> to only include a single "pt",
Richard Smith [Mon, 24 Oct 2016 20:29:40 +0000 (20:29 +0000)]
Fix mangling of implicit calls to operator-> to only include a single "pt",
rather than including an extra one for each level of 'operator->()' invoked.

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

8 years agoRevert "Add support for __builtin_os_log_format[_buffer_size]"
Mehdi Amini [Mon, 24 Oct 2016 19:41:36 +0000 (19:41 +0000)]
Revert "Add support for __builtin_os_log_format[_buffer_size]"

This reverts commit r284990, two opencl test are broken

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

8 years ago[clang] Remove redundant --check-prefix=CHECK from tests
Mandeep Singh Grang [Mon, 24 Oct 2016 18:53:43 +0000 (18:53 +0000)]
[clang] Remove redundant --check-prefix=CHECK from tests

Reviewers: mkuper, rengolin, hans

Subscribers: cfe-commits

Tags: #clang-c

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

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

8 years ago[analyzer] Use unsigned integers to rely on well-defined overflow semantics.
Artem Dergachev [Mon, 24 Oct 2016 18:49:04 +0000 (18:49 +0000)]
[analyzer] Use unsigned integers to rely on well-defined overflow semantics.

Found by the UBSan buildbot.

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

8 years agoFix crash if StmtProfile finds a type-dependent member access for which we have
Richard Smith [Mon, 24 Oct 2016 18:47:04 +0000 (18:47 +0000)]
Fix crash if StmtProfile finds a type-dependent member access for which we have
resolved the -> to a call to a specific operator-> function. The particular
test case added here is actually being mishandled: the implicit member access
should not be type-dependent (because it's accessing a non-type-dependent
member of the current instantiation), but calls to a type-dependent operator->
that is a member of the current instantiation would be liable to hit the same
codepath.

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

8 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 16:56:23 +0000 (16:56 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

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

8 years agoFix clang-format vim integration issue with non-ascii characters
Alexander Kornienko [Mon, 24 Oct 2016 16:31:26 +0000 (16:31 +0000)]
Fix clang-format vim integration issue with non-ascii characters

clang-format.py currently seems to treat vim.current.buf as ascii-encoded data,
which leads to an UnicodeDecodeError when trying to format any text containing
non-ascii characters:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../tools/clang/tools/clang-format/clang-format.py", line 110, in <module>
    main()
  File ".../tools/clang/tools/clang-format/clang-format.py", line 87, in main
    stdout, stderr = p.communicate(input=text.encode(encoding))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3996: ordinal not in range(128)

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

8 years ago[analyzer] Fix an ARM buildbot after r284960.
Artem Dergachev [Mon, 24 Oct 2016 12:54:27 +0000 (12:54 +0000)]
[analyzer] Fix an ARM buildbot after r284960.

I guess we should always specify triples in all analyzer tests, regardless.

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

8 years agorevert r284963
Michael Zuckerman [Mon, 24 Oct 2016 11:30:23 +0000 (11:30 +0000)]
revert r284963

because new test file is failing in some OS.
test/CodeGen/avx512-reduceIntrin.c

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

8 years agoAdjust for TimePoint interface change in llvm: D25730. NFC
Pavel Labath [Mon, 24 Oct 2016 10:59:13 +0000 (10:59 +0000)]
Adjust for TimePoint interface change in llvm: D25730. NFC

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

8 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Mon, 24 Oct 2016 10:53:20 +0000 (10:53 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed after LGTM and check-all

Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.

Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.

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

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

8 years ago[Sema] Formatting warnings should see through Objective-C message sends
Alex Lorenz [Mon, 24 Oct 2016 09:42:34 +0000 (09:42 +0000)]
[Sema] Formatting warnings should see through Objective-C message sends

This commit improves the '-Wformat' warnings by ensuring that the formatting
checker can see through Objective-C message sends when we are calling an
Objective-C method with an appropriate format_arg attribute.

rdar://23622446

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

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

8 years ago[analyzer] Add StdLibraryFunctions checker.
Artem Dergachev [Mon, 24 Oct 2016 09:41:38 +0000 (09:41 +0000)]
[analyzer] Add StdLibraryFunctions checker.

This checker does not emit reports, however it influences the analysis
by providing complete summaries for, or otherwise improving modeling of,
various standard library functions.

This should reduce the number of infeasible paths explored during analysis.
The custom function summary format used in this checker is superior to
body farms by causing less unnecessary state splits,
which would result in better analysis performance.

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

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

8 years ago[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
Alex Lorenz [Mon, 24 Oct 2016 09:33:32 +0000 (09:33 +0000)]
[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
has no field declaration.

This commit fixes an invalid Winitializer-overrides warning that's shown
when analyzing a second (or any after the first) instantiation of a designated
initializer. This invalid warning is fixed by making sure that a
DesignatedInitExpr is rebuilt by the tree transformer when it has a field
designator whose FieldDecl* hasn't been yet initialized. This ensures that a
different DesignatedInitExpr is processed by Sema for every instantiation, and
thus the invalid warning is avoided.

rdar://28768441

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

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

8 years agoFix myriad test with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 24 Oct 2016 08:04:17 +0000 (08:04 +0000)]
Fix myriad test with CLANG_DEFAULT_CXX_STDLIB

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

8 years ago[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native...
Craig Topper [Mon, 24 Oct 2016 04:04:24 +0000 (04:04 +0000)]
[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native IR like we do for 128/256-bit, but with the addition of masking.

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

8 years ago[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with...
Craig Topper [Sun, 23 Oct 2016 23:57:30 +0000 (23:57 +0000)]
[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with selects and the older unmasked builtins.

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

8 years agoRemove LLVM_CONSTEXPR.
Justin Lebar [Sun, 23 Oct 2016 19:39:16 +0000 (19:39 +0000)]
Remove LLVM_CONSTEXPR.

Summary: With MSVC 2013 and GCC < 4.8 gone, we can use the "constexpr" keyword.

Reviewers: bkramer, mehdi_amini

Subscribers: llvm-commits

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

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

8 years ago[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.
Craig Topper [Sun, 23 Oct 2016 07:35:47 +0000 (07:35 +0000)]
[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.

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

8 years ago[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects...
Craig Topper [Sun, 23 Oct 2016 07:35:39 +0000 (07:35 +0000)]
[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects and the older unmasked builtins.

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

8 years agoAdd more doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Sun, 23 Oct 2016 07:30:50 +0000 (07:30 +0000)]
Add more doxygen comments to emmintrin.h's intrinsics.

With this patch, all intrinsics in this file (with an exception of a handful of a recently added ones) will be documented. I will send out a patch for 4 missining intrisics later.

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 Yunzhong Gao.

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

8 years agoFix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
Richard Smith [Sun, 23 Oct 2016 04:53:03 +0000 (04:53 +0000)]
Fix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
different lambda-sigs, so they should have different counters.

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

8 years ago[clang] Limit clang test to ARM and AArch64 only
Mandeep Singh Grang [Sun, 23 Oct 2016 00:53:03 +0000 (00:53 +0000)]
[clang] Limit clang test to ARM and AArch64 only

Summary: Limit clang/test/Frontend/gnu-mcount.c to ARM and AArch64 only.

Reviewers: abdulras, honggyu.kim, rengolin

Subscribers: aemerson, rengolin, cfe-commits

Tags: #clang-c

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

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

8 years ago[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older...
Craig Topper [Sat, 22 Oct 2016 21:24:56 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older unmasked builtins.

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

8 years ago[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and...
Craig Topper [Sat, 22 Oct 2016 21:24:52 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and older unmasked builtins.

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

8 years ago[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.
Craig Topper [Sat, 22 Oct 2016 21:24:48 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.

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

8 years ago[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests...
Craig Topper [Sat, 22 Oct 2016 21:24:44 +0000 (21:24 +0000)]
[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests already exist in the avx512vl test and represent avx512vl instructions.

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

8 years ago[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:42 +0000 (21:24 +0000)]
[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the older unmaksed builtins.

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

8 years ago[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:38 +0000 (21:24 +0000)]
[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the older non-masked versions instead.

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

8 years ago[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.
Craig Topper [Sat, 22 Oct 2016 21:24:34 +0000 (21:24 +0000)]
[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.

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

8 years ago[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in...
Craig Topper [Sat, 22 Oct 2016 18:32:33 +0000 (18:32 +0000)]
[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in the header file with the older unmasked versions instead.

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

8 years agoMark P0012R1 as "Partial" since it's now substantially complete.
Richard Smith [Sat, 22 Oct 2016 01:35:34 +0000 (01:35 +0000)]
Mark P0012R1 as "Partial" since it's now substantially complete.

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

8 years agoAdd another testcase missed from r284905.
Richard Smith [Sat, 22 Oct 2016 01:32:45 +0000 (01:32 +0000)]
Add another testcase missed from r284905.

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

8 years ago[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
Richard Smith [Sat, 22 Oct 2016 01:32:19 +0000 (01:32 +0000)]
[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
mismatched dynamic exception specifications in expressions from an error to a
warning, since this is no longer ill-formed in C++1z.

Allow reference binding of a reference-to-non-noexcept function to a noexcept
function lvalue. As defect resolutions, also allow a conditional between
noexcept and non-noexcept function lvalues to produce a non-noexcept function
lvalue (rather than decaying to a function pointer), and allow function
template argument deduction to deduce a reference to non-noexcept function when
binding to a noexcept function type.

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

8 years agoModule: correctly set the module file kind when emitting file_modified.
Manman Ren [Fri, 21 Oct 2016 23:35:03 +0000 (23:35 +0000)]
Module: correctly set the module file kind when emitting file_modified.

rdar://28503343

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

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

8 years agoModule: improve the diagnostic message for include of non-modular header.
Manman Ren [Fri, 21 Oct 2016 23:27:37 +0000 (23:27 +0000)]
Module: improve the diagnostic message for include of non-modular header.

Emit the actual path to the non-modular include.

rdar://28897010

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

8 years agoRemove unnecessary distinction between Ref_Compatible and
Richard Smith [Fri, 21 Oct 2016 23:01:55 +0000 (23:01 +0000)]
Remove unnecessary distinction between Ref_Compatible and
Ref_Compatible_With_Added_Qualification. We always treated these two values the
same way.

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

8 years agoDR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
Richard Smith [Fri, 21 Oct 2016 22:00:42 +0000 (22:00 +0000)]
DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
This has two significant effects:

1) Direct relational comparisons between null pointer constants (0 and nullopt)
   and pointers are now ill-formed. This was always the case for C, and it
   appears that C++ only ever permitted by accident. For instance, cases like
     nullptr < &a
   are now rejected.

2) Comparisons and conditional operators between differently-cv-qualified
   pointer types now work, and produce a composite type that both source
   pointer types can convert to (when possible). For instance, comparison
   between 'int **' and 'const int **' is now valid, and uses an intermediate
   type of 'const int *const *'.

Clang previously supported #2 as an extension.

We do not accept the cases in #1 as an extension. I've tested a fair amount of
code to check that this doesn't break it, but if it turns out that someone is
relying on this, we can easily add it back as an extension.

This is a re-commit of r284800.

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

8 years agoSwitch SmallSetVector to use DenseSet when it overflows its inline space.
Justin Lebar [Fri, 21 Oct 2016 21:45:01 +0000 (21:45 +0000)]
Switch SmallSetVector to use DenseSet when it overflows its inline space.

Summary:
SetVector already used DenseSet, but SmallSetVector used std::set.  This
leads to surprising performance differences.  Moreover, it means that
the set of key types accepted by SetVector and SmallSetVector are
quite different!

In order to make this change, we had to convert some callsites that used
SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N>
instead.

Reviewers: timshen

Subscribers: llvm-commits

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

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