]> granicus.if.org Git - clang/log
clang
8 years ago[OpenMP] Parsing + Sema for nowait clause on target directive
Arpith Chacko Jacob [Thu, 21 Jan 2016 22:18:28 +0000 (22:18 +0000)]
[OpenMP] Parsing + Sema for nowait clause on target directive

Summary:
Allow nowait clause on target directive in sema and add test cases.

Reviewers: ABataev

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

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

8 years ago[driver] Enable some static analyzer "unix" checkers on Windows.
Devin Coughlin [Thu, 21 Jan 2016 20:09:49 +0000 (20:09 +0000)]
[driver] Enable some static analyzer "unix" checkers on Windows.

Many of the "unix" checkers are not actually unix-specific and would be valuable
to run on Windows. This commit explicitly enables those checkers on
Windows.

A patch by Alexander Riccio!

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

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

8 years ago[OpenMP] Check for at least one map clause on target data directive.
Arpith Chacko Jacob [Thu, 21 Jan 2016 19:57:55 +0000 (19:57 +0000)]
[OpenMP] Check for at least one map clause on target data directive.

Summary:
Adds the following restriction in the OpenMP specifications.

OpenMP [2.10.1, Restrictions, p. 97]
At least one map clause must appear on the directive.

Reviewers: ABataev

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

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

8 years ago[Coverage] Reduce complexity of adding function mapping records
Vedant Kumar [Thu, 21 Jan 2016 19:25:35 +0000 (19:25 +0000)]
[Coverage] Reduce complexity of adding function mapping records

Replace a string append operation in addFunctionMappingRecord with a
vector append. The existing behavior is quadratic in the worst case:
this patch makes it linear.

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

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

8 years agoAdd an isVirtualAsWritten AST matcher.
Nico Weber [Thu, 21 Jan 2016 17:56:24 +0000 (17:56 +0000)]
Add an isVirtualAsWritten AST matcher.

http://reviews.llvm.org/D16394

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

8 years agoWhen dumping documentation for AST matchers, do something more useful with \see doxyg...
Aaron Ballman [Thu, 21 Jan 2016 15:18:25 +0000 (15:18 +0000)]
When dumping documentation for AST matchers, do something more useful with \see doxygen commands. Ideally this would link to the target of \see, but for now it translates \see into "See also: "

Regenerate the AST documentation for this new functionality.

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

8 years agoFix crash for typedefs for arrays of runtime bounds in Lambdas/Captured Statements...
Alexey Bataev [Thu, 21 Jan 2016 12:54:48 +0000 (12:54 +0000)]
Fix crash for typedefs for arrays of runtime bounds in Lambdas/Captured Statements, used in sizeof() expression only.

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

8 years ago[OPENMP] Fix crash on reduction for complex variables.
Alexey Bataev [Thu, 21 Jan 2016 12:35:58 +0000 (12:35 +0000)]
[OPENMP] Fix crash on reduction for complex variables.
reworked codegen for reduction operation for complex types to avoid crash

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

8 years agoRegister the isCopyAssignmentOperator AST matcher so that it can be used dynamically.
Aaron Ballman [Wed, 20 Jan 2016 20:47:58 +0000 (20:47 +0000)]
Register the isCopyAssignmentOperator AST matcher so that it can be used dynamically.

Path by Jonathan Coe.

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

8 years agoclang-format-diff: Replace hard-code default for clang-format binary with flag.
Daniel Jasper [Wed, 20 Jan 2016 18:55:57 +0000 (18:55 +0000)]
clang-format-diff: Replace hard-code default for clang-format binary with flag.

Patch by Kwasi Mensah, thank you.

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

8 years agoAdd AST matcher support for FunctionDecls with the hasBody matcher.
Aaron Ballman [Wed, 20 Jan 2016 16:26:48 +0000 (16:26 +0000)]
Add AST matcher support for FunctionDecls with the hasBody matcher.

Patch by Aleksei Sidorin.

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

8 years agoAdd AST matcher for paren expressions.
Aaron Ballman [Wed, 20 Jan 2016 16:17:39 +0000 (16:17 +0000)]
Add AST matcher for paren expressions.

Patch by Adrian ZgorzaƂek.

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

8 years agoSilencing several -Wcast-qual warnings; NFC.
Aaron Ballman [Wed, 20 Jan 2016 15:25:30 +0000 (15:25 +0000)]
Silencing several -Wcast-qual warnings; NFC.

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

8 years ago[OPENMP 4.0] Fix for codegen of 'cancel' directive within 'sections' directive.
Alexey Bataev [Wed, 20 Jan 2016 12:29:47 +0000 (12:29 +0000)]
[OPENMP 4.0] Fix for codegen of 'cancel' directive within 'sections' directive.
Allow to emit code for 'cancel' directive within 'sections' directive with single sub-section.

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

8 years ago[OPENMP 4.5] Allow to use non-static data members in non-static member functions...
Alexey Bataev [Wed, 20 Jan 2016 09:07:54 +0000 (09:07 +0000)]
[OPENMP 4.5] Allow to use non-static data members in non-static member functions in 'private' clause.
OpenMP 4.5 allows to use non-static members of current class in non-static member functions in 'private' clause. Patch adds initial support for privatizing data members.

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

