Commit Graph

55720 Commits

Author SHA1 Message Date
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
David Majnemer 81537b5c8e docs: Update the MSVCCompatibility doc for changes to debug info
The document should reflect that we now support emission for DWARF.

llvm-svn: 222731
2014-11-25 06:59:35 +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
Paul Robinson 4e21001bac See if this fixes Mips bot; ignore contents of parameter lists.
llvm-svn: 222708
2014-11-24 23:30:12 +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
Tim Northover bdcc1ed66d testing: make test use FileCheck
The "grep internal | count" was fragile when your source or remote paths could
contain the word "internal".

llvm-svn: 222685
2014-11-24 21:03:34 +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 54891e047f Unbreaking the MSVC 2012 build; however, these tests still fail on Windows.
llvm-svn: 222664
2014-11-24 17:22:32 +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
Daniel Jasper 616de864da clang-format: [JS] Support Closure's module statements.
These are like import statements and should not be line-wrapped. Minor
restructuring of the handling of other import statements.

llvm-svn: 222637
2014-11-23 16:46:28 +00:00
Saleem Abdulrasool ec5c624550 CodeGen: tweak struct ABI handling
Cygwin and MinGW fail to conform to the underlying system's structure passing
ABI.  Make the check more precise to ensure that we correctly generate code for
the itanium environment.

llvm-svn: 222626
2014-11-23 02:16:24 +00:00
Daniel Sanders 1f07d06d61 Support matching signext attribute in the parallel_num_threads_codegen test to appease clang-cmake-mips builder.
The Mips target adds the signext attribute to signed 32-bit integers in order
to support the N32/N64 correctly. Integers must be promoted to 64-bit bit on
these ABI's.

llvm-svn: 222618
2014-11-22 16:21:18 +00:00
Daniel Sanders 8ff9e737af Support matching signext attribute in vla-lambda-capturing test to appease clang-cmake-mips builder.
The Mips target adds the signext attribute to signed 32-bit integers in order
to support the N32/N64 correctly. Integers must be promoted to 64-bit bit on
these ABI's.

llvm-svn: 222617
2014-11-22 16:08:56 +00:00
David Majnemer d8cd8f7b6e CodeGen: Make atomic operations play nice with address spaces
We were being a little sloppy with our pointer/address space casts.

This fixes PR21643.

llvm-svn: 222615
2014-11-22 10:44:12 +00:00
David Majnemer 6fc2d813cb Simplify MicrosoftMangleContextImpl::shouldMangleStringLiteral
No functionality changed.

llvm-svn: 222610
2014-11-22 06:20:38 +00:00
Richard Smith 88f45490a0 Delay checking overrides for exception specifications if the overridden
specification has not yet been parsed.

llvm-svn: 222603
2014-11-22 03:09:05 +00:00
David Majnemer 125efd8d4f MS ABI: Mangle u8 string literals
UTF8 string literals are mangled just like ASCII string literals.

llvm-svn: 222591
2014-11-21 23:56:50 +00:00
Fariborz Jahanian ac1c5120c6 Objective-C ARC. Fixes a crash when checking for 'weak' propery
whose base is not an expression. rdar://19053620

llvm-svn: 222570
2014-11-21 21:12:11 +00:00
David Majnemer 6f3150a7d2 Sema: Don't permit variably modified types in typeid
GCC and ICC both reject this and the 'Runtime-sized arrays with
automatic storage duration' (N3639) paper forbade this as well.
Previously, we would crash on our way to mangling.

This fixes PR21632.

llvm-svn: 222569
2014-11-21 21:09:12 +00:00
Roman Divacky d517801493 Implement -Wcast-qual, fixing #13772.
Many thanks to dblaikie for his advices and suggestions!

llvm-svn: 222568
2014-11-21 21:03:10 +00:00
David Majnemer 98e77a2512 MS ABI: Mangle char16_t and char32_t string literals
We previously had support for char and wchar_t string literals.  VS 2015
added support for char16_t and char32_t.

