]> granicus.if.org Git - clang/log
clang
8 years agoIt appears that this horrible mutating copy constructor is unused. Kill it with fire.
Aaron Ballman [Tue, 1 Dec 2015 17:15:13 +0000 (17:15 +0000)]
It appears that this horrible mutating copy constructor is unused. Kill it with fire.

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

8 years agoclang-format: Make it possible to turn off comment reflowing.
Daniel Jasper [Tue, 1 Dec 2015 13:28:53 +0000 (13:28 +0000)]
clang-format: Make it possible to turn off comment reflowing.

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

8 years agoclang-format: treat Q_SIGNALS as an access modifier
Daniel Jasper [Tue, 1 Dec 2015 12:05:04 +0000 (12:05 +0000)]
clang-format: treat Q_SIGNALS as an access modifier

Patch by Alexander Richardson, thank you!

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

8 years agoThis fixes https://llvm.org/bugs/show_bug.cgi?id=25329, as well as
Daniel Jasper [Tue, 1 Dec 2015 12:00:43 +0000 (12:00 +0000)]
This fixes https://llvm.org/bugs/show_bug.cgi?id=25329, as well as
misalignments like the following:

  int a, b = 2;
  int c    = 3;

Patch by Beren Minor, thanks!

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

8 years ago[OPENMP 4.5] Parsing/sema analysis for 'priority' clause.
Alexey Bataev [Tue, 1 Dec 2015 10:17:31 +0000 (10:17 +0000)]
[OPENMP 4.5] Parsing/sema analysis for 'priority' clause.
OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives.

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

8 years ago[analyzer] Fix IssueHash generation.
Gabor Horvath [Tue, 1 Dec 2015 09:00:41 +0000 (09:00 +0000)]
[analyzer] Fix IssueHash generation.

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

Original patch by: Gyorgy Orban!

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

8 years agoRemove superfluous StringRef casts, NFC.
Yaron Keren [Tue, 1 Dec 2015 08:14:39 +0000 (08:14 +0000)]
Remove superfluous StringRef casts, NFC.

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

8 years ago[X86] Improve codegen for AVX2 gather with an all 1s mask.
Craig Topper [Tue, 1 Dec 2015 07:12:59 +0000 (07:12 +0000)]
[X86] Improve codegen for AVX2 gather with an all 1s mask.

Use undefined instead of setzero as the pass through input since its going to be fully overwritten. Use cmpeq of two zero vectors to produce the all 1s vector. Casting -1 to a double and vectorizing causes a constant load of a -1.0 floating point value.

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

