]> granicus.if.org Git - clang/log
clang
7 years agoclang/test/CodeGenOpenCL/convergent.cl: Satisfy -Asserts with "opt -instnamer".
NAKAMURA Takumi [Tue, 1 Nov 2016 20:08:17 +0000 (20:08 +0000)]
clang/test/CodeGenOpenCL/convergent.cl: Satisfy -Asserts with "opt -instnamer".

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

7 years ago[OpenCL] Mark group functions as convergent in opencl-c.h
Yaxun Liu [Tue, 1 Nov 2016 18:45:32 +0000 (18:45 +0000)]
[OpenCL] Mark group functions as convergent in opencl-c.h

Certain OpenCL builtin functions are supposed to be executed by all threads in a work group or sub group. Such functions should not be made divergent during transformation. It makes sense to mark them with convergent attribute.

The adding of convergent attribute is based on Ettore Speziale's work and the original proposal and patch can be found at https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg22271.html.

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

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

7 years ago[OpenCL] Override supported OpenCL extensions with -cl-ext option
Alexey Bader [Tue, 1 Nov 2016 15:50:52 +0000 (15:50 +0000)]
[OpenCL] Override supported OpenCL extensions with -cl-ext option

Summary:
This patch adds a command line option '-cl-ext' to control a set of
supported OpenCL extensions. Option accepts a comma-separated list
of extensions prefixed with '+' or '-'.

It can be used together with a target triple to override support for some
extensions:

  // spir target supports all extensions, but we want to disable fp64
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64

Special 'all' extension allows to enable or disable all possible
extensions:

  // only fp64 will be supported
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-all,+cl_khr_fp64

Patch by asavonic (Andrew Savonichev).

Reviewers: joey, yaxunl

Subscribers: yaxunl, bader, Anastasia, cfe-commits

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

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

7 years ago[PowerPC] Implement vector shift builtins - clang portion
Nemanja Ivanovic [Tue, 1 Nov 2016 14:46:20 +0000 (14:46 +0000)]
[PowerPC] Implement vector shift builtins - clang portion

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

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

7 years ago[x86][inline-asm][clang] accept 'v' constraint
Michael Zuckerman [Tue, 1 Nov 2016 13:16:44 +0000 (13:16 +0000)]
[x86][inline-asm][clang] accept 'v' constraint
Commit on behalf of: Coby Tayree

1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
LLVM patch: https://reviews.llvm.org/D25005

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

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

7 years ago[www] Fix a typo on the analyzer website
Alex Lorenz [Tue, 1 Nov 2016 11:12:41 +0000 (11:12 +0000)]
[www] Fix a typo on the analyzer website

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

7 years agoFix parenthesized assert (nfc).
Manuel Klimek [Tue, 1 Nov 2016 10:30:50 +0000 (10:30 +0000)]
Fix parenthesized assert (nfc).

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

7 years ago[PPC] Add vec_absd functions to altivec.h
Nemanja Ivanovic [Tue, 1 Nov 2016 08:39:56 +0000 (08:39 +0000)]
[PPC] Add vec_absd functions to altivec.h

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

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

7 years agoclang-format: Fix bug in function reference qualifier detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:19 +0000 (06:23 +0000)]
clang-format: Fix bug in function reference qualifier detection.

Before:
  template <typename T>
      void F(T) &&
      = delete;

After:
  template <typename T>
  void F(T) && = delete;

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

7 years agoclang-format: Fix incorrect pointer detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:14 +0000 (06:23 +0000)]
clang-format: Fix incorrect pointer detection.

Before:
  void f() { f(float{1}, a *a); }

After:
  void f() { f(float{1}, a * a); }

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

7 years agoclang-format: [JS] Fix incorrect space when "as" is used as identifier.
Daniel Jasper [Tue, 1 Nov 2016 06:23:10 +0000 (06:23 +0000)]
clang-format: [JS] Fix incorrect space when "as" is used as identifier.

Before:
  aaaaa.as ();

After:
  aaaaa.as();

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

7 years agoclang-format: Fix incorrect binary operator detection.
Daniel Jasper [Tue, 1 Nov 2016 06:23:05 +0000 (06:23 +0000)]
clang-format: Fix incorrect binary operator detection.

Before:
  int x = f(* + [] {});

After:
  int x = f(*+[] {});

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

7 years agoclang-format: [JS] Fix formatting of generator functions.
Daniel Jasper [Tue, 1 Nov 2016 06:22:59 +0000 (06:22 +0000)]
clang-format: [JS] Fix formatting of generator functions.

Before:
  var x = {
    a: function*
() {
  //
}
  }

After:
  var x = {
    a: function*() {
      //
    }
  }

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

