Commit Graph

38061 Commits

Author SHA1 Message Date
Arnaud A. de Grandmaison f2730e2d22 Remove threshold for lifetime marker insertion of named temporaries
Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

llvm-svn: 222993
2014-12-01 09:13:54 +00:00
Nico Weber cda5c7c764 Fix typo.
llvm-svn: 222964
2014-11-29 23:57:35 +00:00
David Majnemer eea02eefe7 AST: Consider pseudo-struct builtin types as substitutable
We didn't consider types like ObjCSel as a substitution candidate.

This fixes PR21688.

llvm-svn: 222941
2014-11-28 22:22:46 +00:00
Richard Barton 3b0dcc160a Add additional arguments for -mfpu options
Add neon-vfpv3 to allow specifying both at the same time. This is not an
option that GCC supports, but follows the same track and should be
non-controversial.

Change-Id: Id9ec157c835937d7d11ad0f49dbe5171fac17658
llvm-svn: 222933
2014-11-28 20:39:59 +00:00
Richard Barton 09b60b2a63 Add -mfpu=neon-vfpv4
This enables user to architecturally specify ARMv7A + VFPv4 + NEON.

Change-Id: I779b01fef5c47e5e4ac702ae24ed2f76a0e4c63f
llvm-svn: 222932
2014-11-28 20:39:54 +00:00
Alexey Bataev f33eba6573 [OPENMP] Additional processing of 'omp atomic write' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic write' is allowed to be used only for expression statements of form 'x = expr;', where x is a lvalue expression and expr is an expression with scalar type. Patch adds checks for it.

llvm-svn: 222913
2014-11-28 07:21:40 +00:00
Alexis Hunt 724f14e75c Create a new 'flag_enum' attribute.
This attribute serves as a hint to improve warnings about the ranges of
enumerators used as flag types. It currently has no working C++ implementation
due to different semantics for enums in C++. For more explanation, see the docs
and testcases.

Reviewed by Aaron Ballman.

llvm-svn: 222906
2014-11-28 00:53:20 +00:00
Tim Northover b047bfae32 AArch64: simplify PCS mapping.
Now that LLVM can count the registers needed to implement AAPCS rules, we don't
need to duplicate that logic here. This means we can drop the explicit padding
and also use more natural types in many cases (e.g. "struct { float arr[3]; }"
used to end up as "[2 x double]" to avoid holes on the stack.

The one wrinkle is that AAPCS va_arg was also using the register counting
machinery. But the local replacement isn't too bad.

llvm-svn: 222904
2014-11-27 21:02:49 +00:00
Daniel Jasper 41368e9e07 clang-format: [JS] Contract fewer functions to a single line.
Before:
  var someVariable =
      function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); };

After:
  var someVariable = function(x) {
    return x.zIsTooLongForOneLineWithTheDeclarationLine();
  };

llvm-svn: 222893
2014-11-27 15:37:42 +00:00
Daniel Jasper 4087432f8b clang-format: [JS] Try not to break in container literals.
Before:
  var obj = {
    fooooooooo:
        function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }
  };

After:
  var obj = {
    fooooooooo: function(x) {
      return x.zIsTooLongForOneLineWithTheDeclarationLine();
    }
  };

llvm-svn: 222892
2014-11-27 15:24:48 +00:00
Daniel Jasper 7912123893 clang-format: [JS] new and delete are valid function names.
Before:
  someObject.new ();
  someObject.delete ();

After:
  someObject.new();
  someObject.delete();

llvm-svn: 222890
2014-11-27 14:55:17 +00:00
Daniel Jasper 53c38f4e79 clang-format: [JS] Make Closure module detection more narrow.
Before:
  var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');

After:
  var MyLongClassName =
      goog.module.get('my.long.module.name.followedBy.MyLongClassName');

llvm-svn: 222888
2014-11-27 14:46:03 +00:00
Daniel Jasper 13404dad0d clang-format: Don't use column layout with AlignAfterOpenBrackets.
This fixes llvm.org/PR21676.

llvm-svn: 222886
2014-11-27 14:40:48 +00:00
Richard Smith 83d3f150c8 [c++1z] Remove terse range-based for loops; they've been removed from
consideration for C++17 for now. Update C++ status page to match.

llvm-svn: 222865
2014-11-27 01:54:27 +00:00
Richard Trieu c321b931c0 When checking for uninitialized values, do not confuse "std::move" with every
other function named "move".

llvm-svn: 222863
2014-11-27 01:29:32 +00:00
Daniel Jasper 9b9e07608d clang-format: [Java] Don't line-wrap package declarations.
This fixes llvm.org/PR21677.

llvm-svn: 222843
2014-11-26 18:03:42 +00:00
Nico Weber 450425c980 clang-format: Tweak -style=Chromium for Java files.
For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.

Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.