8 years ago[OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.
Alexey Bataev [Tue, 1 Dec 2015 04:18:41 +0000 (04:18 +0000)]
[OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.

Adds initial parsing and semantic analysis for 'taskloop' directive.

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

8 years ago[modules] Don't reject multiple modules providing contents for the same embedded...
Richard Smith [Tue, 1 Dec 2015 03:32:49 +0000 (03:32 +0000)]
[modules] Don't reject multiple modules providing contents for the same embedded file.

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

8 years agoFix use-after-free when a C++ thread_local variable gets replaced (because its
Richard Smith [Tue, 1 Dec 2015 01:10:48 +0000 (01:10 +0000)]
Fix use-after-free when a C++ thread_local variable gets replaced (because its
type changes when the initializer is attached). Don't hold onto the
GlobalVariable*; recompute it from the VarDecl* instead.

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

8 years ago[PR25661] Revert part of r217213 according to r254323.
NAKAMURA Takumi [Mon, 30 Nov 2015 23:46:32 +0000 (23:46 +0000)]
[PR25661] Revert part of r217213 according to r254323.

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

8 years ago[libFuzzer] clarify the limitation of fsanitize-coverage=trace-cmp
Kostya Serebryany [Mon, 30 Nov 2015 22:17:19 +0000 (22:17 +0000)]
[libFuzzer] clarify the limitation of fsanitize-coverage=trace-cmp

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

8 years ago[MS Compat] Adjust thiscall to cdecl when deducing template arguments
David Majnemer [Mon, 30 Nov 2015 20:34:28 +0000 (20:34 +0000)]
[MS Compat] Adjust thiscall to cdecl when deducing template arguments

Function types can be extracted from member pointer types.
However, the type is not appropriate without first adjusting the calling
convention.

This fixes PR25661.

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

8 years agoAdd --gcc-toolchain= to one of the libclang unitests to fix issue related to
Samuel Antao [Mon, 30 Nov 2015 17:26:28 +0000 (17:26 +0000)]
Add --gcc-toolchain= to one of the libclang unitests to fix issue related to
the gcc libraries clang picks for when it was configures with a user defined
path.

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

8 years agoDo not crash when dumping the objc_bridge_related attribute when its optional argumen...
Aaron Ballman [Mon, 30 Nov 2015 15:25:34 +0000 (15:25 +0000)]
Do not crash when dumping the objc_bridge_related attribute when its optional arguments are not supplied.

Patch thanks to Joe Ranieri!

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

8 years agoUse range-based for loop to avoid the need for calculating an array size. NFC
Craig Topper [Mon, 30 Nov 2015 03:11:12 +0000 (03:11 +0000)]
Use range-based for loop to avoid the need for calculating an array size. NFC

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

8 years agoUse std::begin() and std::end() instead of doing the same manually. NFC
Craig Topper [Mon, 30 Nov 2015 03:11:10 +0000 (03:11 +0000)]
Use std::begin() and std::end() instead of doing the same manually. NFC

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

8 years ago[X86] _mm256_permutevar8x32_ps should take an integer vector for its shuffle index...
Craig Topper [Sun, 29 Nov 2015 22:53:32 +0000 (22:53 +0000)]
[X86] _mm256_permutevar8x32_ps should take an integer vector for its shuffle index input.

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

8 years ago[X86][SSE2] Added SSE2 IR + assembly codegen builtin tests
Simon Pilgrim [Sun, 29 Nov 2015 20:23:00 +0000 (20:23 +0000)]
[X86][SSE2] Added SSE2 IR + assembly codegen builtin tests

Improved tests as discussed in PR24580

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

8 years agoclang/test/CodeGen/arm-v8.1a-neon-intrinsics.c REQUIRES both arm and aarch64.
NAKAMURA Takumi [Sun, 29 Nov 2015 13:43:05 +0000 (13:43 +0000)]
clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c REQUIRES both arm and aarch64.

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

8 years agoARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Alexandros Lamprineas [Sun, 29 Nov 2015 10:53:28 +0000 (10:53 +0000)]
ARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Add/Subtract.

Add missing tests that accidentally were not committed in rL254250.

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

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

8 years agoARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Alexandros Lamprineas [Sun, 29 Nov 2015 10:43:59 +0000 (10:43 +0000)]
ARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Add/Subtract.

The following instructions are added to AArch32 instruction set:

- VQRDMLAH: Vector Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- VQRDMLSH: Vector Saturating Rounding Doubling Multiply Subtract
            Returning High Half

The following instructions are added to AArch64 instruction set:

- SQRDMLAH: Signed Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- SQRDMLSH: Signed Saturating Rounding Doubling Multiply Subtract
            Returning High Half

This patch adds intrinsic and ACLE macro support for these instructions,
as well as corresponding tests.

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

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

8 years ago[X86] Remove temporary variables from intrinsic macros. NFC
Craig Topper [Sun, 29 Nov 2015 06:50:33 +0000 (06:50 +0000)]
[X86] Remove temporary variables from intrinsic macros. NFC

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

8 years agoFixed default label in fully covered switch warning that was introduced in r254203.
Daniel Sanders [Fri, 27 Nov 2015 19:49:24 +0000 (19:49 +0000)]
Fixed default label in fully covered switch warning that was introduced in r254203.

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

8 years ago[OpenMP] Parsing and sema support for thread_limit clause.
Kelvin Li [Fri, 27 Nov 2015 18:47:36 +0000 (18:47 +0000)]
[OpenMP] Parsing and sema support for thread_limit clause.

http://reviews.llvm.org/D15029

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

8 years agoint function without a return statement is invalid C++.
Artyom Skrobov [Fri, 27 Nov 2015 18:10:49 +0000 (18:10 +0000)]
int function without a return statement is invalid C++.

Changing the return type to void.

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

8 years ago[mips] Interrupt attribute support.
Daniel Sanders [Fri, 27 Nov 2015 18:03:44 +0000 (18:03 +0000)]
[mips] Interrupt attribute support.

Summary: This patch adds support for the interrupt attribute for mips32r2+.

Patch by Simon Dardis.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years agoRevert r254203: [mips] Interrupt attribute support.
Daniel Sanders [Fri, 27 Nov 2015 18:00:36 +0000 (18:00 +0000)]
Revert r254203: [mips] Interrupt attribute support.

I forgot to credit the author.

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

8 years ago[mips] Interrupt attribute support.
Daniel Sanders [Fri, 27 Nov 2015 17:39:20 +0000 (17:39 +0000)]
[mips] Interrupt attribute support.

Summary: This patch adds support for the interrupt attribute for mips32r2+.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years agoRevert Sparc and SparcV9 to external assembler. Now that the CPU
Joerg Sonnenberger [Fri, 27 Nov 2015 13:16:33 +0000 (13:16 +0000)]
Revert Sparc and SparcV9 to external assembler. Now that the CPU
handling is corrected, the primary reason for forcing IAS as default is
gone and the remaining issues are still somewhat problematic in common
situations.

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

8 years ago[x86] Exclusion of incorrect include headers paths for MCU target
Andrey Bokhanko [Fri, 27 Nov 2015 12:18:22 +0000 (12:18 +0000)]
[x86] Exclusion of incorrect include headers paths for MCU target

Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

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

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

8 years agoTest commit
Pierre Gousseau [Thu, 26 Nov 2015 22:08:58 +0000 (22:08 +0000)]
Test commit
Remove tabs.

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

8 years agodocs: Remove references to the long-defunct LLVM_USED_LIBS
Justin Bogner [Thu, 26 Nov 2015 19:52:24 +0000 (19:52 +0000)]
docs: Remove references to the long-defunct LLVM_USED_LIBS

LLVM_USED_LIBS hasn't done anything since 2012, stop telling people to
set it in the docs.

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

8 years ago[AArch64] Add command-line options for Statistical Profiling Extension
Oliver Stannard [Thu, 26 Nov 2015 15:38:54 +0000 (15:38 +0000)]
[AArch64] Add command-line options for Statistical Profiling Extension

This adds the "+profile" and +noprofile" suffixes for the -march and
-mcpu options, to allow enabling or disabling the options Statistical
Profiling Extension to ARMv8.2-A.

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

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

8 years ago[AArch64] Add command-line options for ARMv8.2-A
Oliver Stannard [Thu, 26 Nov 2015 15:36:42 +0000 (15:36 +0000)]
[AArch64] Add command-line options for ARMv8.2-A

This adds new values for the -march option (armv8.2a and armv8.2-a,
which are aliases of each other), and new suffixes for the -march and
-mcpu options (+fp16 and +nofp16), to allow targeting the ARMv8.2-A
architecture and it's optional half-precision floating-point extension.

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

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

8 years agoFix for merging decls in pragma weak
Alexander Musman [Thu, 26 Nov 2015 09:34:30 +0000 (09:34 +0000)]
Fix for merging decls in pragma weak
Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged.
Differential Revision: http://reviews.llvm.org/D13048

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

8 years ago[OPENMP 4.5] Fixed rules for 'ordered' clause.
Alexey Bataev [Thu, 26 Nov 2015 07:50:39 +0000 (07:50 +0000)]
[OPENMP 4.5] Fixed rules for 'ordered' clause.
According to OpenMP 4.5 the parameter of 'ordered' clause must be greater than or equal to the parameter of 'collapse' clause. Patch adds this rule.

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

8 years ago[Diagnostics] Call setMapping on the correct diagnostic states in a few places. GetCu...
Craig Topper [Thu, 26 Nov 2015 05:51:54 +0000 (05:51 +0000)]
[Diagnostics] Call setMapping on the correct diagnostic states in a few places. GetCurDiagState() was being used when it shouldn't be.

I spotted this by inspection in the for loop that wasn't using its iterator and was just acting on the current state repeatedly.

This appears to have been introduced as a copy and paste bug in r140763 over 4 years ago.

I have no idea how to test this. I just went back to the original commit and tried to use the variables it was using before that.

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

8 years agoUse range-based for loops. NFC
Craig Topper [Thu, 26 Nov 2015 05:10:07 +0000 (05:10 +0000)]
Use range-based for loops. NFC

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

8 years agoUpdate reference to final TM TS spec.
Richard Smith [Thu, 26 Nov 2015 02:23:21 +0000 (02:23 +0000)]
Update reference to final TM TS spec.

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

8 years agoP0002R1: increment on expressions of type bool is no longer allowed in C++1z.
Richard Smith [Thu, 26 Nov 2015 02:16:37 +0000 (02:16 +0000)]
P0002R1: increment on expressions of type bool is no longer allowed in C++1z.

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

8 years ago[modules] Refactor handling of -fmodules-embed-*. Track this properly rather
Richard Smith [Thu, 26 Nov 2015 02:04:16 +0000 (02:04 +0000)]
[modules] Refactor handling of -fmodules-embed-*. Track this properly rather
than reusing the "overridden buffer" mechanism. This will allow us to make
embedded files and overridden files behave differently in future.

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

8 years agoDriver: protect from empty -L args
Martell Malone [Thu, 26 Nov 2015 01:02:07 +0000 (01:02 +0000)]
Driver: protect from empty -L args

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

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

8 years ago[analyzer] Add tests for generalized lambda capture (C++14). NFC.
Devin Coughlin [Thu, 26 Nov 2015 00:11:23 +0000 (00:11 +0000)]
[analyzer] Add tests for generalized lambda capture (C++14). NFC.

Add tests demonstrating that the analyzer supports generalized lambda capture. This
support falls out naturally from the work Gábor Horváth did adding C++11 lambdas to
the analyzer.

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

8 years ago[analyzer] Include block capture copy expressions in the CFG.
Devin Coughlin [Wed, 25 Nov 2015 22:35:37 +0000 (22:35 +0000)]
[analyzer] Include block capture copy expressions in the CFG.

This prevents spurious dead store warnings when a C++ lambda is casted to a block.

I've also added several tests documenting our still-incomplete support for lambda-to-block
casts.

rdar://problem/22236293

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

8 years agoP0001R1: 'register' storage class specifier is no longer permitted in C++1z.
Richard Smith [Wed, 25 Nov 2015 21:34:21 +0000 (21:34 +0000)]
P0001R1: 'register' storage class specifier is no longer permitted in C++1z.

We will still allow it in system headers, in macros from system headers, when
combined with an 'asm' label, and under the flag -Wno-register.

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

8 years agoStop using SFINAE to detect whether a derived-class override of Traverse* can
Richard Smith [Wed, 25 Nov 2015 19:33:20 +0000 (19:33 +0000)]
Stop using SFINAE to detect whether a derived-class override of Traverse* can
take a queue; some supported versions of GCC believe that this substitution
failure is an error. Instead, use a partial specialization to detect the type
of a pointer to the corresponding member. This is less general, but good enough
for our uses.

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

8 years ago[MSVC] 'property' with an empty array in array subscript expression.
Alexey Bataev [Wed, 25 Nov 2015 12:01:00 +0000 (12:01 +0000)]
[MSVC] 'property' with an empty array in array subscript expression.
MSVC supports 'property' attribute and allows to apply it to the declaration of an empty array in a class or structure definition.
For example:
```
__declspec(property(get=GetX, put=PutX)) int x[];
```
The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i);
Differential Revision: http://reviews.llvm.org/D13336

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

8 years ago[X86] Support for C calling convention only for MCU target.
Alexey Bataev [Wed, 25 Nov 2015 09:24:26 +0000 (09:24 +0000)]
[X86] Support for C calling convention only for MCU target.
For MCU only C calling convention is allowed, all other calling conventions are not supported.
Differential Revision: http://reviews.llvm.org/D14864

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

8 years agoFix typo that was being SFINAE'd away (and apparently GCC 4.7.2 rejects-valid on...
Richard Smith [Wed, 25 Nov 2015 02:41:42 +0000 (02:41 +0000)]
Fix typo that was being SFINAE'd away (and apparently GCC 4.7.2 rejects-valid on this).

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

8 years agoTeach RAV to pass its DataRecursionQueue to derived classes if they ask for it,
Richard Smith [Tue, 24 Nov 2015 23:50:47 +0000 (23:50 +0000)]
Teach RAV to pass its DataRecursionQueue to derived classes if they ask for it,
to allow them to explicitly opt into data recursion despite having overridden
Traverse*Stmt or Traverse*Expr. Use this to reintroduce data recursion to the
one place that lost it when DataRecursiveASTVisitor was removed.

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

8 years ago[OpenMP] Parsing and sema support for num_teams clause
Kelvin Li [Tue, 24 Nov 2015 20:50:12 +0000 (20:50 +0000)]
[OpenMP] Parsing and sema support for num_teams clause

http://reviews.llvm.org/D14802

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

8 years agoReplace [=] lambda capture with [&] per David Blaikieþ suggestion.
Yaron Keren [Tue, 24 Nov 2015 20:18:24 +0000 (20:18 +0000)]
Replace [=] lambda capture with [&] per David Blaikieþ suggestion.

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

8 years ago[analyzer] Pass value expression for inlined defensive checks when binding null to...
Devin Coughlin [Tue, 24 Nov 2015 19:15:11 +0000 (19:15 +0000)]
[analyzer] Pass value expression for inlined defensive checks when binding null to nonnull.

The nullability checker was not suppressing false positives resulting from
inlined defensive checks when null was bound to a nonnull variable because it
was passing the entire bind statement rather than the value expression to
trackNullOrUndefValue().

This commit changes that checker to synactically match on the bind statement to
extract the value expression so it can be passed to trackNullOrUndefValue().

rdar://problem/23575439

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

8 years agoFix rewrite of reserved library name in case of -nodefaultlibs
Nirav Dave [Tue, 24 Nov 2015 16:07:21 +0000 (16:07 +0000)]
Fix rewrite of reserved library name in case of -nodefaultlibs

The Driver only checked if nostdlib was set when deciding to add
reserved_lib_stdcxx, but as nostdlib is always exactly nodefaultlibs and
nostartfiles we should be checking one (clearly nodefaultlibs in the
case) as well. This appears to be the only such instance of this in the
codebase.

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

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

8 years ago[OPENMP] Fix crash on codegen for 'task' directive with no shared variables.
Alexey Bataev [Tue, 24 Nov 2015 13:01:44 +0000 (13:01 +0000)]
[OPENMP] Fix crash on codegen for 'task' directive with no shared variables.
If 'task' region does not have shared variables codegen could crash on calculation of size of list of shared variables.

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

8 years agoReduce the stack usage per recursive step when RecursiveASTVisitor cannot perform...
Richard Smith [Tue, 24 Nov 2015 07:13:06 +0000 (07:13 +0000)]
Reduce the stack usage per recursive step when RecursiveASTVisitor cannot perform data recursion.

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

8 years ago[modules] Add -cc1 flag -fmodules-embed-all-files.
Richard Smith [Tue, 24 Nov 2015 04:22:21 +0000 (04:22 +0000)]
[modules] Add -cc1 flag -fmodules-embed-all-files.

This flag causes all files that were read by the compilation to be embedded
into a produced module file. This is useful for distributed build systems that
use an include scanning system to determine which files are "needed" by a
compilation, and only provide those files to remote compilation workers. Since
using a module can require any file that is part of that module (or anything it
transitively includes), files that are not found by an include scanner can be
required in a regular build using explicit modules. With this flag, only files
that are actually referenced by transitively-#included files are required to be
present on the build machine.

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

8 years agoRemove DataRecursiveASTVisitor; it no longer serves any purpose, since it's just...
Richard Smith [Tue, 24 Nov 2015 03:55:01 +0000 (03:55 +0000)]
Remove DataRecursiveASTVisitor; it no longer serves any purpose, since it's just an alias for RecursiveASTVisitor.

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

8 years agoUse data recursion in RecursiveASTVisitor when traversing Stmt and Expr nodes.
Richard Smith [Tue, 24 Nov 2015 03:09:01 +0000 (03:09 +0000)]
Use data recursion in RecursiveASTVisitor when traversing Stmt and Expr nodes.

When RAV traverses a Stmt or Expr node, if the corresponding Traverse*
functions have not been overridden, it will now use data recursion to walk
those nodes. We arrange this to be an unobservable optimization to RAV
subclasses, and to gracefully degrade as parts of the visitation are overridden
with functions that might observe the visitation.

For instance, if an RAV subclass overrides TraverseUnaryNot, we will ensure
that there are real recursive stack frames for those traversals, but we'll
use data recursion for all other traversals.

This removes the need for DataRecursiveASTVisitor, and for the
'shouldUseDataRecursionFor' extension point, both of which are removed by this
change.

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

8 years agoDo not attempt to include CUDA headers during the test.
Artem Belevich [Tue, 24 Nov 2015 02:45:55 +0000 (02:45 +0000)]
Do not attempt to include CUDA headers during the test.

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

8 years ago[coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, and form...
Richard Smith [Tue, 24 Nov 2015 02:34:39 +0000 (02:34 +0000)]
[coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, and form the initial_suspend, final_suspend, and get_return_object calls.

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

8 years agoCodeGenFunction.h: Prune a \param in r253926. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Nov 2015 23:38:13 +0000 (23:38 +0000)]
CodeGenFunction.h: Prune a \param in r253926. [-Wdocumentation]

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

8 years agoNFC. Fixing my consistently incorrect spelling.
Chris Bieneman [Mon, 23 Nov 2015 23:34:13 +0000 (23:34 +0000)]
NFC. Fixing my consistently incorrect spelling.

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

8 years agoclang-c/Index.h: Move \brief. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Nov 2015 22:51:26 +0000 (22:51 +0000)]
clang-c/Index.h: Move \brief. [-Wdocumentation]

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

8 years agoPreserve exceptions information during calls code generation.
Samuel Antao [Mon, 23 Nov 2015 22:04:44 +0000 (22:04 +0000)]
Preserve exceptions information during calls code generation.

This patch changes the generation of CGFunctionInfo to contain
the FunctionProtoType if it is available. This enables the code
generation for call instructions to look into this type for
exception information and therefore generate better quality
IR - it will not create invoke instructions for functions that
are know not to throw.

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

8 years agoFix a warning about commas at the end of enumerator lists.
Chad Rosier [Mon, 23 Nov 2015 21:05:04 +0000 (21:05 +0000)]
Fix a warning about commas at the end of enumerator lists.

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

8 years agoMake clang_Cursor_getMangling not mangle if the declaration isn't mangled
Ehsan Akhgari [Mon, 23 Nov 2015 19:56:46 +0000 (19:56 +0000)]
Make clang_Cursor_getMangling not mangle if the declaration isn't mangled

Right now clang_Cursor_getMangling will attempt to mangle any
declaration, even if the declaration isn't mangled (extern C).  This
results in a partially mangled name which isn't useful for much. This
patch makes clang_Cursor_getMangling return an empty string if the
declaration isn't mangled.

Patch by Michael Wu <mwu@mozilla.com>.

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

8 years agoReplace loop with std::any_of, NFC.
Yaron Keren [Mon, 23 Nov 2015 19:28:42 +0000 (19:28 +0000)]
Replace loop with std::any_of, NFC.
Inspired by similar commits from Craig Topper.

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

8 years agoclang-format: Re-add code path deleted in r253873 and add missing test.
Daniel Jasper [Mon, 23 Nov 2015 19:11:45 +0000 (19:11 +0000)]
clang-format: Re-add code path deleted in r253873 and add missing test.

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

8 years agoFix alignment of r253898
Martell Malone [Mon, 23 Nov 2015 19:05:19 +0000 (19:05 +0000)]
Fix alignment of r253898

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

8 years agoDriver: fallback to the location of clang if no sysroot,
Martell Malone [Mon, 23 Nov 2015 18:59:48 +0000 (18:59 +0000)]
Driver: fallback to the location of clang if no sysroot,

hard coding /usr makes little sense for mingw-w64.
If we have portable toolchains having /usr breaks that.
If the clang we use is in /usr/bin or /usr/sbin etc this will
still detect as though it was hard coded to /usr

This makes the most sense going forward for mingw-w64 toolchains
on both linux and mac

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

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

8 years agoMake tbm-builtins.c as X86 specific unit test
Sumanth Gundapaneni [Mon, 23 Nov 2015 17:33:49 +0000 (17:33 +0000)]
Make tbm-builtins.c as X86 specific unit test

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

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

8 years agoDisable frame pointer elimination when using -pg
Xinliang David Li [Mon, 23 Nov 2015 17:30:31 +0000 (17:30 +0000)]
Disable frame pointer elimination when using -pg

(Re-apply patch after bug fixing)

This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives
an error if -fomit-frame-pointer is used in combination
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend
when -pg is set.

Patch by Stefan Kempf.

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

8 years agoAdd an AST matcher for narrowing when a type is volatile-qualified.
Aaron Ballman [Mon, 23 Nov 2015 17:09:24 +0000 (17:09 +0000)]
Add an AST matcher for narrowing when a type is volatile-qualified.

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

8 years agoRevert part of r253813
Martell Malone [Mon, 23 Nov 2015 16:04:55 +0000 (16:04 +0000)]
Revert part of r253813
The new lld gnu frontend does not support the -target option

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

8 years agoclang-format: Signficantly refactor the cast detection.
Daniel Jasper [Mon, 23 Nov 2015 15:55:55 +0000 (15:55 +0000)]
clang-format: Signficantly refactor the cast detection.

No functional changes intended.

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

8 years agoclang-format: Fix incorrect cast detection.
Daniel Jasper [Mon, 23 Nov 2015 15:55:50 +0000 (15:55 +0000)]
clang-format: Fix incorrect cast detection.

Before:
  bool b = f(g<int>)&&c;

After:
  bool b = f(g<int>) && c;

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

8 years agoclang-format: If the template list of a variable declaration spans
Daniel Jasper [Mon, 23 Nov 2015 15:55:45 +0000 (15:55 +0000)]
clang-format: If the template list of a variable declaration spans
multiple lines, also break before the variable name.

Before:
  std::vector<aaaaaa, // wrap
              aa> aaa;

After:
  std::vector<aaaaaa, // wrap
              aa>
      aaa;

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

8 years ago[OPENMP] 'out' dependency for 'task' directives must be the same as 'inout'.
Alexey Bataev [Mon, 23 Nov 2015 13:33:42 +0000 (13:33 +0000)]
[OPENMP] 'out' dependency for 'task' directives must be the same as 'inout'.
Runtime library requires, that codegen for 'depend' clause for 'out' dependency kind must be the same as codegen for 'depend' clause with 'inout' dependency.

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

8 years ago[OpenCL 2.0] Apply default address space (AS).
Anastasia Stulova [Mon, 23 Nov 2015 11:14:44 +0000 (11:14 +0000)]
[OpenCL 2.0] Apply default address space (AS).

If AS of a variable/parameter declaration is not set by the source,
OpenCL v2.0 s6.5 defines explicit rules for default ASes:

- The AS of global and local static variables defaults to global;
- All pointers point to generic AS.

http://reviews.llvm.org/D13168

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

8 years agoFix clang-format test. I believe that the new behavior is better.
Daniel Jasper [Mon, 23 Nov 2015 08:50:52 +0000 (08:50 +0000)]
Fix clang-format test. I believe that the new behavior is better.

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

8 years agoclang-format: Make moving of the Cursor work properly when sorting #includes.
Daniel Jasper [Mon, 23 Nov 2015 08:36:35 +0000 (08:36 +0000)]
clang-format: Make moving of the Cursor work properly when sorting #includes.

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

8 years agoFix calculation of shifted cursor/code positions. Specifically support
Daniel Jasper [Mon, 23 Nov 2015 08:33:48 +0000 (08:33 +0000)]
Fix calculation of shifted cursor/code positions. Specifically support
the case where a specific range is replaced by new text. Previously,
the calculation would shift any position from within a replaced region
to the first character after the region. This is undersirable, e.g. for
clang-format's include sorting.

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

8 years agoOpenMPClause.h: Fix typos. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Nov 2015 06:41:50 +0000 (06:41 +0000)]
OpenMPClause.h: Fix typos. [-Wdocumentation]

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

8 years ago[Driver] Mark isForDiagnostics as const. NFC.
Vedant Kumar [Mon, 23 Nov 2015 06:40:49 +0000 (06:40 +0000)]
[Driver] Mark isForDiagnostics as const. NFC.

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

8 years agoRevert r253846 (build bot failure))
Xinliang David Li [Mon, 23 Nov 2015 05:41:05 +0000 (05:41 +0000)]
Revert r253846 (build bot failure))

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