8 years agoFix infinite loop when ::new or ::delete are found in member initializer list, by...
Alexey Bataev [Wed, 20 Jan 2016 05:25:51 +0000 (05:25 +0000)]
Fix infinite loop when ::new or ::delete are found in member initializer list, by Denis Zobnin
Fix for an infinite loop on parsing ::new or ::delete in member initializer list, found by fuzzing PR23057, comment #33. Skip the rest of the member initializers if the previous initializer was invalid.
Differential Revision: http://reviews.llvm.org/D16216

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

8 years agoModule Debugging: Fine-tune the condition that determines whether a type
Adrian Prantl [Wed, 20 Jan 2016 01:29:34 +0000 (01:29 +0000)]
Module Debugging: Fine-tune the condition that determines whether a type
can be found in a module.

There are externally visible anonymous types that can be found:
  typedef struct { } s; // I can be found via the typedef.
There are anonymous internal types that can be found:
  namespace { struct s {}; } // I can be found by name.

rdar://problem/24199640

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

8 years ago[CUDA] Bail, rather than crash, on va_arg in device code.
Justin Lebar [Wed, 20 Jan 2016 00:27:00 +0000 (00:27 +0000)]
[CUDA] Bail, rather than crash, on va_arg in device code.

Reviewers: tra

Subscribers: echristo, jhen, cfe-commits

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

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

8 years ago[CUDA] Only allow __global__ on free functions and static member functions.
Justin Lebar [Wed, 20 Jan 2016 00:26:57 +0000 (00:26 +0000)]
[CUDA] Only allow __global__ on free functions and static member functions.

Summary:
Warn for NVCC compatibility if you declare a static member function or
inline function as __global__.

Reviewers: tra

Subscribers: jhen, echristo, cfe-commits

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

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

8 years agoReference the updated function name /NFC
Xinliang David Li [Wed, 20 Jan 2016 00:24:52 +0000 (00:24 +0000)]
Reference the updated function name /NFC

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

8 years agoModule Debugging: Add Objective-C testcases for anonymous tag decls. (NFC)
Adrian Prantl [Tue, 19 Jan 2016 23:42:56 +0000 (23:42 +0000)]
Module Debugging: Add Objective-C testcases for anonymous tag decls. (NFC)

rdar://problem/24199640

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

8 years agoModule Debugging: Don't emit external type references to anonymous types.
Adrian Prantl [Tue, 19 Jan 2016 23:42:53 +0000 (23:42 +0000)]
Module Debugging: Don't emit external type references to anonymous types.
Even if they exist in the module, they can't be matched with the forward
declaration in the object file.
<rdar://problem/24199640>

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

8 years agoModule Debugging: Make sure that anonymous tag decls that define global
Adrian Prantl [Tue, 19 Jan 2016 23:42:44 +0000 (23:42 +0000)]
Module Debugging: Make sure that anonymous tag decls that define global
variables are visited.

This shouldn't encourage anyone to put global variables into clang modules.
rdar://problem/24199640

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

8 years agoStmtOpenMP.h: Fix a warning in r258177. [-Wdocumentation]
NAKAMURA Takumi [Tue, 19 Jan 2016 23:21:18 +0000 (23:21 +0000)]
StmtOpenMP.h: Fix a warning in r258177. [-Wdocumentation]

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

8 years agoStmtOpenMP.h: Fix a warning in r258165. [-Wdocumentation]
NAKAMURA Takumi [Tue, 19 Jan 2016 23:21:13 +0000 (23:21 +0000)]
StmtOpenMP.h: Fix a warning in r258165. [-Wdocumentation]

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

8 years ago[CMake] Don't apply Export set to clang tools
Chris Bieneman [Tue, 19 Jan 2016 23:01:38 +0000 (23:01 +0000)]
[CMake] Don't apply Export set to clang tools

I can't apply export to tools without getting some strange CMake spew. The behavior here is a bit unexpected. CMake is complaining about static link dependencies not being in the same export set, which shouldn't matter.

In the short term it is easier to just remove the export set (which was just added in r258209) while I sort this out.

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

8 years agoAllow __attribute__((mode)) to appertain to field declarations again. Corrects compil...
Aaron Ballman [Tue, 19 Jan 2016 22:54:26 +0000 (22:54 +0000)]
Allow __attribute__((mode)) to appertain to field declarations again. Corrects compile issues with LibreOffice.

Patch by Stephan Bergmann

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

8 years ago[CMake] Creating add_clang_tool macro to wrap add_clang_executable and generate insta...
Chris Bieneman [Tue, 19 Jan 2016 22:41:51 +0000 (22:41 +0000)]
[CMake] Creating add_clang_tool macro to wrap add_clang_executable and generate install actions and targets.

This change brings forward the LLVM convention that "executables" are just runnable binaries, and "tools" are executables that are part of the project's install.

Having this abstraction will allow us to simplify some of the tool CMakeLists files, and it will standardize some of the install behaviors.

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