String literals must be mangled in the MS ABI in order for them to be
deduplicated across translation units: their linker has no notion of
mergeable section.  Instead, they use the mangled name to make a COMDAT
for the string literal; the COMDAT will merge with other COMDATs in
other object files.

This allows strings in object files generated by clang to get merged
with strings in object files generated by MSVC.

llvm-svn: 222564
2014-11-21 19:57:25 +00:00
Kaelyn Takata ef3e42b8b5 Add an assertion for detecting missed/uncorrected TypoExprs.
llvm-svn: 222552
2014-11-21 18:48:06 +00:00
Kaelyn Takata 1586782767 Enable ActOnIdExpression to use delayed typo correction for non-C++ code
when calling DiagnoseEmptyLookup.

llvm-svn: 222551
2014-11-21 18:48:04 +00:00
Kaelyn Takata 4c3ffc4fef Properly correct initializer expressions based on whether they would be valid.
llvm-svn: 222550
2014-11-21 18:48:00 +00:00
Kaelyn Takata 5ca2ecd2b2 Use the full-Expr filter to disambiguate equidistant correction
candidates.

llvm-svn: 222549
2014-11-21 18:47:58 +00:00
Daniel Jasper bcb55eec3a clang-format: Understand more lambda return types.
Before:
  auto a = [&b, c ](D * d) -> D * {}

After:
 auto a = [&b, c](D* d) -> D* {}

llvm-svn: 222534
2014-11-21 14:08:38 +00:00
Daniel Jasper 4b444495ed clang-format: Use nested block special case for all languages.
Previously this was only used for JavaScript.

Before:
  functionCall({
                 int i;
                 int j;
               },
               aaaa, bbbb, cccc);

After:
  functionCall({
    int i;
    int j;
  }, aaaa, bbbb, cccc);

llvm-svn: 222531
2014-11-21 13:38:53 +00:00
Dmitry Vyukov 45bac8d4e8 Fix test after r222526.
llvm-svn: 222530
2014-11-21 12:48:43 +00:00
Daniel Jasper d081e88e79 clang-format: Handle comments in short case labels.
With AllowShortCaseLabelsOnASingleLine set to true:
This gets now left unchanged:
  case 1:
    // comment
    return;

Whereas before it was changed into:
  case 1: // comment return;

This fixes llvm.org/PR21630.

llvm-svn: 222529
2014-11-21 12:36:25 +00:00
Daniel Jasper 82c9275344 clang-format: [Java] Support more Java keywords.
Before:
  public final<X> Foo foo() {
  }

  public abstract<X> Foo foo();

After:
  public final <X> Foo foo() {
  }

  public abstract <X> Foo foo();

Patch by Harry Terkelsen. Thank you.

llvm-svn: 222527
2014-11-21 12:19:07 +00:00
Dmitry Vyukov 43419a74ac clang: do not add -pie for tsan
Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver.
Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear.

http://reviews.llvm.org/D6318

llvm-svn: 222526
2014-11-21 12:19:01 +00:00
Daniel Jasper 8354ea84dd clang-format: [Java] Basic lambda support.
llvm-svn: 222524
2014-11-21 12:14:12 +00:00
Alexey Bataev ee9af45b19 [OPENMP] Disable CapturedStmt generation for standalone directives.
No functional changes, just code improvement.

llvm-svn: 222523
2014-11-21 11:33:46 +00:00
David Majnemer eca5a201f4 MS ABI: Mangle char16_t and char32_t types
These mangling make clang more compatible with MSVC 2015.
Correctly mangling char16_t and char32_t will take a little more work.

llvm-svn: 222515
2014-11-21 09:06:49 +00:00
Bob Wilson d8f4165b0d Fix missing diagnostic for unsupported TLS for some thread_local variables.
Clang r181627 moved a check for block-scope variables into this code for
handling thread storage class specifiers, but in the process, it broke the
logic for checking if the target supports TLS. Fix this with some simple
restructuring of the code. rdar://problem/18796883

llvm-svn: 222512
2014-11-21 06:52:52 +00:00