1: https://source.android.com/source/code-style.html
llvm-svn: 222839
2014-11-26 16:43:18 +00:00
Anastasia Stulova 5d8ad8a7b8 [OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.
OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces:
- the named address spaces (__global, __local, and __private) => __generic - implicitly converted;
- __generic => named - with an explicit cast;
- named <=> named - disallowed;
- __constant <=> any other - disallowed.

llvm-svn: 222834
2014-11-26 15:36:41 +00:00
Anastasia Stulova 2c8dcfbae6 [OpenCL] Generic address space has been added in OpenCL v2.0.
To support it in the frontend, the following has been added:  
- generic address space type attribute;
- documentation for the OpenCL address space attributes;
- parsing of __generic(generic) keyword;
- test code for the parser and diagnostics.

llvm-svn: 222831
2014-11-26 14:10:06 +00:00
Daniel Jasper 375815d24b clang-format: [Java] Improve formatting of throws declarations.
Before:
  public void doSoooooooooo() throws LoooooooooongException,
      LooooooooooongException {}

After:
  public void doSoooooooooo()
      throws LoooooooooongException, LooooooooooongException {}

llvm-svn: 222829
2014-11-26 12:31:19 +00:00
Daniel Jasper 4f56b0bb88 clang-format: [Java] Improve cast detection.
Before:
  a[b >> 1] = (byte)(c() << 4);

After:
  a[b >> 1] = (byte) (c() << 4);

llvm-svn: 222827
2014-11-26 12:23:10 +00:00
Daniel Jasper 07013a42d2 clang-format: [Java] Fix breaking after annotations.
Before:
  @Annotation1 // comment
  @Annotation2 class C {}

After:
  @Annotation1 // comment
  @Annotation2
  class C {}

llvm-svn: 222825
2014-11-26 11:20:43 +00:00
Daniel Jasper 9e709351c5 clang-format: Add SFS_Empty to only empty functions on a single line.
Activated for and tested by Google's Java style.

This fixes llvm.org/PR21667.

llvm-svn: 222819
2014-11-26 10:43:58 +00:00
Daniel Jasper e5d74867aa clang-format: [Java] Support Foo.class;
Before:
  SomeClass.
  class.getName();

After:
  SomeClass.class.getName();

This fixes llvm.org/PR21665.

llvm-svn: 222813
2014-11-26 08:17:08 +00:00
Richard Smith 410cc89374 [c++1z] Most of N4268 (allow constant evaluation for non-type template arguments).
We don't yet support pointer-to-member template arguments that have undergone
pointer-to-member conversions, mostly because we don't have a mangling for them yet.

llvm-svn: 222807
2014-11-26 03:26:53 +00:00
David Majnemer 659be55daa CodeGen: Fix emission of __atomic_compare_exchange
We (wrongly) discarded the return value of the call.

llvm-svn: 222798
2014-11-25 23:44:32 +00:00
Kaelyn Takata 443d61d62a Ensure that any TypoExprs in the arguments to bultins with custom type
checking are handled before the custom type checking is performed.

Fixes PR21669.

llvm-svn: 222797
2014-11-25 23:04:09 +00:00
Manuel Klimek d3aa1f4a63 Re-apply r222646 (was reverted in r222667). Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName
Change to original: ifndef out tests in Windows due to /-separated
paths.

Summary:
Often one is only interested in matches within the main-file or matches
that are not within a system-header, for which this patch adds
isInMainFile and isInSystemFile. They take no arguments and narrow down
the matches.

The isInFileMatchingName is mainly thought for interactive
clang-query-sessions, to make a matcher more specific without restarting
the session with the files you are interested in for that moment. It
takes a string that will be used as regular-expression to match the
filename of where the matched node is expanded.

Patch by Hendrik von Prince.

llvm-svn: 222765
2014-11-25 17:01:06 +00:00
Daniel Jasper a98b7b01be clang-format: Refactoring.
Re-apply r222638 and r222641 without variadic templates.

llvm-svn: 222747
2014-11-25 10:05:17 +00:00
Daniel Jasper 21a0f55755 Add flag -f(no-)modules-implicit-maps.
This suppresses the implicit search for files called 'module.modulemap' and
similar.

llvm-svn: 222745
2014-11-25 09:45:48 +00:00
Chandler Carruth 4b9e85789d Add a missing override, caught by clang's inconsistent override warning.
llvm-svn: 222742
2014-11-25 08:59:34 +00:00
Sergey Dmitrouk 745f530446 [ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructions
Summary:
This resolves [[ http://llvm.org/bugs/show_bug.cgi?id=17391 | PR17391 ]].

GCC's sources were used as a guide (couldn't find much information in ARM documentation).

Reviewers: doug.gregor, asl

Reviewed By: asl

Subscribers: asl, aemerson, cfe-commits

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

llvm-svn: 222741
2014-11-25 08:57:36 +00:00
David Majnemer 442d0a2e5a MS ABI: Add CodeGen support for rethrowing MS C++ exceptions
Rethrowing exceptions in the MS model is very simple: just call
_CxxThrowException with nullptr for both arguments.

N.B.  They chose stdcall as the calling convention for x86 but cdecl for
all other platforms.

llvm-svn: 222733
2014-11-25 07:20:20 +00:00
Saleem Abdulrasool 32d1a96d69 CodeGen: further simplify assertion
Use more of algorithm to simplify the assertion.  Pointed out by David Blakie!

llvm-svn: 222721
2014-11-25 03:49:50 +00:00
Reid Kleckner 2918fefd1c Remove unnecessary environment switch
All supported environments on x86 Windows return structs in EAX:EDX.
This removes code added in r204978 that had to get updated in r222680.
We should now have the same behavior we had before r204978.

llvm-svn: 222697
2014-11-24 22:05:42 +00:00
Kaelyn Takata 13da33fdfe Force the correction of delayed typos in casts in non-C++ code.
Fixes PR21656, which is fallout from r222551 caused by an untested/missed
code path.

llvm-svn: 222694
2014-11-24 21:46:59 +00:00
Samuel Benzaquen 074bbb698d Filter the toplevel matchers by kind.
Summary:
Filter the toplevel matchers by kind.
Decl and Stmt matchers are tied to a specific node kind and trying to
match incompatible nodes is a waste.
Precalculate a filtered list of matchers that have a chance of matching
the node and ignore the rest.
Speeds up our clang-tidy benchmark by ~10%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 222688
2014-11-24 21:21:09 +00:00
Paul Robinson 4ece682586 Correctly remove OptimizeForSize from functions marked OptimizeNone.
This allows using __attribute__((optnone)) and the -Os/-Oz options.
Fixes PR21604.

llvm-svn: 222683
2014-11-24 20:51:42 +00:00
Saleem Abdulrasool aca550fdb5 CodeGen: make i686-windows-itanium more similar to msvc
The itanium environment follows the system calling convention for structures.
Pass small aggregates via registers.

llvm-svn: 222680
2014-11-24 20:14:29 +00:00
Saleem Abdulrasool 76ecafd523 CodeGen: use a range-based for loop
Convert a debug assertion into a range-based loop form.  NFC.

llvm-svn: 222679
2014-11-24 20:14:26 +00:00
Aaron Ballman 6265102c17 Reverting r222646; the tests do not pass on Windows. Also reverts r222664, which was required for r222646 to compile with Visual Studio 2012.
llvm-svn: 222667
2014-11-24 17:39:44 +00:00
Nico Rieck e50e59a55a Fix line endings
llvm-svn: 222666
2014-11-24 17:29:52 +00:00
Nico Rieck dfff5d22e6 Fix crash when using __if_exists in C mode
llvm-svn: 222665
2014-11-24 17:29:35 +00:00
Aaron Ballman 484ee9b404 Reverting r222638; it broke the MSVC build bots because Visual Studio 2012 does not support variadic templates. Also reverting r222641 because it was relying on 222638.
llvm-svn: 222656
2014-11-24 15:42:34 +00:00
Manuel Klimek da50ff8e4a Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName
Summary:
Often one is only interested in matches within the main-file or matches
that are not within a system-header, for which this patch adds
isInMainFile and isInSystemFile. They take no arguments and narrow down
the matches.

The isInFileMatchingName is mainly thought for interactive
clang-query-sessions, to make a matcher more specific without restarting
the session with the files you are interested in for that moment. It
takes a string that will be used as regular-expression to match the
filename of where the matched node is expanded.

Patch by Hendrik von Prince.

llvm-svn: 222646
2014-11-24 09:10:56 +00:00
Daniel Jasper 79f226e780 clang-format: Make short case labels work with #ifs
Before:
  switch (a) {
  #if FOO
  case 0: return 0; #endif
  }

After:
  switch (a) {
  #if FOO
  case 0: return 0;
  #endif
  }

This fixed llvm.org/PR21544.

llvm-svn: 222642
2014-11-23 21:45:03 +00:00
Daniel Jasper 325e486f9b clang-format: [Java] Treat 'instanceof' like other binary operators.
This fixes llvm.org/PR21436.

llvm-svn: 222641
2014-11-23 21:34:25 +00:00
Daniel Jasper a0143fab5e clang-format: [Java] Space before array initializers.
Before:
  new int[]{1, 2, 3, 4};

After:
  new int[] {1, 2, 3, 4};

llvm-svn: 222640
2014-11-23 20:54:37 +00:00
Daniel Jasper bb86d847ba clang-format: Improve ObjC blocks with return type.
Before:
  Block b = ^int * (A * a, B * b) {}

After:
  Block b = ^int *(A *a, B *b) {}

This fixed llvm.org/PR21619.

llvm-svn: 222639
2014-11-23 19:15:35 +00:00
Daniel Jasper 7198b0c778 clang-format: Refactoring.
Provide more overloads to simplify testing the type of a token. No
functional changes intended.

llvm-svn: 222638
2014-11-23 19:03:25 +00:00