8 years ago[OpenMP] Detect implicit map type to report unspecified map type for target enter...
Samuel Antao [Tue, 19 Jan 2016 20:40:49 +0000 (20:40 +0000)]
[OpenMP] Detect implicit map type to report unspecified map type for target enter/exit data directives.

Support for the following OpenMP 4.5 restriction on 'target enter data' and 'target exit data':

  - A map-type must be specified in all map clauses.

I have to save 'IsMapTypeImplicit' when parsing a map clause to support this constraint and for more informative error messages. This helps me support the following case:

  #pragma omp target enter data map(r) // expected-error {{map type must be specified for '#pragma omp target enter data'}}

and distinguish it from:

  #pragma omp target enter data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target enter data'}}

Patch by Arpith Jacob. Thanks!

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

8 years ago[OpenMP] Parsing + sema for "target exit data" directive.
Samuel Antao [Tue, 19 Jan 2016 20:04:50 +0000 (20:04 +0000)]
[OpenMP] Parsing + sema for "target exit data" directive.

Patch by Arpith Jacob. Thanks!

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

8 years ago[CUDA] Handle -O options (more) correctly.
Justin Lebar [Tue, 19 Jan 2016 19:52:21 +0000 (19:52 +0000)]
[CUDA] Handle -O options (more) correctly.

Summary:
Previously we'd crash the driver if you passed -O0.  Now we try to
handle all of clang's various optimization flags in a sane way.

Reviewers: tra

Subscribers: cfe-commits, echristo, jhen

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

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

8 years ago[OpenMP] Parsing + sema for "target enter data" directive.
Samuel Antao [Tue, 19 Jan 2016 19:15:56 +0000 (19:15 +0000)]
[OpenMP] Parsing + sema for "target enter data" directive.

Patch by Arpith Jacob. Thanks!

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

8 years agoModule Debugging: Defer the emission of anonymous tag decls
Adrian Prantl [Tue, 19 Jan 2016 18:02:47 +0000 (18:02 +0000)]
Module Debugging: Defer the emission of anonymous tag decls
until we are visiting their declcontext.

This fixes a regression introduced in r256962:
When building debug info for a typdef'd anonymous tag type, we would be
visiting the inner anonymous type first thus creating a "typedef changes
linkage of anonymous type, but linkage was already computed" error.

rdar://problem/24199640

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

8 years ago[CMake] Properly respect the CLANG_APPEND_VC_REV option
Chris Bieneman [Tue, 19 Jan 2016 17:06:12 +0000 (17:06 +0000)]
[CMake] Properly respect the CLANG_APPEND_VC_REV option

Only set -DSVN_REVISION if CLANG_APPEND_VC_REV=On

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

8 years agoActivate OpenMP private clause for target construct and a regression test.
Carlo Bertolli [Tue, 19 Jan 2016 16:53:55 +0000 (16:53 +0000)]
Activate OpenMP private clause for target construct and a regression test.

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

8 years agoRename -Wexpansion-to-undefined to -Wexpansion-to-defined.
Nico Weber [Tue, 19 Jan 2016 15:32:55 +0000 (15:32 +0000)]
Rename -Wexpansion-to-undefined to -Wexpansion-to-defined.

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

8 years agoAdd -Wexpansion-to-undefined: warn when using `defined` in a macro definition.
Nico Weber [Tue, 19 Jan 2016 15:15:31 +0000 (15:15 +0000)]
Add -Wexpansion-to-undefined: warn when using `defined` in a macro definition.

[cpp.cond]p4:
  Prior to evaluation, macro invocations in the list of preprocessing
  tokens that will become the controlling constant expression are replaced
  (except for those macro names modified by the 'defined' unary operator),
  just as in normal text. If the token 'defined' is generated as a result
  of this replacement process or use of the 'defined' unary operator does
  not match one of the two specified forms prior to macro replacement, the
  behavior is undefined.

This isn't an idle threat, consider this program:
  #define FOO
  #define BAR defined(FOO)
  #if BAR
  ...
  #else
  ...
  #endif
clang and gcc will pick the #if branch while Visual Studio will take the
#else branch.  Emit a warning about this undefined behavior.

One problem is that this also applies to function-like macros. While the
example above can be written like

    #if defined(FOO) && defined(BAR)
    #defined HAVE_FOO 1
    #else
    #define HAVE_FOO 0
    #endif

