Commit Graph

66112 Commits

Author SHA1 Message Date
Alexey Bader 0ea075328e [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

llvm-svn: 285700
2016-11-01 15:50:52 +00:00
Nemanja Ivanovic 05ce4ca0dd [PowerPC] Implement vector shift builtins - clang portion
This patch corresponds to review https://reviews.llvm.org/D26092.
Committing on behalf of Tony Jiang.

llvm-svn: 285694
2016-11-01 14:46:20 +00:00
Michael Zuckerman 62f516f590 [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

llvm-svn: 285688
2016-11-01 13:16:44 +00:00
Alex Lorenz 56148a1bcc [www] Fix a typo on the analyzer website
llvm-svn: 285686
2016-11-01 11:12:41 +00:00
Manuel Klimek da7456ad0e Fix parenthesized assert (nfc).
llvm-svn: 285685
2016-11-01 10:30:50 +00:00
Nemanja Ivanovic 251f6dd93d [PPC] Add vec_absd functions to altivec.h
This patch corresponds to review https://reviews.llvm.org/D26073.
Committing on behalf of Sean Fertile.

llvm-svn: 285679
2016-11-01 08:39:56 +00:00
Daniel Jasper 28b4d5133c 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;

llvm-svn: 285674
2016-11-01 06:23:19 +00:00
Daniel Jasper d0d27aa59b clang-format: Fix incorrect pointer detection.
Before:
  void f() { f(float{1}, a *a); }

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

llvm-svn: 285673
2016-11-01 06:23:14 +00:00
Daniel Jasper b559b43802 clang-format: [JS] Fix incorrect space when "as" is used as identifier.
Before:
  aaaaa.as ();

After:
  aaaaa.as();

llvm-svn: 285672
2016-11-01 06:23:10 +00:00
Daniel Jasper 3ade3be2a1 clang-format: Fix incorrect binary operator detection.
Before:
  int x = f(* + [] {});

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

llvm-svn: 285671
2016-11-01 06:23:05 +00:00
Daniel Jasper 71e50af675 clang-format: [JS] Fix formatting of generator functions.
Before:
  var x = {
    a: function*
	() {
	  //
	}
  }

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

llvm-svn: 285670
2016-11-01 06:22:59 +00:00
Daniel Jasper 4d67dd77a1 clang-format: [JS] Fix space when for is used as regular identifier.
Before:
  x.for () = 1;

After:
  x.for() = 1;

llvm-svn: 285669
2016-11-01 06:22:54 +00:00
Craig Topper 08bf53ffda [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.

llvm-svn: 285667
2016-11-01 05:47:56 +00:00
Argyrios Kyrtzidis 4db30af1f8 [index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the DesignatedInitExprs of the InitListExpr directly.
This is more efficient, as per feedback by Richard.

llvm-svn: 285666
2016-11-01 04:29:39 +00:00
Richard Smith 6e5610fa4d 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.

llvm-svn: 285664
2016-11-01 01:34:46 +00:00
Richard Smith 9095e5bf7e 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.

llvm-svn: 285663
2016-11-01 01:31:23 +00:00
Peter Collingbourne d3a6c70b2d 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

llvm-svn: 285660
2016-11-01 01:18:57 +00:00
Tim Shen 43ee05e804 [ReachableCode] Skip over ExprWithCleanups in isConfigurationValue
Summary: Fixes pr29152.

Reviewers: rsmith, pirama, krememek

Subscribers: cfe-commits

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

llvm-svn: 285657
2016-11-01 00:19:04 +00:00
Eric Fiselier 525a351447 [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

llvm-svn: 285655
2016-10-31 23:07:15 +00:00
Evgeniy Stepanov f75430963d [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.

llvm-svn: 285650
2016-10-31 22:28:10 +00:00
Argyrios Kyrtzidis 67eda2ad1d [index] Fix repeated visitation of the same InitListExpr for indexing.
It was visited multiple times unnecessarily.

rdar://28985038

llvm-svn: 285647
2016-10-31 22:12:12 +00:00
Malcolm Parsons 7d96c334d2 [ASTMatcher] Add CXXNewExpr support to hasDeclaration
Reviewers: sbenza, lukasza, aaron.ballman, klimek

Subscribers: lukasza, sbenza, cfe-commits

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

llvm-svn: 285644
2016-10-31 22:04:07 +00:00
John McCall 9648288c38 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.

llvm-svn: 285643
2016-10-31 21:56:26 +00:00
Artem Dergachev 75f9d3ac7e [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

llvm-svn: 285640
2016-10-31 21:11:20 +00:00
Artem Dergachev a21df23fd8 [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

llvm-svn: 285637
2016-10-31 21:04:54 +00:00
Richard Smith 90f454aeb9 Add comment explaining this mysterious macro name.
llvm-svn: 285631
2016-10-31 20:25:52 +00:00
Victor Leschuk 0df19037c4 DebugInfo: support for DW_TAG_atomic_type
Mark C11 _Atomic variables with DW_TAG_atomic_type tag.

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

llvm-svn: 285625
2016-10-31 19:09:47 +00:00
Nemanja Ivanovic e5b62c83be 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.

llvm-svn: 285623
2016-10-31 19:02:54 +00:00
Michael Zuckerman b3147e80a6 Fixing problem with CodeGen/avx512-kconstraints-att_inline_asm.c
llvm-svn: 285617
2016-10-31 18:40:17 +00:00
David Majnemer 6f51be3118 Add a warning flag for warn_alloca_align_alignof
llvm-svn: 285612
2016-10-31 18:23:02 +00:00
Richard Smith f3cec65d01 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.

llvm-svn: 285610
2016-10-31 18:18:29 +00:00
David Majnemer 86b1bfad05 [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.

llvm-svn: 285609
2016-10-31 18:07:57 +00:00
Artem Dergachev aacc03c918 [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

llvm-svn: 285605
2016-10-31 17:27:26 +00:00
Michael Zuckerman 849a6a5e5a [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

llvm-svn: 285604
2016-10-31 17:23:52 +00:00
David Majnemer bb103d928e Use toCharUnitsFromBits instead of TargetInfo::getCharWidth
llvm-svn: 285595
2016-10-31 16:48:30 +00:00
Michael Zuckerman 2460bada56 [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

llvm-svn: 285585
2016-10-31 15:27:54 +00:00
Ulrich Weigand 30354ebb00 [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.

llvm-svn: 285578
2016-10-31 14:38:05 +00:00
Michael Zuckerman 15604b996f second attempt at r285565.
llvm-svn: 285573
2016-10-31 14:16:57 +00:00
Daniel Jasper fda47cd873 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.

llvm-svn: 285570
2016-10-31 13:23:00 +00:00
Daniel Jasper eb886635d9 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};
    }
  };

llvm-svn: 285569
2016-10-31 13:18:25 +00:00
Michael Zuckerman 7beec2e8bf revert r285563 fail in test CodeGen/avx512-inline-asm-kregisters-basics.c
llvm-svn: 285565
2016-10-31 12:49:36 +00:00
Michael Zuckerman 0d26eea609 [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

llvm-svn: 285563
2016-10-31 12:05:41 +00:00
Rafael Espindola ee908d21f8 Fix this test when we have clang-offload-bundler.exe.
llvm-svn: 285561
2016-10-31 11:47:37 +00:00
Alexey Bader abdcfc1809 [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

llvm-svn: 285557
2016-10-31 10:26:31 +00:00
Michael Zuckerman 56c85d2119 Revert reviosion 285555
llvm-svn: 285556
2016-10-31 10:12:36 +00:00
Michael Zuckerman 4fe34fa2ec [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

llvm-svn: 285555
2016-10-31 09:37:59 +00:00
Elad Cohen 938f516424 [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

llvm-svn: 285548
2016-10-31 08:21:54 +00:00
Craig Topper cc012b3a37 [AVX-512] Add a regular expression to a test that was missed in r285540.
llvm-svn: 285547
2016-10-31 06:24:00 +00:00
Craig Topper 350729627a [AVX-512] Use selectd instead of selectps for _mm256_mask_extracti32x4_epi32.
llvm-svn: 285545
2016-10-31 05:49:11 +00:00
David Majnemer 5116993f8e 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.

llvm-svn: 285544
2016-10-31 05:37:48 +00:00