7 years agoclang-format: [JS] Fix space when for is used as regular identifier.
Daniel Jasper [Tue, 1 Nov 2016 06:22:54 +0000 (06:22 +0000)]
clang-format: [JS] Fix space when for is used as regular identifier.

Before:
  x.for () = 1;

After:
  x.for() = 1;

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

7 years ago[AVX-512] Remove masked vector insert builtins and replace with native shufflevectors...
Craig Topper [Tue, 1 Nov 2016 05:47:56 +0000 (05:47 +0000)]
[AVX-512] Remove masked vector insert builtins and replace with native shufflevectors and selects.

Unfortunately, the backend currently doesn't fold masks into the instructions correctly when they come from these shufflevectors. I'll work on that in a future commit.

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

7 years ago[index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the...
Argyrios Kyrtzidis [Tue, 1 Nov 2016 04:29:39 +0000 (04:29 +0000)]
[index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the DesignatedInitExprs of the InitListExpr directly.

This is more efficient, as per feedback by Richard.

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

7 years agoImplement ABI proposal for throwing noexcept function pointers, per discussion
Richard Smith [Tue, 1 Nov 2016 01:34:46 +0000 (01:34 +0000)]
Implement ABI proposal for throwing noexcept function pointers, per discussion
on cxx-abi-dev (thread starting 2016-10-11). This is currently hidden behind a
cc1-only -m flag, pending discussion of how best to deal with language changes
that require use of new symbols from the ABI library.

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

7 years agop0012: Teach resolving address of overloaded function with dependent exception
Richard Smith [Tue, 1 Nov 2016 01:31:23 +0000 (01:31 +0000)]
p0012: Teach resolving address of overloaded function with dependent exception
specification to resolve the exception specification as part of the type check,
in C++1z onwards. This is not actually part of P0012 / CWG1330 rules for when
an exception specification is "needed", but is necessary for sanity.

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

7 years agoBitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.
Peter Collingbourne [Tue, 1 Nov 2016 01:18:57 +0000 (01:18 +0000)]
Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.

No block info block should need to define local abbreviations, so we can
always use a code width of 2.

Also change all block info block writers to use EnterBlockInfoBlock.

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

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

7 years ago[ReachableCode] Skip over ExprWithCleanups in isConfigurationValue
Tim Shen [Tue, 1 Nov 2016 00:19:04 +0000 (00:19 +0000)]
[ReachableCode] Skip over ExprWithCleanups in isConfigurationValue

Summary: Fixes pr29152.

Reviewers: rsmith, pirama, krememek

Subscribers: cfe-commits

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

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

7 years ago[modules] Mark deleted functions as implicitly inline to allow merging
Eric Fiselier [Mon, 31 Oct 2016 23:07:15 +0000 (23:07 +0000)]
[modules] Mark deleted functions as implicitly inline to allow  merging

Summary: When merging definitions with ModulesLocalVisibility enabled it's important to make deleted definitions implicitly inline, otherwise they'll be diagnosed as a redefinition.

Reviewers: silvas, manmanren, rsmith

Subscribers: cfe-commits

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

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

7 years ago[cfi] Fix missing !type annotation.
Evgeniy Stepanov [Mon, 31 Oct 2016 22:28:10 +0000 (22:28 +0000)]
[cfi] Fix missing !type annotation.

CFI (only in the cross-dso mode) fails to set !type annotations when
a function is used before it is defined.

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

7 years ago[index] Fix repeated visitation of the same InitListExpr for indexing.
Argyrios Kyrtzidis [Mon, 31 Oct 2016 22:12:12 +0000 (22:12 +0000)]
[index] Fix repeated visitation of the same InitListExpr for indexing.

It was visited multiple times unnecessarily.

rdar://28985038

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

7 years ago[ASTMatcher] Add CXXNewExpr support to hasDeclaration
Malcolm Parsons [Mon, 31 Oct 2016 22:04:07 +0000 (22:04 +0000)]
[ASTMatcher] Add CXXNewExpr support to hasDeclaration

Reviewers: sbenza, lukasza, aaron.ballman, klimek

Subscribers: lukasza, sbenza, cfe-commits

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

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

7 years agoA compound literal within a global lambda or block is still within
John McCall [Mon, 31 Oct 2016 21:56:26 +0000 (21:56 +0000)]
A compound literal within a global lambda or block is still within
the body of a function for the purposes of computing its storage
duration and deciding whether its initializer must be constant.

There are a number of problems in our current treatment of compound
literals.  C specifies that a compound literal yields an l-value
referring to an object with either static or automatic storage
duration, depending on where it was written; in the latter case,
the literal object has a lifetime tied to the enclosing scope (much
like an ObjC block), not the enclosing full-expression.  To get these
semantics fully correct in our current design, we would need to
collect compound literals on the ExprWithCleanups, just like we do
with ObjC blocks; we would probably also want to identify literals
like we do with materialized temporaries.  But it gets stranger;
GCC adds compound literals to C++ as an extension, but makes them
r-values, which are generally assumed to have temporary storage
duration.  Ignoring destructor ordering, the difference only matters
if the object's address escapes the full-expression, which for an
r-value can only happen with reference binding (which extends
temporaries) or array-to-pointer decay (which does not).  GCC then
attempts to lock down on array-to-pointer decay in ad hoc ways.
Arguably a far superior language solution for C++ (and perhaps even
array r-values in C, which can occur in other ways) would be to
propagate lifetime extension through array-to-pointer decay, so
that initializing a pointer object to a decayed r-value array
extends the lifetime of the complete object containing the array.
But this would be a major change in semantics which arguably ought
to be blessed by the committee(s).

Anyway, I'm not fixing any of that in this patch; I did try, but
it got out of hand.

Fixes rdar://28949016.

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

7 years ago[analyzer] Allow undefined values in performTrivialCopy.
Artem Dergachev [Mon, 31 Oct 2016 21:11:20 +0000 (21:11 +0000)]
[analyzer] Allow undefined values in performTrivialCopy.

Reading from a garbage pointer should be modeled as garbage,
and performTrivialCopy should be able to deal with any SVal input.

Patch by Ilya Palachev!

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

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

7 years ago[analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once.
Artem Dergachev [Mon, 31 Oct 2016 21:04:54 +0000 (21:04 +0000)]
[analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once.

The checker already warns for __block-storage variables being used as a
dispatch_once() predicate, however it refers to them as local which is not quite
accurate, so we fix that.

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

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

7 years agoAdd comment explaining this mysterious macro name.
Richard Smith [Mon, 31 Oct 2016 20:25:52 +0000 (20:25 +0000)]
Add comment explaining this mysterious macro name.

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

7 years agoDebugInfo: support for DW_TAG_atomic_type
Victor Leschuk [Mon, 31 Oct 2016 19:09:47 +0000 (19:09 +0000)]
DebugInfo: support for DW_TAG_atomic_type

Mark C11 _Atomic variables with DW_TAG_atomic_type tag.

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

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

7 years agoNFC - Reorder test case names in a PPC test case
Nemanja Ivanovic [Mon, 31 Oct 2016 19:02:54 +0000 (19:02 +0000)]
NFC - Reorder test case names in a PPC test case

A few recent commits have messed up the order of some tests
in a PPC test case. This just reorders them in a sensible way.

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

7 years agoFixing problem with CodeGen/avx512-kconstraints-att_inline_asm.c
Michael Zuckerman [Mon, 31 Oct 2016 18:40:17 +0000 (18:40 +0000)]
Fixing problem with CodeGen/avx512-kconstraints-att_inline_asm.c

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

7 years agoAdd a warning flag for warn_alloca_align_alignof
David Majnemer [Mon, 31 Oct 2016 18:23:02 +0000 (18:23 +0000)]
Add a warning flag for warn_alloca_align_alignof

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

7 years agoWhen diagnosing that a defaulted function is ill-formed because it would be
Richard Smith [Mon, 31 Oct 2016 18:18:29 +0000 (18:18 +0000)]
When diagnosing that a defaulted function is ill-formed because it would be
implicitly deleted and overrides a non-deleted function, explain why the
function is deleted. For PR30844.

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

7 years ago[Sema] Warn when alignof is used with __builtin_alloca_with_align
David Majnemer [Mon, 31 Oct 2016 18:07:57 +0000 (18:07 +0000)]
[Sema] Warn when alignof is used with __builtin_alloca_with_align

The second argument to __builtin_alloca_with_align is supposed to be in
bits, not bytes.  Using alignof there would be indicative of a bug.

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

7 years ago[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.
Artem Dergachev [Mon, 31 Oct 2016 17:27:26 +0000 (17:27 +0000)]
[analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.

Unlike global/static variables, calloc etc. functions that allocate ObjC
objects behave differently in terms of memory barriers, and hacks that make
dispatch_once as fast as it possibly could be start failing.

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

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

7 years ago[x86][inline-asm][AVX512][clang][PART-1] Introducing "k" and "Yk" constraints for...
Michael Zuckerman [Mon, 31 Oct 2016 17:23:52 +0000 (17:23 +0000)]
[x86][inline-asm][AVX512][clang][PART-1] Introducing "k" and "Yk" constraints for extended inline assembly, enabling use of AVX512 masked vectorized instructions.

Commit on behalf of mharoush

Extending inline assembly support, compatible with GCC as folowing:
 "k" constraint hints the compiler to select any of AVX512 k0-k7 registers.
 "Yk" constraint is a subset of "k" excluding k0 which is not allowd to be used as a mask.

Reviewer: 1. rnk

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

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

7 years agoUse toCharUnitsFromBits instead of TargetInfo::getCharWidth
David Majnemer [Mon, 31 Oct 2016 16:48:30 +0000 (16:48 +0000)]
Use toCharUnitsFromBits instead of TargetInfo::getCharWidth

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

7 years ago[x86][inline-asm] Add support for curly brackets escape using "%" in extended inline...
Michael Zuckerman [Mon, 31 Oct 2016 15:27:54 +0000 (15:27 +0000)]
[x86][inline-asm] Add support for curly brackets escape using "%" in extended inline asm.

Commit on behalf of mharoush

After LGTM and check all:

This patch is a compatibility fix for clang, matching GCC support for charter escape when using extended in-line assembly (i.e, "%{" ,"%}" --> "{" ,"}" ).
 It is meant to enable support for advanced features such as AVX512 conditional\masked vector instructions/broadcast assembly syntax.

Reviewer: 1. rnk

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

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

7 years ago[SystemZ] Add -march=archX aliases
Ulrich Weigand [Mon, 31 Oct 2016 14:38:05 +0000 (14:38 +0000)]
[SystemZ] Add -march=archX aliases

For compatibility with other compilers on the platform, allow specifying
levels of the z/Architecture instead of model names with -march.  In
particular, the following aliases are now supported:

  -march=arch8   equals  -march=z10
  -march=arch9   equals  -march=z196
  -march=arch10  equals  -march=zEC12
  -march=arch11  equals  -march=z13

This parallels the equivalent (and prerequisite) LLVM change in r285577.

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

7 years agosecond attempt at r285565.
Michael Zuckerman [Mon, 31 Oct 2016 14:16:57 +0000 (14:16 +0000)]
second attempt at r285565.

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

7 years agoSkip over AnnotatedLines with >50 levels of nesting; don't format them.
Daniel Jasper [Mon, 31 Oct 2016 13:23:00 +0000 (13:23 +0000)]
Skip over AnnotatedLines with >50 levels of nesting; don't format them.

Reasoning:
- ExpressionParser uses a lot of stack for these, bad in some environments.
- Our formatting algorithm is N^3 and gets really slow.
- The resulting formatting is unlikely to be any good.
- This is probably generated code we're formatting by accident.

We treat these as unparseable, and signal incomplete formatting. 50 is
an arbitrary number, I've only seen real problems from ~150 levels.

Patch by Sam McCall. Thank you.

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

7 years agoclang-format: [JS] Fix missing space after 'yield'.
Daniel Jasper [Mon, 31 Oct 2016 13:18:25 +0000 (13:18 +0000)]
clang-format: [JS] Fix missing space after 'yield'.

Before:
  class X {
    delete(val) {
      return null;
    }
    * gen() {
      yield[1, 2];
    }
    * gen() {
      yield{a: 1};
    }
  };

After:
  class X {
    delete(val) {
      return null;
    }
    * gen() {
      yield [1, 2];
    }
    * gen() {
      yield {a: 1};
    }
  };

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

7 years agorevert r285563 fail in test CodeGen/avx512-inline-asm-kregisters-basics.c
Michael Zuckerman [Mon, 31 Oct 2016 12:49:36 +0000 (12:49 +0000)]
revert r285563 fail in test CodeGen/avx512-inline-asm-kregisters-basics.c

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

7 years ago [x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage
Michael Zuckerman [Mon, 31 Oct 2016 12:05:41 +0000 (12:05 +0000)]
 [x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage

 Commit on behalf of mharoush

 After LGTM and check all:
 This patch enables usage of k registers in inline assembly syntax.
 Adding triple

 Reviewer: 1. rnk
           2. delena

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

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

7 years agoFix this test when we have clang-offload-bundler.exe.
Rafael Espindola [Mon, 31 Oct 2016 11:47:37 +0000 (11:47 +0000)]
Fix this test when we have clang-offload-bundler.exe.

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

7 years ago[OpenCL] Setting constant address space for array initializers
Alexey Bader [Mon, 31 Oct 2016 10:26:31 +0000 (10:26 +0000)]
[OpenCL] Setting constant address space for array initializers

Summary: Setting constant address space for global constants used for memcpy-initialization of arrays.

Patch by Alexey Sotkin.

Reviewers: bader, yaxunl, Anastasia

Subscribers: cfe-commits, AlexeySotkin

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

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

7 years agoRevert reviosion 285555
Michael Zuckerman [Mon, 31 Oct 2016 10:12:36 +0000 (10:12 +0000)]
Revert reviosion 285555

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

7 years ago[x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage
Michael Zuckerman [Mon, 31 Oct 2016 09:37:59 +0000 (09:37 +0000)]
[x86][inline-asm] Introducing (AVX512) k0-k7 registers for inline-asm usage

Commit on behalf of mharoush

After LGTM and check all:
This patch enables usage of k registers in inline assembly syntax.

Reviewer: 1. rnk
          2. delena

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

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

7 years ago[Modules] Add a command line option for loading the clang builtins modulemap.
Elad Cohen [Mon, 31 Oct 2016 08:21:54 +0000 (08:21 +0000)]
[Modules] Add a command line option for loading the clang builtins modulemap.

-fbuiltin-module-map loads the clang builtins modulemap file. (This is
equivalent to -fmodule-map-file=<resource dir>/include/module.modulemap)

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

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

7 years ago[AVX-512] Add a regular expression to a test that was missed in r285540.
Craig Topper [Mon, 31 Oct 2016 06:24:00 +0000 (06:24 +0000)]
[AVX-512] Add a regular expression to a test that was missed in r285540.

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

7 years ago[AVX-512] Use selectd instead of selectps for _mm256_mask_extracti32x4_epi32.
Craig Topper [Mon, 31 Oct 2016 05:49:11 +0000 (05:49 +0000)]
[AVX-512] Use selectd instead of selectps for _mm256_mask_extracti32x4_epi32.

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

7 years agoAdd support for __builtin_alloca_with_align
David Majnemer [Mon, 31 Oct 2016 05:37:48 +0000 (05:37 +0000)]
Add support for __builtin_alloca_with_align

__builtin_alloca always uses __BIGGEST_ALIGNMENT__ for the alignment of
the allocation.  __builtin_alloca_with_align allows the programmer to
specify the alignment of the allocation.

This fixes PR30658.

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

7 years agoMake output of ast-print closer to C++ code
Serge Pavlov [Mon, 31 Oct 2016 05:11:12 +0000 (05:11 +0000)]
Make output of ast-print closer to C++ code

Put semicolon after non-defining method declaration and a class
specialization body.

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

7 years ago[AVX-512] Remove masked vector extract builtins and replace with native shufflevector...
Craig Topper [Mon, 31 Oct 2016 04:30:56 +0000 (04:30 +0000)]
[AVX-512] Remove masked vector extract builtins and replace with native shufflevectors and selects.

Unfortunately, the backend currently doesn't fold masks into the instructions correctly when they come from these shufflevectors. I'll work on that in a future commit.

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

7 years ago[AVX-512] Remove many of the masked 128/256-bit shift builtins and replace them with...
Craig Topper [Mon, 31 Oct 2016 04:30:51 +0000 (04:30 +0000)]
[AVX-512] Remove many of the masked 128/256-bit shift builtins and replace them with unmasked builtins and selects.

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

7 years ago[analyzer] NumberObjectConversion: support more types, misc updates.
Artem Dergachev [Mon, 31 Oct 2016 03:08:48 +0000 (03:08 +0000)]
[analyzer] NumberObjectConversion: support more types, misc updates.

Support CFNumberRef and OSNumber objects, which may also be accidentally
converted to plain integers or booleans.

Enable explicit boolean casts by default in non-pedantic mode.

Improve handling for warnings inside macros.

Improve error messages.

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

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

7 years agoFix clang installed path to handle case where clang is invoked through a symlink
Mehdi Amini [Sun, 30 Oct 2016 23:26:13 +0000 (23:26 +0000)]
Fix clang installed path to handle case where clang is invoked through a symlink

This code path is used when generating the path to libLTO.dylib, which
is passed to the linker as `-lto_library'.
Without this, if clang is invoked through a symlink, libLTO is
searched in a path relative to where the symlink is instead of
where clang is actually installed.

Fix PR30811.

Patch by: Jack Howarth

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

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

7 years agoFixing "type" issue for (epi32)
Michael Zuckerman [Sun, 30 Oct 2016 14:54:05 +0000 (14:54 +0000)]
Fixing "type" issue for (epi32)
and replaceing hardcoded inf with clang builtin inf "__builtin_inff()" for float ({max|min}_{pd|ps})

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

7 years ago[AVX-512] Remove masked 128/256-bit builtins for vpmaddwd and vpmaddubsw. Replace...
Craig Topper [Sun, 30 Oct 2016 07:11:34 +0000 (07:11 +0000)]
[AVX-512] Remove masked 128/256-bit builtins for vpmaddwd and vpmaddubsw. Replace with unmasked builtins and select.

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

7 years agoclang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, like mingw.
NAKAMURA Takumi [Sun, 30 Oct 2016 02:58:48 +0000 (02:58 +0000)]
clang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, like mingw.

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

7 years ago[AVX-512] Remove 128/256-bit masked pmulhrsw/pmulhuw/pmulhw builtins and use unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:14 +0000 (19:02 +0000)]
[AVX-512] Remove 128/256-bit masked pmulhrsw/pmulhuw/pmulhw builtins and use unmasked builtins and select instead.

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

7 years ago[AVX-512] Remove masked 128/256-bit sqrt builtins and replace them with unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:10 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit sqrt builtins and replace them with unmasked builtins and a select.

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

7 years ago[AVX-512] Remove masked 128/256-bit pmuludq/pmuldq builtins and replace them with...
Craig Topper [Sat, 29 Oct 2016 19:02:07 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit pmuludq/pmuldq builtins and replace them with unmasked builtins and a select.

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

7 years ago[AVX-512] Remove masked 128/256-bit floating point max/min builtins. Use unmasked...
Craig Topper [Sat, 29 Oct 2016 19:02:03 +0000 (19:02 +0000)]
[AVX-512] Remove masked 128/256-bit floating point max/min builtins. Use unmasked builtins with select instead.

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

7 years agoFactor finding of libc++ include path out of building -cc1 arguments.
Richard Smith [Sat, 29 Oct 2016 17:28:48 +0000 (17:28 +0000)]
Factor finding of libc++ include path out of building -cc1 arguments.

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

7 years ago[Devirtualization] Decorate vfunction load with invariant.load
Piotr Padlewski [Sat, 29 Oct 2016 15:28:30 +0000 (15:28 +0000)]
[Devirtualization] Decorate vfunction load with invariant.load

Summary:
This patch was introduced one year ago, but because my google account
was disabled, I didn't get email with failing buildbot and I missed
revert of this commit. There was small but in test regex.
I am back.

Reviewers: rsmith, rengolin

Subscribers: nlewycky, rjmccall, cfe-commits

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

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

7 years agoNFC small format
Piotr Padlewski [Sat, 29 Oct 2016 15:28:25 +0000 (15:28 +0000)]
NFC small format

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

7 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics...
Michael Zuckerman [Sat, 29 Oct 2016 10:29:20 +0000 (10:29 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics to Clang .

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.

Reviewer: 1. craig.topper
          2. igorb

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

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

7 years agoMake a function static. NFC.
George Burgess IV [Fri, 28 Oct 2016 21:42:06 +0000 (21:42 +0000)]
Make a function static. NFC.

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

7 years ago[Sema] Delay partial availability diagnostics, just like deprecated
Erik Pilkington [Fri, 28 Oct 2016 21:39:27 +0000 (21:39 +0000)]
[Sema] Delay partial availability diagnostics, just like deprecated

This is done so that the following compiles with no warnings:
int fn(type_10_12) __attribute__((availability(macos, introduced=10.12)));

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

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

7 years agoFix handling of constructor inherited through multiple levels of virtual base class.
Richard Smith [Fri, 28 Oct 2016 20:20:58 +0000 (20:20 +0000)]
Fix handling of constructor inherited through multiple levels of virtual base class.

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

7 years ago[PPC] add float and double overloads for vec_orc and vec_nand in altivec.h
Nemanja Ivanovic [Fri, 28 Oct 2016 20:04:53 +0000 (20:04 +0000)]
[PPC] add float and double overloads for vec_orc and vec_nand in altivec.h

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

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

7 years agoPR30831: Teach template type diffing to cope with TemplateSpecializationTypes
Richard Smith [Fri, 28 Oct 2016 19:54:43 +0000 (19:54 +0000)]
PR30831: Teach template type diffing to cope with TemplateSpecializationTypes
that desugar to non-TSTs (such as injected-class-names).

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

7 years agoImplement vector count leading/trailing bytes with zero lsb and vector parity
Nemanja Ivanovic [Fri, 28 Oct 2016 19:49:03 +0000 (19:49 +0000)]
Implement vector count leading/trailing bytes with zero lsb and vector parity
builtins - clang portion

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

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

7 years agoFix implementation of the likely resolution of core issue 253 to support class
Richard Smith [Fri, 28 Oct 2016 19:11:18 +0000 (19:11 +0000)]
Fix implementation of the likely resolution of core issue 253 to support class
based arrays. Patch by Ian Tessier!

Differential Review: https://reviews.llvm.org/D25974

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

7 years agoAdd missing newline at EOF to avoid -Wnewline-eof warnings.
Bob Wilson [Fri, 28 Oct 2016 18:55:50 +0000 (18:55 +0000)]
Add missing newline at EOF to avoid -Wnewline-eof warnings.

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

7 years agoFixing small problem with avx512-reduceIntrin.c test on some OS.
Michael Zuckerman [Fri, 28 Oct 2016 17:25:26 +0000 (17:25 +0000)]
Fixing small problem with avx512-reduceIntrin.c test on some OS.

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

7 years agoRevert "[Preprocessor] Support for '-dI' flag"
Bruno Cardoso Lopes [Fri, 28 Oct 2016 17:02:10 +0000 (17:02 +0000)]
Revert "[Preprocessor] Support for '-dI' flag"

This reverts r285411. Tests failing on
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/141

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

7 years agoRelax assertion in FunctionDecl::doesDeclarationForceExternallyVisibleDefinition.
Justin Lebar [Fri, 28 Oct 2016 16:46:39 +0000 (16:46 +0000)]
Relax assertion in FunctionDecl::doesDeclarationForceExternallyVisibleDefinition.

Previously we were asserting that this declaration doesn't have a body
*and* won't have a body after we continue parsing.  This is too strong
and breaks the go-bindings test during codegen.

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

7 years ago[Preprocessor] Support for '-dI' flag
Bruno Cardoso Lopes [Fri, 28 Oct 2016 16:32:10 +0000 (16:32 +0000)]
[Preprocessor] Support for '-dI' flag

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/D25153

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

7 years ago[CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on functions...
Justin Lebar [Fri, 28 Oct 2016 16:26:26 +0000 (16:26 +0000)]
[CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on functions without bodies.

Summary:
In CUDA compilation, we call isInlineDefinitionExternallyVisible (via
getGVALinkageForFunction) on functions while parsing their definitions.

At the point in time when we call getGVALinkageForFunction, we haven't
yet added the body to the function, so we trip this assert.  But as far
as I can tell, this is harmless.

To work around this, we add a new flag to FunctionDecl, "WillHaveBody".

There was other code that was working around the existing assert with a
really awful hack -- this change lets us get rid of that hack.

Reviewers: rsmith, tra

Subscribers: aemerson, cfe-commits

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

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

7 years agoDefine extra variable in OpenMP offloading driver tests.
Samuel Antao [Fri, 28 Oct 2016 15:42:38 +0000 (15:42 +0000)]
Define extra variable in OpenMP offloading driver tests.

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

7 years ago1. Fixing small types issue (PD|PS) (reduce) .
Michael Zuckerman [Fri, 28 Oct 2016 15:16:03 +0000 (15:16 +0000)]
1. Fixing small types issue (PD|PS) (reduce)  .
2. Cosmetic changes

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

7 years agoChange OpenMP offload driver tests so that it doesn't use the full file path during...
Samuel Antao [Fri, 28 Oct 2016 15:11:50 +0000 (15:11 +0000)]
Change OpenMP offload driver tests so that it doesn't use the full file path during tests.

This was causing failures on windows bots.

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

7 years ago[OpenCL] Diagnose variadic arguments
Anastasia Stulova [Fri, 28 Oct 2016 12:59:39 +0000 (12:59 +0000)]
[OpenCL] Diagnose variadic arguments

OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0)
apart from some exceptions:
- printf
- enqueue_kernel

This change adds error diagnostic for variadic functions but accepts printf
and any compiler internal function (which should cover __enqueue_kernel_XXX cases).

It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks.

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

7 years ago[Objective-C] Add objc_subclassing_restricted attribute
Alex Lorenz [Fri, 28 Oct 2016 10:25:10 +0000 (10:25 +0000)]
[Objective-C] Add objc_subclassing_restricted attribute

This patch adds an objc_subclassing_restricted attribute into clang. This
attribute acts similarly to 'final' - Objective-C classes with this attribute
can't be subclassed. However, @interface declarations that have
objc_subclassing_restricted but don't have @implementation are allowed to
inherit other @interface declarations with objc_subclassing_restricted. This is
needed to describe the Swift class hierarchy in clang while making sure that
the Objective-C classes cannot subclass the Swift classes.

This attribute is already implemented in a fork of clang that's used for Swift
(https://github.com/apple/swift-clang) and this patch moves that code to the
upstream clang repository.

rdar://28937548

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

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

7 years agoFix MSVC "not all control paths return a value" warning
Simon Pilgrim [Fri, 28 Oct 2016 10:09:35 +0000 (10:09 +0000)]
Fix MSVC "not all control paths return a value" warning

Add unreachable after enum switch statement

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

7 years ago[openmp] Remove test assumption that canonical binary name contains "clang"
Benjamin Kramer [Fri, 28 Oct 2016 09:20:02 +0000 (09:20 +0000)]
[openmp] Remove test assumption that canonical binary name contains "clang"

Patch by Sam McCall!

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

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

7 years agoSema: do not warn about unused const vars if main file is a header
Erik Verbruggen [Fri, 28 Oct 2016 08:28:42 +0000 (08:28 +0000)]
Sema: do not warn about unused const vars if main file is a header

If we pass a header to libclang, e.g. because it's open in an editor in
an IDE, warnings about unused const vars are not useful: other files
that include the header might use those constants. So when -x *-header
is passed as command-line option, suppress this warning.

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

7 years ago[Modules] Make test from r285377 darwin specific
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:37:04 +0000 (02:37 +0000)]
[Modules] Make test from r285377 darwin specific

Appease buildbots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55876

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

7 years ago[Modules] Add testcase for builtins used in umbrella headers
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:30:45 +0000 (02:30 +0000)]
[Modules] Add testcase for builtins used in umbrella headers

This used to work before r284797 + r285152, which exposed something
interesting; some users include builtins from umbrella headers.

Clang should emit a warning to warn users this is not a good practice
and umbrella headers shouldn't get the
implicitly-add-the-builtin-version behavior for builtin header names.

While we're not there, add the testcase to represent the way it
currently works.

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

7 years agoFix a crash on invalid code.
Richard Trieu [Fri, 28 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix a crash on invalid code.

The diagnostic was attempting to access the QualType of a TypeDecl by calling
TypeDecl::getTypeForDecl.  However, the Type pointer stored there is lazily
loaded by functions in ASTContext.  In most cases, the pointer is loaded and
this does not cause a problem.  However, when more that 50 or so unknown types
are seen beforehand, this causes the Type to not be loaded, passing a null
Type to the diagnostics, leading to the crash.  Using
ASTContext::getTypeDeclType will give a proper QualType for all cases.

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

7 years ago[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute
Anna Zaks [Thu, 27 Oct 2016 21:38:44 +0000 (21:38 +0000)]
[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute

TSan and MSan were the only remaining sanitizers referring to the deprecated
attribute for issue suppression. Update the docs to recommend
__attribute__((no_sanitize("..."))) instead.

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

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

7 years agoAdd documentation describing the components of a complete toolchain including Clang.
Richard Smith [Thu, 27 Oct 2016 20:55:56 +0000 (20:55 +0000)]
Add documentation describing the components of a complete toolchain including Clang.

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

7 years ago[coroutines] Add diagnostics for copy/move assignment operators and functions with...
Eric Fiselier [Thu, 27 Oct 2016 18:43:28 +0000 (18:43 +0000)]
[coroutines] Add diagnostics for copy/move assignment operators and functions with deduced return types.

Summary: The title says it all. Additionally this patch refactors the diagnostic code into a separate function.

Reviewers: GorNishanov, rsmith

Subscribers: majnemer, mehdi_amini, cfe-commits

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

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

7 years agoUse -fopenmp=libomp in all OpenMP offloading tests.
Samuel Antao [Thu, 27 Oct 2016 18:29:57 +0000 (18:29 +0000)]
Use -fopenmp=libomp in all OpenMP offloading tests.

This will make sure the right features are being tested even for machines that default to libgomp.

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

7 years ago[Driver][OpenMP] Add support to create jobs for unbundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:14:55 +0000 (18:14 +0000)]
[Driver][OpenMP] Add support to create jobs for unbundling actions.

Summary:
This patch adds the support to create jobs for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool to unbundle input files.

Unlike other actions, unbundling actions have multiple outputs. Therefore, this patch adds the required changes to have a variant of `Tool::ConstructJob` with multiple outputs.

The way the naming of the results is implemented is also slightly modified so that the same action can use a different offloading prefix for each use by the different offloading actions.

With this patch, it is possible to compile a functional OpenMP binary with offloading support, even with separate compilation.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

7 years ago[Driver][OpenMP] Add support to create jobs for bundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:04:42 +0000 (18:04 +0000)]
[Driver][OpenMP] Add support to create jobs for bundling actions.

Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

7 years ago[Driver][OpenMP] Update actions builder to create unbundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 18:00:51 +0000 (18:00 +0000)]
[Driver][OpenMP] Update actions builder to create unbundling action when necessary.

Summary:
Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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

7 years ago[Driver][OpenMP] Update actions builder to create bundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 17:50:43 +0000 (17:50 +0000)]
[Driver][OpenMP] Update actions builder to create bundling action when necessary.

Summary:
In order to save the user from dealing with multiple output files (for host and device) while using separate compilation, a new action `OffloadBundlingAction` is used when the last phase is not linking. This action will then result in a job that uses the proposed bundling tool to create a single preprocessed/IR/ASM/Object file from multiple ones.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

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