there is no easy way to rewrite a function-like macro like `#define FOO(x)
(defined __foo_##x && __foo_##x)`.  Function-like macros like this are used in
practice, and compilers seem to not have differing behavior in that case. So
this a default-on warning only for object-like macros. For function-like
macros, it is an extension warning that only shows up with `-pedantic`.
(But it's undefined behavior in both cases.)

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

8 years agoFix formatting of fully qualified names in array subscripts.
Manuel Klimek [Tue, 19 Jan 2016 14:05:32 +0000 (14:05 +0000)]
Fix formatting of fully qualified names in array subscripts.

Before:
  a[ ::b::c];

After:
  a[::b::c];

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

8 years agoFix PR26134: When substituting into default template arguments, keep CurContext uncha...
Faisal Vali [Tue, 19 Jan 2016 03:58:55 +0000 (03:58 +0000)]
Fix PR26134: When substituting into default template arguments, keep CurContext unchanged.

Or, do not set Sema's CurContext to the template declaration's when substituting into default template arguments of said template declaration.
If we do push the template declaration context on to Sema, and the template declaration is at namespace scope, Sema can get confused and try and do odr analysis when substituting into default template arguments, even though the substitution could be occurring within a dependent context.
I'm not sure why this was being done, perhaps there was concern that if a default template argument referred to a previous template parameter, it might not be found during substitution - but all regression tests pass, and I can't craft a test that would cause it to fails (if some one does, please inform me, and i'll craft a different fix for the PR).

This patch removes a single line of code, but unfortunately adds more than it removes, because of the tests.  Some day I still hope to commit a patch that removes far more lines than it adds, while leaving clang better for it ;)

Sorry that r253590 ("Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults") caused the PR!

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

8 years ago[AVX512] Fix typo in r226298
Adam Nemet [Tue, 19 Jan 2016 02:02:25 +0000 (02:02 +0000)]
[AVX512] Fix typo in r226298

Hal noticed that the double/float got mixed up on the parameters for
these.

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

8 years agoFix local variable name /NFC
Xinliang David Li [Tue, 19 Jan 2016 00:49:06 +0000 (00:49 +0000)]
Fix local variable name /NFC

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

8 years agofix formatting; NFC
Sanjay Patel [Mon, 18 Jan 2016 22:15:33 +0000 (22:15 +0000)]
fix formatting; NFC

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

8 years agoThe destructor name should be matched to ~Foo instead of Foo.
Aaron Ballman [Mon, 18 Jan 2016 20:47:02 +0000 (20:47 +0000)]
The destructor name should be matched to ~Foo instead of Foo.

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

8 years agoAdd an AST matcher for checking whether a function is defaulted.
Aaron Ballman [Mon, 18 Jan 2016 20:37:44 +0000 (20:37 +0000)]
Add an AST matcher for checking whether a function is defaulted.

Patch by Jonathan Coe.

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

8 years agoAugments r258042; changes the AST matcher tests to use matchesNot and EXPECT_TRUE...
Aaron Ballman [Mon, 18 Jan 2016 20:28:57 +0000 (20:28 +0000)]
Augments r258042; changes the AST matcher tests to use matchesNot and EXPECT_TRUE instead of EXPECT_FALSE. Adds a matcher test to ensure that static member functions are properly handled. Generates the documentation from the matcher.

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

8 years ago[TableGen] Merge the SuperClass Record and SMRange vector a single vector. This remov...
Craig Topper [Mon, 18 Jan 2016 19:52:54 +0000 (19:52 +0000)]
[TableGen] Merge the SuperClass Record and SMRange vector a single vector. This removes the state needed to manage the extract vector. NFC

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

8 years ago[analyzer] Nullability: Look through implicit casts when suppressing warnings on...
Devin Coughlin [Mon, 18 Jan 2016 18:53:33 +0000 (18:53 +0000)]
[analyzer] Nullability: Look through implicit casts when suppressing warnings on return.

In r256567 I changed the nullability checker to suppress warnings about returning a null
value from a function/method with a non-null return type when the type of the returned
expression is itself nonnull. This enables the programmer to silence nullability warnings
by casting to _Nonnull:

  return (SomeObject * _Nonnull)nil;

Unfortunately, under ObjC automated reference counting, Sema adds implicit casts to
_Nonnull to return expressions of nullable or unspecified types in functions with
non-null function/method return types. With r256567, these casts cause all nullability
warnings for returns of reference-counted types to be suppressed under ARC, leading to
false negatives.

This commit updates the nullability checker to look through implicit casts before
determining the type of the returned expression. It also updates the tests to turn on
ARC for the nullability_nullonly.mm testfile and adds a new testfile to test when ARC
is turned off.

rdar://problem/24200117

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

8 years agoAdd forEachArgumentWithParam AST matcher.
Manuel Klimek [Mon, 18 Jan 2016 11:20:09 +0000 (11:20 +0000)]
Add forEachArgumentWithParam AST matcher.

The new matcher allows users to provide a matcher for both the argument
of a CallExpr/CxxConstructExpr a well as the ParmVarDecl of the
argument.

Patch by Felix Berger.

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

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

8 years ago[analyzer] Fix an off-by-one in evalIntegralCast()
Artem Dergachev [Mon, 18 Jan 2016 10:17:16 +0000 (10:17 +0000)]
[analyzer] Fix an off-by-one in evalIntegralCast()

Make sure that we do not add SymbolCast at the very boundary of
the range in which the cast would not certainly happen.

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

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

8 years ago[MS ABI] Don't crash while mangling recursive lambdas
David Majnemer [Sun, 17 Jan 2016 07:09:24 +0000 (07:09 +0000)]
[MS ABI] Don't crash while mangling recursive lambdas

We might get into bad situations where we try to embed the signature of
an inner lambda into an outer lambda which cannot work: the inner lambda
wants to embed the name of the outer lambda!

Instead, omit the return type for lambdas.

This fixes PR26105.

N.B.  While we are here, make lambdas nested within functions use an
artificial scope so that they can get demangled.

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

8 years agoclang/test/Driver/darwin-multiarch-arm.c: Appease the case that "ld.exe" exists on...
NAKAMURA Takumi [Sat, 16 Jan 2016 08:35:53 +0000 (08:35 +0000)]
clang/test/Driver/darwin-multiarch-arm.c: Appease the case that "ld.exe" exists on %PATH% on win32.

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

8 years agoFix buildbot bustage in Driver/darwin-multiarch-arm.c caused by r257983.
Justin Lebar [Sat, 16 Jan 2016 04:50:13 +0000 (04:50 +0000)]
Fix buildbot bustage in Driver/darwin-multiarch-arm.c caused by r257983.

The test was too loose; "ld" was matching directories named "build" in
the path.

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

8 years ago[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.
NAKAMURA Takumi [Sat, 16 Jan 2016 03:44:52 +0000 (03:44 +0000)]
[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.

FIXME: Add more targets to use emutls into clang/test/Driver/emulated-tls.cpp.
FIXME: Add cygwin tests into llvm/test/CodeGen/X86. Working in progress.

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

8 years agoRespect bound archs, even when they don't alter the toolchain.
Justin Lebar [Sat, 16 Jan 2016 03:30:08 +0000 (03:30 +0000)]
Respect bound archs, even when they don't alter the toolchain.

Summary:
It's possible to BindArch without changing the toolchain at all.  For
example, armv7 and armv7s have exactly the same toolchain triple.

Therefore the code in the Driver that checks that we're not creating a
job for the same Action twice needs to consider (Action, Toolchain,
BoundArch) tuples.

Reviewers: tra

Subscribers: aemerson, echristo, beanz, cfe-commits

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

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

8 years ago[libclang] Add missing CINDEX_LINKAGE from some new APIs in Index.h.
Argyrios Kyrtzidis [Sat, 16 Jan 2016 03:01:20 +0000 (03:01 +0000)]
[libclang] Add missing CINDEX_LINKAGE from some new APIs in Index.h.

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

8 years agoIntroduce -fsanitize-stats flag.
Peter Collingbourne [Sat, 16 Jan 2016 00:31:22 +0000 (00:31 +0000)]
Introduce -fsanitize-stats flag.

This is part of a new statistics gathering feature for the sanitizers.
See clang/docs/SanitizerStats.rst for further info and docs.

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

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

8 years ago[libclang] Introduce APIs for evaluating a cursor and checking if a macro is builtin...
Argyrios Kyrtzidis [Sat, 16 Jan 2016 00:20:02 +0000 (00:20 +0000)]
[libclang] Introduce APIs for evaluating a cursor and checking if a macro is builtin/function.

rdar://24091595

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

8 years agoOpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:34 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef

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

8 years agoOpaquePtr: Use nullptr construction for TemplateTy OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:28 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for TemplateTy OpaquePtr typedef

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

8 years agoOpaquePtr: Use nullptr construction for DeclGroupPtrTy OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:25 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for DeclGroupPtrTy OpaquePtr typedef

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

8 years agoOpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler...
David Blaikie [Fri, 15 Jan 2016 23:43:21 +0000 (23:43 +0000)]
OpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler to read/write

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

8 years ago[CMake] Fix bots broken by including order file generation in check-all
Chris Bieneman [Fri, 15 Jan 2016 22:44:18 +0000 (22:44 +0000)]
[CMake] Fix bots broken by including order file generation in check-all

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

8 years agoAvoid self-assignment of SmallString, trigger UB behavior down the road.
Joerg Sonnenberger [Fri, 15 Jan 2016 22:29:34 +0000 (22:29 +0000)]
Avoid self-assignment of SmallString, trigger UB behavior down the road.

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

8 years agoMake -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too.
Nico Weber [Fri, 15 Jan 2016 21:45:31 +0000 (21:45 +0000)]
Make -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too.

-Wdelete-non-virtual-dtor warns if A is a type with virtual functions but
without virtual dtor has its constructor called via `delete a`. This makes the
warning also fire if the dtor is called via `a->~A()`. This would've found a
security bug in Chromium at compile time. Fixes PR26137.

To fix the warning, add a virtual destructor, make the class final, or remove
its other virtual methods.  If you want to silence the warning, there's also
a fixit that shows how:

test.cc:12:3: warning: destructor called on 'B' ... [-Wdelete-non-virtual-dtor]
  b->~B();
  ^
test.cc:12:6: note: qualify call to silence this warning
  b->~B();
     ^
     B::

http://reviews.llvm.org/D16206

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

8 years ago[analyzer] Check for return of nil in ObjC methods with nonnull return type.
Devin Coughlin [Fri, 15 Jan 2016 21:35:40 +0000 (21:35 +0000)]
[analyzer] Check for return of nil in ObjC methods with nonnull return type.

Update NullabilityChecker so that it checks return statements in ObjC methods.
Previously it was returning early because methods do not have a function type.

Also update detection of violated parameter _Nonnull preconditions to handle
ObjC methods.

rdar://problem/24200560

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

8 years ago[CMake] [Order-files] Use print_function as an attempt at being forward compatible.
Chris Bieneman [Fri, 15 Jan 2016 21:30:06 +0000 (21:30 +0000)]
[CMake] [Order-files] Use print_function as an attempt at being forward compatible.

Based on feedback from bogner.

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

8 years ago[CMake] Support generation of linker order files using dtrace
Chris Bieneman [Fri, 15 Jan 2016 21:21:12 +0000 (21:21 +0000)]
[CMake] Support generation of linker order files using dtrace

Summary:
This patch extends the lit-based perf-training tooling supplied for PGO data generation to also generate linker order files using dtrace.

This patch should work on any system that has dtrace. If CMake can find the dtrace tool it will generate a target 'generate-order-file' which will run the per-training tests wrapped by dtrace to capture function entries. There are several algorithms implemented for sorting the order files which can be experimented with for best performance. The dtrace wrapper also supports bot oneshot and pid probes.

The perf-helper.py changes to support order file construction are ported from internal changes by ddunbar; he gets all the credit for the hard work here, I just copy and pasted.

Note: I've tested these patches on FreeBSD and OS X 10.10.

Reviewers: ddunbar, bogner, silvas

Subscribers: llvm-commits, emaste

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

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

8 years agoAdd OpenMP dist_schedule clause to distribute directive and related regression tests.
Carlo Bertolli [Fri, 15 Jan 2016 18:50:31 +0000 (18:50 +0000)]
Add OpenMP dist_schedule clause to distribute directive and related regression tests.

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

8 years ago[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.
Artem Dergachev [Fri, 15 Jan 2016 15:22:05 +0000 (15:22 +0000)]
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.

Provide separate visitor templates for the three hierarchies, and also
the `FullSValVisitor' class, which is a union of all three visitors.

Additionally, add a particular example visitor, `SValExplainer', in order to
test the visitor templates. This visitor is capable of explaining the SVal,
SymExpr, or MemRegion in a natural language.

Compared to the reverted r257605, this fixes the test that used to fail
on some triples, and fixes build failure under -fmodules.

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

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

8 years agoFix a -Wparentheses warning in ASTDiagnostic.cpp.
James Y Knight [Fri, 15 Jan 2016 05:57:41 +0000 (05:57 +0000)]
Fix a -Wparentheses warning in ASTDiagnostic.cpp.

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

8 years agoFixing more issues with template type diffing
Richard Trieu [Fri, 15 Jan 2016 05:48:38 +0000 (05:48 +0000)]
Fixing more issues with template type diffing

1) Print qualifiers for templates with zero arguments
2) Add a few more tests for the template type diffing refactoring.
Specifically, PR24587 has been fixed and has a test case from
http://reviews.llvm.org/D15384
3) Adds asserts to check the DiffTree is in correct state when moving nodes
4) Rename the field FromType and ToType since it is heavily used within
member functions.

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