8 years ago[OpenMP] Parsing and sema support for map clause - add test case
Kelvin Li [Mon, 23 Nov 2015 05:36:37 +0000 (05:36 +0000)]
[OpenMP] Parsing and sema support for map clause - add test case

http://reviews.llvm.org/D14134

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

8 years ago[OpenMP] Parsing and sema support for map clause
Kelvin Li [Mon, 23 Nov 2015 05:32:03 +0000 (05:32 +0000)]
[OpenMP] Parsing and sema support for map clause

http://reviews.llvm.org/D14134

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

8 years agoDisable frame pointer elimination when using -pg
Xinliang David Li [Mon, 23 Nov 2015 05:09:10 +0000 (05:09 +0000)]
Disable frame pointer elimination when using -pg

This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives
an error if -fomit-frame-pointer is used in combination
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend
when -pg is set.

Patch by Stefan Kempf.

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

8 years ago[MS ABI] Tolerate invokes of __RTDynamicCast
David Majnemer [Mon, 23 Nov 2015 03:01:14 +0000 (03:01 +0000)]
[MS ABI] Tolerate invokes of __RTDynamicCast

The pointer returned by __RTDynamicCast must be bitcasted.  However, it
was not expected that __RTDynamicCast would be invoked, resulting in the
bitcast occuring in a different BasicBlock than the invoke.  This caused
a down-stream PHI to get confused about which BasicBlock the incomming
value was from.