8 years agoAdd new diff modes to template type diffing.
Richard Trieu [Fri, 15 Jan 2016 05:01:53 +0000 (05:01 +0000)]
Add new diff modes to template type diffing.

Remove an old assertion that does not hold.  It is possible for a template
argument to be a declaration in one instantiation and an integer in another.
Create two new diff kinds for these (decl vs int and int vs decl).

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

8 years agoPR26111: segmentation fault with __attribute__((mode(QI))) on function declaration...
Alexey Bataev [Fri, 15 Jan 2016 04:36:32 +0000 (04:36 +0000)]
PR26111: segmentation fault with __attribute__((mode(QI))) on function declaration, by Denis Zobnin
Allow "mode" attribute to be applied to VarDecl, not ValueDecl (which includes FunctionDecl and EnumConstantDecl), emit an error if this attribute is used with function declarations and enum constants.
Differential Revision: http://reviews.llvm.org/D16112

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

8 years ago[X86] Support 'interrupt' attribute for x86
Alexey Bataev [Fri, 15 Jan 2016 04:06:31 +0000 (04:06 +0000)]
[X86] Support 'interrupt' attribute for x86
This attribute may be attached to a function definition and instructs the backend to generate appropriate function entry/exit code so that
it can be used directly as an interrupt handler.
The IRET instruction, instead of the RET instruction, is used to return from interrupt or exception handlers. All registers, except for the EFLAGS register which is restored by the IRET instruction, are preserved by the compiler.
Any interruptible-without-stack-switch code must be compiled with -mno-red-zone since interrupt handlers can and will, because of the hardware design, touch
the red zone.