This fixes PR25606.

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

8 years ago[coroutines] Check for overload sets in co_yield / co_return operands being resolved...
Richard Smith [Sun, 22 Nov 2015 07:33:28 +0000 (07:33 +0000)]
[coroutines] Check for overload sets in co_yield / co_return operands being resolved by a call to yield_value / return_value before rejecting them.

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

8 years ago[coroutines] Build implicit return_value / return_void calls for co_return.
Richard Smith [Sun, 22 Nov 2015 07:05:16 +0000 (07:05 +0000)]
[coroutines] Build implicit return_value / return_void calls for co_return.

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

8 years agoTest: Update mingw-useld.c to reflect r253813
Martell Malone [Sun, 22 Nov 2015 05:45:03 +0000 (05:45 +0000)]
Test: Update mingw-useld.c to reflect r253813

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

8 years agoDriver: Specifically tell the linker the target for mingw-w64
Martell Malone [Sun, 22 Nov 2015 05:40:06 +0000 (05:40 +0000)]
Driver: Specifically tell the linker the target for mingw-w64

Cross compiling from linux and OSX results in Error: Exec format.
This is because the linker is expecting ELF formated objects.
By passing the target we can explicitly tell the linker that
it should be linking COFF objects regardless of the host.

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

8 years ago[coroutines] Materialize the awaitable before generating the await_* calls.
Richard Smith [Sun, 22 Nov 2015 03:13:02 +0000 (03:13 +0000)]
[coroutines] Materialize the awaitable before generating the await_* calls.

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

8 years ago[coroutines] Factor out co_await representation into common base class for co_await...
Richard Smith [Sun, 22 Nov 2015 02:57:17 +0000 (02:57 +0000)]
[coroutines] Factor out co_await representation into common base class for co_await and co_yield, and use it to hold await_* calls.

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

8 years agoclang-format: Make sorting includes respect // clang-format off
Daniel Jasper [Sat, 21 Nov 2015 09:17:08 +0000 (09:17 +0000)]
clang-format: Make sorting includes respect // clang-format off

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

8 years agoLet's try to fix this test again with a fixed target triple
Matthias Braun [Sat, 21 Nov 2015 02:28:42 +0000 (02:28 +0000)]
Let's try to fix this test again with a fixed target triple

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