interrupt handler must be declared with a mandatory pointer argument:
struct interrupt_frame;

__attribute__ ((interrupt))
void f (struct interrupt_frame *frame) {
    ...
}
and user must properly define the structure the pointer pointing to.

exception handler:

The exception handler is very similar to the interrupt handler with a different mandatory function signature:
#ifdef __x86_64__
typedef unsigned long long int uword_t;
#else
typedef unsigned int uword_t;
#endif

struct interrupt_frame;

__attribute__ ((interrupt))
void f (struct interrupt_frame *frame, uword_t error_code) {
    ...
}
and compiler pops the error code off stack before the IRET instruction.

The exception handler should only be used for exceptions which push an error code and all other exceptions must use the interrupt handler.
The system will crash if the wrong handler is used.
Differential Revision: http://reviews.llvm.org/D15709

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

8 years ago[CodeGen] Attach attributes to thread local wrapper function.
Akira Hatanaka [Fri, 15 Jan 2016 03:34:06 +0000 (03:34 +0000)]
[CodeGen] Attach attributes to thread local wrapper function.

This commit is a follow-up to r251734, r251476, and r249735, which fixes
a bug where function attributes were not attached to thread local
wrapper functions.

rdar://problem/20828324

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

8 years agoWhen copying whitespace flags from the token naming a macro argument onto the
Richard Smith [Fri, 15 Jan 2016 03:24:18 +0000 (03:24 +0000)]
When copying whitespace flags from the token naming a macro argument onto the
first token of the expansion, don't forget to copy the "is at the start of a
line" token (which is always false, as newlines cannot appear within a macro
body); otherwise, stringizing the result can insert spurious whitespace.

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

8 years agoSave the integer type for integral template arguments.
Richard Trieu [Fri, 15 Jan 2016 02:55:17 +0000 (02:55 +0000)]
Save the integer type for integral template arguments.

Save the integer type when diffing integers in template type diffing.  When
integers are different sizes, print out the type along with the integer value.
Also with the type information, print true and false instead of 1 and 0 for
boolean values.

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

8 years agoMake template type diffing use the new desguared iterator.
Richard Trieu [Fri, 15 Jan 2016 01:08:56 +0000 (01:08 +0000)]
Make template type diffing use the new desguared iterator.

If available, use the canonical template argument to fill in information for
template type diffing instead of attempting to special case and evaluate Expr's
for the value.  Since those are the values used in template instantiation,
we don't have to worry about difference between our evaluator and theirs.  Also
move the nullptr template arguments from DiffKind::Expression to
DiffKind::Declaration and allow DiffKind::Declaration to set an Expr.  The only
effect that should result is that a named nullptr will show up as
'ptr aka nullptr' in diagnostics.

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

8 years ago[CUDA] Warn undeclared identifiers in CUDA kernel calls
Justin Lebar [Thu, 14 Jan 2016 23:31:30 +0000 (23:31 +0000)]
[CUDA] Warn undeclared identifiers in CUDA kernel calls

Value, type, and instantiation dependence were not being handled
correctly for CUDAKernelCallExpr AST nodes. As a result, if an
undeclared identifier was used in the triple-angle-bracket kernel call
configuration, there would be no error during parsing, and there would
be a crash during code gen. This patch makes sure that an error will be
issued during parsing in this case, just as there would be for any other
use of an undeclared identifier in C++.

Patch by Jason Henline.

Reviewers: jlebar, rsmith

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

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

8 years agoChange the TSTiterator in Template Type Diffing.
Richard Trieu [Thu, 14 Jan 2016 23:30:12 +0000 (23:30 +0000)]
Change the TSTiterator in Template Type Diffing.

Modify the TSTiterator to have two internal iterators, which will walk
the provided sugared type and the desugared type.  This will provide better
access to the template argument information.  No functional changes.

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

8 years agoRefactor template type diffing
Richard Trieu [Thu, 14 Jan 2016 22:56:39 +0000 (22:56 +0000)]
Refactor template type diffing

1) Instead of using pairs of From/To* fields, combine fields into a struct
TemplateArgInfo and have two in each DiffNode.
2) Use default initialization in DiffNode so that the constructor shows the
only field that is initialized differently on construction.
3) Use Set and Get functions per each DiffKind to make sure all fields for the
diff is set.  In one case, the Expr fields were not set.
4) Don't print boolean literals for boolean template arguments.  This prevents
printing 'false aka 0'

Only #3 has a functional change, which is reflected in the test change.

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

8 years ago[CMake] Move the install logic for libclang's headers into the libclang CMakelists
Chris Bieneman [Thu, 14 Jan 2016 22:48:45 +0000 (22:48 +0000)]
[CMake] Move the install logic for libclang's headers into the libclang CMakelists

This makes it so if you disable building libclang you won't install the headers as part of the 'install' target.

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

8 years ago[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On
Chris Bieneman [Thu, 14 Jan 2016 22:45:12 +0000 (22:45 +0000)]
[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On

This matches autoconf's ability to put clang revisions in the clang --version spew.

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

8 years ago[CUDA] Add test for compiling CUDA code with -S.
Justin Lebar [Thu, 14 Jan 2016 21:41:31 +0000 (21:41 +0000)]
[CUDA] Add test for compiling CUDA code with -S.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years ago[CUDA] Invoke ptxas and fatbinary during compilation.
Justin Lebar [Thu, 14 Jan 2016 21:41:27 +0000 (21:41 +0000)]
[CUDA] Invoke ptxas and fatbinary during compilation.

Summary:
Previously we compiled CUDA device code to PTX assembly and embedded
that asm as text in our host binary.  Now we compile to PTX assembly and
then invoke ptxas to assemble the PTX into a cubin file.  We gather the
ptx and cubin files for each of our --cuda-gpu-archs and combine them
using fatbinary, and then embed that into the host binary.

Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary,
which pass args down to the external tools.

Reviewers: tra, echristo

Subscribers: cfe-commits, jhen

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

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

8 years agoDon't build jobs for the same Action + ToolChain twice.
Justin Lebar [Thu, 14 Jan 2016 21:41:21 +0000 (21:41 +0000)]
Don't build jobs for the same Action + ToolChain twice.

Summary:
Right now if the Action graph is a DAG and we encounter an action twice,
we will run it twice.

This patch is difficult to test as-is, but I have testcases for this as
used within CUDA compilation.

Reviewers:

Subscribers:

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

8 years ago[CUDA] Add tests for compiling CUDA files with -E.
Justin Lebar [Thu, 14 Jan 2016 21:41:18 +0000 (21:41 +0000)]
[CUDA] Add tests for compiling CUDA files with -E.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years agoUpdate for LLVM function name change.
Rui Ueyama [Thu, 14 Jan 2016 21:00:27 +0000 (21:00 +0000)]
Update for LLVM function name change.

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

8 years ago[WebAssembly] Configure some simple include paths and runtime library settings.
Dan Gohman [Thu, 14 Jan 2016 16:00:13 +0000 (16:00 +0000)]
[WebAssembly] Configure some simple include paths and runtime library settings.

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

8 years ago[Hexagon] Change all builtins returning "bool" to return "int" instead
Krzysztof Parzyszek [Thu, 14 Jan 2016 14:26:36 +0000 (14:26 +0000)]
[Hexagon] Change all builtins returning "bool" to return "int" instead

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

8 years agoclang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.
Daniel Jasper [Thu, 14 Jan 2016 13:36:46 +0000 (13:36 +0000)]
clang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.

Before:
  aaaa[bbbb]
      .cccc();

After:
  aaaa[bbbb].cccc();

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

8 years ago[mips] Added support for -Wa,-mips32 and similar.
Scott Egerton [Thu, 14 Jan 2016 13:01:48 +0000 (13:01 +0000)]
[mips] Added support for -Wa,-mips32 and similar.

Reviewers: vkalintiris, dsanders

Subscribers: cfe-commits

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

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

8 years agoFix for armv7-a15 and thumbv7-a15 buildbot fails.
Andrey Bokhanko [Thu, 14 Jan 2016 11:53:50 +0000 (11:53 +0000)]
Fix for armv7-a15 and thumbv7-a15 buildbot fails.

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

8 years agoCorrect setting of UserLabelPrefix for MCU target.
Andrey Bokhanko [Thu, 14 Jan 2016 10:59:36 +0000 (10:59 +0000)]
Correct setting of UserLabelPrefix for MCU target.

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

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

8 years agoPR25910: clang allows two var definitions with the same mangled name
Andrey Bokhanko [Thu, 14 Jan 2016 10:41:16 +0000 (10:41 +0000)]
PR25910: clang allows two var definitions with the same mangled name

Proper diagnostic and resolution of mangled names' conflicts in variables.
When there is a declaration and a definition using the same name but different
types, we emit what is in the definition. When there are two conflicting
definitions, we issue an error.

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

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

8 years agoclang-format: [JS] Fix incorrect line break leading to semicolon insertion.
Daniel Jasper [Thu, 14 Jan 2016 05:37:52 +0000 (05:37 +0000)]
clang-format: [JS] Fix incorrect line break leading to semicolon insertion.

clang-format only works for JavaScript code, if all the semicolons are
present anyway, so this linebreak can never be desired.

Before (with appropriate statement lengths or column limit):
  return
      [ aaa ];

After:
  return [
    aaaa
  ];

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

8 years agoDriver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
Peter Collingbourne [Thu, 14 Jan 2016 02:49:51 +0000 (02:49 +0000)]
Driver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
replace with in-class initializers.

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

8 years agoCodeGen: Only emit CFI unrelated cast checks for bit casts.
Peter Collingbourne [Thu, 14 Jan 2016 02:49:48 +0000 (02:49 +0000)]
CodeGen: Only emit CFI unrelated cast checks for bit casts.

We were previously emitting them for no-op casts (e.g. implicit casts
to const).

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

8 years ago[Sema] Suppress diags in overload resolution.
George Burgess IV [Wed, 13 Jan 2016 23:36:34 +0000 (23:36 +0000)]
[Sema] Suppress diags in overload resolution.

We were emitting diagnostics from our shiny new C-only overload
resolution mode. This patch attempts to silence all such diagnostics.

This fixes PR26085.
Differential Revision: http://reviews.llvm.org/D16159

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

8 years agoUpdate cxx_dr_status for latest issues list.
Richard Smith [Wed, 13 Jan 2016 22:58:22 +0000 (22:58 +0000)]
Update cxx_dr_status for latest issues list.

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