]> granicus.if.org Git - clang/log
clang
8 years agoCorrecting indentation for an RST code block.
Aaron Ballman [Sat, 27 Feb 2016 13:13:16 +0000 (13:13 +0000)]
Correcting indentation for an RST code block.

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

8 years agoAMDGPU: Add builtins for recently added intrinsics
Matt Arsenault [Sat, 27 Feb 2016 09:54:43 +0000 (09:54 +0000)]
AMDGPU: Add builtins for recently added intrinsics

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

8 years agoAMDGPU: Fix broken/confusing predefined macro
Matt Arsenault [Sat, 27 Feb 2016 09:06:26 +0000 (09:06 +0000)]
AMDGPU: Fix broken/confusing predefined macro

amdgcn should not be defining __R600__

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

8 years agoAMDGPU: Fix inconsistent register name for flat_scratch
Matt Arsenault [Sat, 27 Feb 2016 09:06:22 +0000 (09:06 +0000)]
AMDGPU: Fix inconsistent register name for flat_scratch

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

8 years agoAdd __builtin_canonicalize
Matt Arsenault [Sat, 27 Feb 2016 09:06:18 +0000 (09:06 +0000)]
Add __builtin_canonicalize

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

8 years agoFix bug in using shadow decl checking: a using shadow decl should not conflict
Richard Smith [Sat, 27 Feb 2016 02:36:43 +0000 (02:36 +0000)]
Fix bug in using shadow decl checking: a using shadow decl should not conflict
with a prior UsingDecl -- those should not even really be found by the lookup
here, except that we use the same lookup results for two different checks, and
the other check needs them.

This happens to work in *almost all* cases, because either the lookup results
list the UsingDecl first (and the NonTag result gets replaced by something
else) or because the problematic declaration is a function (which causes us to
use different logic to detect conflicts). This can also be triggered from a
state only reachable through modules (where the name lookup results can contain
multiple UsingDecls in the same scope).

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

8 years ago[OpenMP] Fix parsing of delete map clause modifier in C++ mode.
Samuel Antao [Sat, 27 Feb 2016 00:01:58 +0000 (00:01 +0000)]
[OpenMP] Fix parsing of delete map clause modifier in C++ mode.

Summary: The map modifier 'delete' is parser in c++ mode as a delete keyword, which requires special handling in the map clause parsing.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[CMake] Only configure Native target in stage 1, configure all in other stages
Chris Bieneman [Fri, 26 Feb 2016 21:23:59 +0000 (21:23 +0000)]
[CMake] Only configure Native target in stage 1, configure all in other stages

This patch causes the 3-stage build pipeline to only build a host compiler in the first stage, and to build all targets for subsequent stages. The host target is determined via the Native target specifier added in r262070.

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

8 years ago[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds
Chris Bieneman [Fri, 26 Feb 2016 21:04:41 +0000 (21:04 +0000)]
[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds

This is needed to build the gold plugin in multi-stage builds.

Patch by Mike Edwards

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

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

8 years ago[dllexport] Sort out emission order of delayed exported classes
Reid Kleckner [Fri, 26 Feb 2016 19:51:02 +0000 (19:51 +0000)]
[dllexport] Sort out emission order of delayed exported classes

Relands r260194 with a fix. If we have a template that transitions from
an extern template to an explicitly instantiated dllexport template, we
would add that class to the delayed exported class list without flushing
it.

For explicit instantiations, we can just flush the list of delayed
classes immediately. We don't have to worry about the bug fixed in
r260194 in this case because explicit instantiations can only occur at
file and namespace scope.

Fixes PR26490.

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

8 years agoFix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
Paul Robinson [Fri, 26 Feb 2016 19:34:01 +0000 (19:34 +0000)]
Fix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
FileCheck actually doesn't support combo suffixes.

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

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

8 years agoSemaCXX: Support templates in availability attributes
Duncan P. N. Exon Smith [Fri, 26 Feb 2016 19:27:00 +0000 (19:27 +0000)]
SemaCXX: Support templates in availability attributes

If the availability context is `FunctionTemplateDecl`, we should look
through it to the `FunctionDecl`.  This prevents a diagnostic in the
following case:

    class C __attribute__((unavailable));
    template <class T> void foo(C&) __attribute__((unavailable));

This adds tests for availability in templates in many other cases, but
that was the only case that failed before this patch.

I added a feature `__has_feature(attribute_availability_in_templates)`
so users can test for this.

rdar://problem/24561029

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

8 years agoMinor tweak to match the overall style.
Sunil Srivastava [Fri, 26 Feb 2016 18:01:12 +0000 (18:01 +0000)]
Minor tweak to match the overall style.

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

8 years agoBasic: fix __USER_LABEL_PREFIX__ on Cygwin
Saleem Abdulrasool [Fri, 26 Feb 2016 16:34:01 +0000 (16:34 +0000)]
Basic: fix __USER_LABEL_PREFIX__ on Cygwin

Adjust the user label prefix for cygwin x86_64.

Resolves PR26744.

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

8 years agoReduce false positives in printf/scanf format checker
Andy Gibbs [Fri, 26 Feb 2016 15:35:16 +0000 (15:35 +0000)]
Reduce false positives in printf/scanf format checker

Summary:
The printf/scanf format checker is a little over-zealous in handling the conditional operator.  This patch reduces work by not checking code-paths that are never used and reduces false positives regarding uncovered arguments, for example in the code fragment:

printf(minimal ? "%i\n" : "%i: %s\n", code, msg);

Reviewers: rtrieu

Subscribers: cfe-commits

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

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

8 years agoFixing an issue with the code block so that it does not appear as a list.
Aaron Ballman [Fri, 26 Feb 2016 13:39:38 +0000 (13:39 +0000)]
Fixing an issue with the code block so that it does not appear as a list.

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

8 years agoGiving this attribute documentation group a heading; fixes a documentation generation...
Aaron Ballman [Fri, 26 Feb 2016 13:30:58 +0000 (13:30 +0000)]
Giving this attribute documentation group a heading; fixes a documentation generation error.

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

8 years agoTest commit.
Vassil Vassilev [Fri, 26 Feb 2016 10:43:34 +0000 (10:43 +0000)]
Test commit.

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

8 years ago[Driver] Disable frame pointer elimination by default if target is
Akira Hatanaka [Fri, 26 Feb 2016 05:07:00 +0000 (05:07 +0000)]
[Driver] Disable frame pointer elimination by default if target is
x86_64-pc-win32-macho.

rdar://problem/24470634

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

8 years ago[MSVC Compat] Don't evaluate member base expressions w/o side effects
David Majnemer [Fri, 26 Feb 2016 04:23:19 +0000 (04:23 +0000)]
[MSVC Compat] Don't evaluate member base expressions w/o side effects

A member expression's base doesn't always have an impact on what the
member decl would evaluate to.  In such a case, the base is used as a
poor man's scope qualifier.

This fixes PR26738.

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

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

8 years ago[analyzer] Prune some incorrect \param doc comment annotations.
Devin Coughlin [Fri, 26 Feb 2016 03:41:31 +0000 (03:41 +0000)]
[analyzer] Prune some incorrect \param doc comment annotations.

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

8 years agoCheckers/CheckObjCDealloc.cpp: Prune "\param". [-Wdocumentation]
NAKAMURA Takumi [Fri, 26 Feb 2016 03:15:13 +0000 (03:15 +0000)]
Checkers/CheckObjCDealloc.cpp: Prune "\param". [-Wdocumentation]

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

8 years agoOpenMPClause.h: Fix typo in \param. [-Wdocumentation]
NAKAMURA Takumi [Fri, 26 Feb 2016 03:15:09 +0000 (03:15 +0000)]
OpenMPClause.h: Fix typo in \param. [-Wdocumentation]

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

8 years ago[OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr
Xiuli Pan [Fri, 26 Feb 2016 03:13:03 +0000 (03:13 +0000)]
[OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr

Summary:
OpenCL access qualifiers are now not only used for image types, refine it to avoid misleading,

Add semacheck for OpenCL access qualifier as well as test caees.

Reviewers: pekka.jaaskelainen, Anastasia, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years agoMake vtables_blacklist dependency conditional on existence of clang target.
Peter Collingbourne [Fri, 26 Feb 2016 03:07:33 +0000 (03:07 +0000)]
Make vtables_blacklist dependency conditional on existence of clang target.

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

8 years ago[analyzer] Shorten ObjcSuperDeallocChecker diagnostics.
Devin Coughlin [Fri, 26 Feb 2016 00:47:42 +0000 (00:47 +0000)]
[analyzer] Shorten ObjcSuperDeallocChecker diagnostics.

Change "use of 'self' after it has been freed with call to [super dealloc]" to
"use of 'self' after it has been deallocated" and "use of instance variable
'_ivar' after the instance has been freed with call to [super dealloc]" to
"use of instance variable '_ivar' after 'self' has been deallocated".

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

8 years ago[analyzer] Fix a memory error in r261935 caught by the Windows bots.
Devin Coughlin [Fri, 26 Feb 2016 00:23:41 +0000 (00:23 +0000)]
[analyzer] Fix a memory error in r261935 caught by the Windows bots.

It was using a temporary StringRef after its underlying storage was freed.

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

8 years ago[analyzer] Warn on use of 'self' after call to to [super dealloc].
Devin Coughlin [Thu, 25 Feb 2016 23:36:52 +0000 (23:36 +0000)]
[analyzer] Warn on use of 'self' after call to to [super dealloc].

Referring to 'self' after a call to [super dealloc] is a use-after-free in
Objective-C because NSObject's -dealloc frees the memory pointed to by self.
This patch extends the ObjCSuperDeallocChecker to catch this error.

rdar://problem/6953275

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

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

8 years ago[analyzer] Reapply r261917 with a fix.
Devin Coughlin [Thu, 25 Feb 2016 21:15:16 +0000 (21:15 +0000)]
[analyzer] Reapply r261917 with a fix.

This reapplies "[analyzer] Make ObjCDeallocChecker path sensitive." (r261917)
with a fix for an error on some bots about specializing a template
from another namespace.

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

8 years agoRevert "[analyzer] Make ObjCDeallocChecker path sensitive."
Devin Coughlin [Thu, 25 Feb 2016 19:13:43 +0000 (19:13 +0000)]
Revert "[analyzer] Make ObjCDeallocChecker path sensitive."

This reverts commit r261917. It broke the bots.

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

8 years ago[analyzer] Make ObjCDeallocChecker path sensitive.
Devin Coughlin [Thu, 25 Feb 2016 18:55:24 +0000 (18:55 +0000)]
[analyzer] Make ObjCDeallocChecker path sensitive.

Convert the ObjCDeallocChecker to be path sensitive. The primary
motivation for this change is to prevent false positives when -dealloc calls
helper invalidation methods to release instance variables, but it additionally
improves precision when -dealloc contains control flow. It also reduces the need
for pattern matching. The check for missing -dealloc methods remains AST-based.

Part of rdar://problem/6927496

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

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

8 years ago[CMake] Fixing install-clang-headers dependencies to depend on generating the headers.
Chris Bieneman [Thu, 25 Feb 2016 18:39:19 +0000 (18:39 +0000)]
[CMake] Fixing install-clang-headers dependencies to depend on generating the headers.

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

8 years agoAdd FieldNames to __NSConstantString_tag
Ben Langmuir [Thu, 25 Feb 2016 16:36:26 +0000 (16:36 +0000)]
Add FieldNames to __NSConstantString_tag

Since consumers of the AST may expect fields to be named.

Patch by Brad King!

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

8 years agoReplace a compiler-specific approach to determining the presence of a getDecl() membe...
Aaron Ballman [Thu, 25 Feb 2016 15:14:09 +0000 (15:14 +0000)]
Replace a compiler-specific approach to determining the presence of a getDecl() member function with one that does not require compiler-specific workarounds; NFC.

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

8 years ago[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.
Akira Hatanaka [Thu, 25 Feb 2016 07:08:33 +0000 (07:08 +0000)]
[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.

The assert isn't correct since TypeLoc::ObjCObjectTypeLoc doesn't
indicate whether the type is a dependent type. The function returns
false for a type like "<SomeProtocol>" which is a synonym for
"id<SomeProtocol>".

rdar://problem/23838912

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

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

8 years ago[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.
Alexey Bataev [Thu, 25 Feb 2016 05:25:57 +0000 (05:25 +0000)]
[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.

OpenMP 4.5 allows to privatize non-static member decls in non-static
member functions. Patch captures such decls by reference in general (for
bitfields, by value) and then operates with this capture. For bitfields,
at the end of codegen for lastprivates original bitfield is updated with the value of captured copy.

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

8 years agoTwek fix for PR24473 (r261506) - Preserve the template arguments as written
Faisal Vali [Thu, 25 Feb 2016 05:09:30 +0000 (05:09 +0000)]
Twek fix for PR24473 (r261506) - Preserve the template arguments as written
(within the DeclRefExpr Node) when creating AST nodes that reference specializations of static data member templates.  While we pass the template args through for all non-instance members, they should only be relevant (i.e. non-null) for variable template ids (assertion added for that assumption)

Also preserve the FoundDecl that refers to the canonical Decl (the  primary VarTemplateDecl for a variable template specialization) that we are referencing in our DeclRefExpr. Not sure why this was not being done for non-variable template-ids.

No functionality change - so no tests added.

Thanks to Richard Smith for drawing my attention to this!

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

8 years ago[OPENMP 4.5] Support fielddecls in 'shared' clause.
Alexey Bataev [Thu, 25 Feb 2016 03:59:29 +0000 (03:59 +0000)]
[OPENMP 4.5] Support fielddecls in 'shared' clause.

OpenMP 4.5 allows to use non-static data members of current class in
non-static member functions in different kind of clauses. Patch adds
support for data members in 'shared' clause.

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

8 years ago[OpenCL] Add Sema checks for types
Xiuli Pan [Thu, 25 Feb 2016 03:34:20 +0000 (03:34 +0000)]
[OpenCL] Add Sema checks for types

Summary:
Add Sema checks for opencl type: image, pipe....
This patch is partitioned from http://reviews.llvm.org/D16047

Reviewers: Anastasia, yaxunl

Subscribers: pekka.jaaskelainen, cfe-commits

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

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

8 years agoFix assertion failure on MaybeODRUseExprs.
Manman Ren [Wed, 24 Feb 2016 23:05:43 +0000 (23:05 +0000)]
Fix assertion failure on MaybeODRUseExprs.

In VisitNonTypeTemplateParamDecl, before SubstExpr with the default argument,
we should create a ConstantEvaluated ExpressionEvaluationContext. Without this,
it is possible to use a PotentiallyEvaluated ExpressionEvaluationContext; and
MaybeODRUseExprs will not be cleared when popping the context, causing
assertion failure.

This is similar to how we handle the context before SubstExpr with the
default argument, in SubstDefaultTemplateArgument.

Part of PR13986.
rdar://24480205

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

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

8 years agoMinor cleanup of Sema::CheckEnableIf. NFC.
George Burgess IV [Wed, 24 Feb 2016 22:31:14 +0000 (22:31 +0000)]
Minor cleanup of Sema::CheckEnableIf. NFC.

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

8 years agoRevert "Don't convert a char to a const char *"
David Majnemer [Wed, 24 Feb 2016 22:07:26 +0000 (22:07 +0000)]
Revert "Don't convert a char to a const char *"

This reverts commit r261780.  It turns out the original code was just
fine.  An overload for ltrim which takes char was added but the Doxygen
docs haven't seemed to pick it up.

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

8 years agoFix build by using hasFlag instead of hasArg.
Peter Collingbourne [Wed, 24 Feb 2016 22:03:06 +0000 (22:03 +0000)]
Fix build by using hasFlag instead of hasArg.

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

8 years agoPR26237: Fix iterator invalidation bug that occurs if serializing
Richard Smith [Wed, 24 Feb 2016 21:59:10 +0000 (21:59 +0000)]
PR26237: Fix iterator invalidation bug that occurs if serializing
specializations of a template manages to trigger deserialization of more
specializations of the same template.

No test case provided: this is hard to reliably test due to standard library
differences.

Patch by Vassil Vassilev!

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

8 years agoDon't convert a char to a const char *
David Majnemer [Wed, 24 Feb 2016 21:55:58 +0000 (21:55 +0000)]
Don't convert a char to a const char *

This fixes PR26728.

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

8 years ago[CUDA] Mark all CUDA device-side function defs, decls, and calls as convergent.
Justin Lebar [Wed, 24 Feb 2016 21:55:11 +0000 (21:55 +0000)]
[CUDA] Mark all CUDA device-side function defs, decls, and calls as convergent.

Summary:
This is important for e.g. the following case:

  void sync() { __syncthreads(); }
  void foo() {
    do_something();
    sync();
    do_something_else():
  }

Without this change, if the optimizer does not inline sync() (which it
won't because __syncthreads is also marked as noduplicate, for now
anyway), it is free to perform optimizations on sync() that it would not
be able to perform on __syncthreads(), because sync() is not marked as
convergent.

Similarly, we need a notion of convergent calls, since in the case when
we can't statically determine a call's target(s), we need to know
whether it's safe to perform optimizations around the call.

This change is conservative; the optimizer will remove these attrs where
it can, see r260318, r260319.

Reviewers: majnemer

Subscribers: cfe-commits, jhen, echristo, tra

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

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

8 years ago[CUDA] do not allow attribute-based overloading for __global__ functions.
Artem Belevich [Wed, 24 Feb 2016 21:54:45 +0000 (21:54 +0000)]
[CUDA] do not allow attribute-based overloading for __global__ functions.

__global__ functions are present on both host and device side,
so providing __host__ or __device__ overloads is not going to
do anything useful.

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

8 years ago[CUDA] Add conversion operators for threadIdx, blockIdx, gridDim, and blockDim to...
Justin Lebar [Wed, 24 Feb 2016 21:49:33 +0000 (21:49 +0000)]
[CUDA] Add conversion operators for threadIdx, blockIdx, gridDim, and blockDim to uint3 and dim3.

Summary:
This lets you write, e.g.

  uint3 a = threadIdx;
  uint3 b = blockIdx;
  dim3 c = gridDim;
  dim3 d = blockDim;

which is legal in nvcc, but was not legal in clang.

The fact that e.g. the type of threadIdx is not actually uint3 is still
observable, but now you have to try to observe it.

Reviewers: tra

Subscribers: echristo, cfe-commits

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

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

8 years ago[CUDA] Add hack so code which includes "curand.h" doesn't break.
Justin Lebar [Wed, 24 Feb 2016 21:49:31 +0000 (21:49 +0000)]
[CUDA] Add hack so code which includes "curand.h" doesn't break.

Summary:
curand.h includes curand_mtgp32_kernel.h.  In host mode, this header
redefines threadIdx and blockDim, giving them their "proper" types of
uint3 and dim3, respectively.

clang has its own plan for these variables -- their types are magic
builtin classes.  So these redefinitions are incompatible.

As a hack, we force-include the offending CUDA header and use #defines
to get the right types for threadIdx and blockDim.

Reviewers: tra

Subscribers: echristo, cfe-commits

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

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

8 years ago[CUDA] Don't specify exact line numbers in cuda-builtin-vars.cu.
Justin Lebar [Wed, 24 Feb 2016 21:49:30 +0000 (21:49 +0000)]
[CUDA] Don't specify exact line numbers in cuda-builtin-vars.cu.

This makes the test less fragile to changes to cuda_builtin_vars.h.

Test-only change.

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

8 years agoBail on compilation as soon as a job fails.
Justin Lebar [Wed, 24 Feb 2016 21:49:28 +0000 (21:49 +0000)]
Bail on compilation as soon as a job fails.

Summary:
(Re-land of r260448, which was reverted in r260522 due to a test failure
in Driver/output-file-cleanup.c that only showed up in fresh builds.)

Previously we attempted to be smart; if one job failed, we'd run all
jobs that didn't depend on the failing job.

Problem is, this doesn't work well for e.g. CUDA compilation without
-save-temps.  In this case, the device-side and host-side Assemble
actions (which actually are responsible for preprocess, compile,
backend, and assemble, since we're not saving temps) are necessarily
distinct.  So our clever heuristic doesn't help us, and we repeat every
error message once for host and once for each device arch.

The main effect of this change, other than fixing CUDA, is that if you
pass multiple cc files to one instance of clang and you get a compile
error, we'll stop when the first cc1 job fails.

Reviewers: echristo

Subscribers: cfe-commits, jhen, echristo, tra, rafael

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

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

8 years agoMake test/Driver/output-file-cleanup.c hermetic.
Justin Lebar [Wed, 24 Feb 2016 21:49:26 +0000 (21:49 +0000)]
Make test/Driver/output-file-cleanup.c hermetic.

Summary:
It checks that certain files do and exist, so make sure that they don't
exist at the beginning of the test.

This hid a failure in r260448; to see the failure, you had to run the test with
a clean-ish objdir.

Subscribers: cfe-commits

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

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

8 years agoFix rejects-valid caused by r261297.
Nico Weber [Wed, 24 Feb 2016 20:58:14 +0000 (20:58 +0000)]
Fix rejects-valid caused by r261297.

r261297 called hasUserProvidedDefaultConstructor() to check if defining a
const object is ok.  This is incorrect for this example:

  struct X { template<typename ...T> X(T...); int n; };
  const X x; // formerly OK, now bogus error

Instead, track if a class has a defaulted default constructor, and disallow
a const object for classes that either have defaulted default constructors or
if they need an implicit constructor.

Bug report and fix approach by Richard Smith, thanks!

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

8 years agoAdd whole-program vtable optimization feature to Clang.
Peter Collingbourne [Wed, 24 Feb 2016 20:46:36 +0000 (20:46 +0000)]
Add whole-program vtable optimization feature to Clang.

This patch introduces the -fwhole-program-vtables flag, which enables the
whole-program vtable optimization feature (D16795) in Clang.

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

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

8 years agoFix typo in test/CodeGen/object-size.c CHECK line.
Bob Wilson [Wed, 24 Feb 2016 18:38:35 +0000 (18:38 +0000)]
Fix typo in test/CodeGen/object-size.c CHECK line.

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

8 years agoAArch64: fix Cyclone CPU features list.
Tim Northover [Wed, 24 Feb 2016 17:57:48 +0000 (17:57 +0000)]
AArch64: fix Cyclone CPU features list.

It turns out we don't have CRC after all. Who knew?

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

8 years agoObjective-C: Add a size field to non-fragile category metadata.
Manman Ren [Wed, 24 Feb 2016 17:49:50 +0000 (17:49 +0000)]
Objective-C: Add a size field to non-fragile category metadata.

This is mainly for extensibility. Note that fragile category metadata,
metadata for classes and protocols all have a size field.

Initial patch was provided by Greg Parker.

rdar://problem/24804226

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSHUF{L|H}W{128|256|512} builtin to clang .
Michael Zuckerman [Wed, 24 Feb 2016 17:39:35 +0000 (17:39 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSHUF{L|H}W{128|256|512} builtin to clang .

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

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

8 years ago[WinEH] Make sure terminate handlers have funclet operands
David Majnemer [Wed, 24 Feb 2016 17:02:45 +0000 (17:02 +0000)]
[WinEH] Make sure terminate handlers have funclet operands

Calls to the terminate handler must be annotated within the exception
region they are within.

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

8 years ago[docs] Change non-c++ code blocks to 'text' format to fix a sphinx warning.
Alexander Kornienko [Wed, 24 Feb 2016 15:07:48 +0000 (15:07 +0000)]
[docs] Change non-c++ code blocks to 'text' format to fix a sphinx warning.

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

8 years ago[OpenCL] Add Sema checks for OpenCL 2.0 block
Xiuli Pan [Wed, 24 Feb 2016 04:29:36 +0000 (04:29 +0000)]
[OpenCL] Add Sema checks for OpenCL 2.0 block

Summary:
Add Sema checks for opencl 2.0 new features: Block.
This patch is partitioned from http://reviews.llvm.org/D16047

Reviewers: Anastasia

Subscribers: pekka.jaaskelainen, cfe-commits

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

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

8 years agoDefault vaarg lowering should support indirect struct types.
James Y Knight [Wed, 24 Feb 2016 02:59:33 +0000 (02:59 +0000)]
Default vaarg lowering should support indirect struct types.

Fixes PR11517 for SPARC.

On most targets, clang lowers va_arg itself, eschewing the use of the
llvm vaarg instruction. This is necessary (at least for now) as the type
argument to the vaarg instruction cannot represent all the ABI
information that is needed to support complex calling conventions.

However, on targets with a simpler varrags ABIs, the LLVM instruction
can work just fine, and clang can simply lower to it. Unfortunately,
even on such targets, vaarg with a struct argument would fail, because
the default lowering to vaarg was naive: it didn't take into account the
ABI attribute computed by classifyArgumentType. In particular, for the
DefaultABIInfo, structs are supposed to be passed indirectly and so
llvm's vaarg instruction should be emitted with a pointer argument.

Now, vaarg instruction emission is able to use computed ABIArgInfo for
the provided argument type, which allows the default ABI support to work
for structs too.

I haven't touched the EmitVAArg implementation for PPC32_SVR4 or XCore,
although I believe both are now redundant, and could be switched over to
use the default implementation as well.

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

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

8 years agoPR24667: fix quadratic runtime if textually-included modular headers define large...
Richard Smith [Tue, 23 Feb 2016 23:20:51 +0000 (23:20 +0000)]
PR24667: fix quadratic runtime if textually-included modular headers define large numbers of macros.

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

8 years ago[analyzer] Find ObjC 'self' decl even when block captures local named 'self'.
Devin Coughlin [Tue, 23 Feb 2016 22:26:04 +0000 (22:26 +0000)]
[analyzer] Find ObjC 'self' decl even when block captures local named 'self'.

When looking up the 'self' decl in block captures, make sure to find the actual
self declaration even when the block captures a local variable named 'self'.

rdar://problem/24751280

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

8 years ago[CMake] Add install-clang-format target by migrating to add_clang_tool
Chris Bieneman [Tue, 23 Feb 2016 20:33:15 +0000 (20:33 +0000)]
[CMake] Add install-clang-format target by migrating to add_clang_tool

This change migrates clang-format to add_clang_tool which makes a component-based install target. To support component-based installation the extra installed scripts all need to have the "clang-format" component too.

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

8 years agoRename Action::begin() to Action::input_begin().
Nico Weber [Tue, 23 Feb 2016 19:30:43 +0000 (19:30 +0000)]
Rename Action::begin() to Action::input_begin().

Also introduce inputs() that reutnrs an llvm::iterator_range.
Iterating over A->inputs() is much less mysterious than
iterating over *A.  No intended behavior change.

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

8 years agoReapply r261657.
Adrian Prantl [Tue, 23 Feb 2016 19:30:08 +0000 (19:30 +0000)]
Reapply r261657.
Remove an unnecessary workaround introduced in r259975. (NFC)

Now that LLVM r259973 allows replacing a temporary type with another
temporary we can rely on the original implementation.

It is possible for enums to be created as part of
their own declcontext. In this case a FwdDecl will be created
twice. This doesn't cause a problem because both FwdDecls are
entered into the ReplaceMap: finalize() will replace the first
FwdDecl with the second and then replace the second with
complete type.

Thanks to echristo for pointing this out.

# Conflicts:
# lib/CodeGen/CGDebugInfo.cpp

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

8 years agoRevert r261634 "Supporting all entities declared in lexical scope in LLVM debug info...
Hans Wennborg [Tue, 23 Feb 2016 19:10:16 +0000 (19:10 +0000)]
Revert r261634 "Supporting all entities declared in lexical scope in LLVM debug info." and r261657

r261634 and r261633 seems to have caused PR26715. r261657 depends on the former two.

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

8 years agoAmends r252104 to evaluate the controlling expression in an unevaluated context....
Aaron Ballman [Tue, 23 Feb 2016 18:55:15 +0000 (18:55 +0000)]
Amends r252104 to evaluate the controlling expression in an unevaluated context. This eliminates false-positive diagnostics about null pointer dereferences (etc) in the controlling expression.

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

8 years agoRemove an unnecessary workaround introduced in r259975. (NFC)
Adrian Prantl [Tue, 23 Feb 2016 17:13:47 +0000 (17:13 +0000)]
Remove an unnecessary workaround introduced in r259975. (NFC)

Now that LLVM r259973 allows replacing a temporary type with another
temporary we can rely on the original implementation.

It is possible for enums to be created as part of
their own declcontext. In this case a FwdDecl will be created
twice. This doesn't cause a problem because both FwdDecls are
entered into the ReplaceMap: finalize() will replace the first
FwdDecl with the second and then replace the second with
complete type.

Thanks to echristo for pointing this out.

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

8 years agoRevert "[VFS] Add support for handling path traversals"
Bruno Cardoso Lopes [Tue, 23 Feb 2016 17:06:50 +0000 (17:06 +0000)]
Revert "[VFS] Add support for handling path traversals"

This reverts commit r261551 due to failing tests in windows bots:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10054

Failing Tests (4):
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName

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

8 years agoFix a typo. NFC
Alexander Kornienko [Tue, 23 Feb 2016 16:12:08 +0000 (16:12 +0000)]
Fix a typo. NFC

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

8 years agoClean up clang-format options documentation. NFC
Alexander Kornienko [Tue, 23 Feb 2016 16:12:00 +0000 (16:12 +0000)]
Clean up clang-format options documentation. NFC

Use uniform style for inline code blocks, specify language for YAML code blocks,
various formatting fixes etc.

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

8 years agoSupport language selection for \code blocks.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:55 +0000 (16:11 +0000)]
Support language selection for \code blocks.

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

8 years agoUpdate clang-format options docs.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:51 +0000 (16:11 +0000)]
Update clang-format options docs.

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

8 years agoAllow running dump_format_style.py from any directory.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:43 +0000 (16:11 +0000)]
Allow running dump_format_style.py from any directory.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 15:59:47 +0000 (15:59 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang

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

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 14:23:53 +0000 (14:23 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang

Adding closer to the end of macro }->})

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

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 13:41:13 +0000 (13:41 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang

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

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

8 years agoSupporting all entities declared in lexical scope in LLVM debug info.
Amjad Aboud [Tue, 23 Feb 2016 13:37:18 +0000 (13:37 +0000)]
Supporting all entities declared in lexical scope in LLVM debug info.

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

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

8 years ago[analyzer] Improve pointer arithmetic checker.
Gabor Horvath [Tue, 23 Feb 2016 12:34:39 +0000 (12:34 +0000)]
[analyzer] Improve pointer arithmetic checker.

This patch is intended to improve pointer arithmetic checker.
From now on it only warns when the pointer arithmetic is likely to cause an
error. For example when the pointer points to a single object, or an array of
derived types.

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

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

8 years agoFix a -Wunused-variable diagnostic.
Alexander Kornienko [Tue, 23 Feb 2016 10:29:04 +0000 (10:29 +0000)]
Fix a -Wunused-variable diagnostic.

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

8 years agoPrint options, if requested.
Alexander Kornienko [Tue, 23 Feb 2016 10:29:02 +0000 (10:29 +0000)]
Print options, if requested.

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

8 years ago[ms-inline-asm] Fixing bug in single asm statement support
Marina Yatsina [Tue, 23 Feb 2016 08:53:45 +0000 (08:53 +0000)]
[ms-inline-asm] Fixing bug in single asm statement support

Fixing a crash caused by trying to merge a single-line asm statement with an asm block that follows it, e.g:
asm int 4
asm {
  int 5
}

Now, only adjacent single-line asm statements that are not surrounded by braces will be merged into one asm call.

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

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

8 years agoRevert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix call to...
Bruno Cardoso Lopes [Tue, 23 Feb 2016 07:06:12 +0000 (07:06 +0000)]
Revert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix call to getVFSFromYAML in unittests"

This reverts commit r261552 and r261556 because of failing unittests on
windows:

Failing Tests (4):
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName

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

8 years agoLex: Return "" when HeaderMap::lookupFilename fails
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 00:48:16 +0000 (00:48 +0000)]
Lex: Return "" when HeaderMap::lookupFilename fails

Change getString() to return Optional<StringRef>, and change
lookupFilename() to return an empty string if either one of the prefix
and suffix can't be found.

This is a more robust follow-up to r261461, but it's still not entirely
satisfactory.  Ideally we'd report that the header map is corrupt;
perhaps something for a follow-up.

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

8 years agoLex: Check for 0 buckets on header map construction
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 22:24:22 +0000 (22:24 +0000)]
Lex: Check for 0 buckets on header map construction

Switch to using `isPowerOf2_32()` to check whether the buckets are a
power of two, and as a side benefit reject loading a header map with no
buckets.  This is a follow-up to r261448.

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

8 years agoFix Visual Studio build after r261574
Hans Wennborg [Mon, 22 Feb 2016 22:21:58 +0000 (22:21 +0000)]
Fix Visual Studio build after r261574

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

8 years ago[ASTMatchers] Add matcher hasAnyName.
Samuel Benzaquen [Mon, 22 Feb 2016 21:13:02 +0000 (21:13 +0000)]
[ASTMatchers] Add matcher hasAnyName.

Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

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

8 years agoclang-format: [JS] Add @return to the supported JSDoc pragmas in Google
Daniel Jasper [Mon, 22 Feb 2016 20:24:11 +0000 (20:24 +0000)]
clang-format: [JS] Add @return to the supported JSDoc pragmas in Google
style.

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

8 years ago[WebAssembly] Initial driver support for standard library paths.
Dan Gohman [Mon, 22 Feb 2016 19:26:15 +0000 (19:26 +0000)]
[WebAssembly] Initial driver support for standard library paths.

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

8 years ago[WebAssembly] Lower va_arg in clang.
Dan Gohman [Mon, 22 Feb 2016 19:17:40 +0000 (19:17 +0000)]
[WebAssembly] Lower va_arg in clang.

This uses the general emitVoidPtrVAArg lowering logic for everything, since
this supports all types, and we don't have any special requirements.

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

8 years ago[VFS] Fix call to getVFSFromYAML in unittests
Bruno Cardoso Lopes [Mon, 22 Feb 2016 19:02:27 +0000 (19:02 +0000)]
[VFS] Fix call to getVFSFromYAML in unittests

Follow up from r261552

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

8 years ago[VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:09 +0000 (18:41 +0000)]
[VFS] Add 'overlay-relative' field to YAML files

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

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

rdar://problem/24499339

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

8 years ago[VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:01 +0000 (18:41 +0000)]
[VFS] Add support for handling path traversals

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

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

rdar://problem/24499339

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

8 years agoAdd has_feature attribute_availability_with_strict.
Manman Ren [Mon, 22 Feb 2016 18:24:30 +0000 (18:24 +0000)]
Add has_feature attribute_availability_with_strict.

rdar://23791325

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

8 years ago[analyzer] Detect duplicate [super dealloc] calls
Devin Coughlin [Mon, 22 Feb 2016 17:56:24 +0000 (17:56 +0000)]
[analyzer] Detect duplicate [super dealloc] calls

Add an alpha path checker that warns about duplicate calls to [super dealloc].
This will form the foundation of a checker that will detect uses of
'self' after calling [super dealloc].

Part of rdar://problem/6953275.

Based on a patch by David Kilzer!

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

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

8 years agoDon't enable /GX by default
David Majnemer [Mon, 22 Feb 2016 17:44:51 +0000 (17:44 +0000)]
Don't enable /GX by default

The /GX flag is disabled unless explicitly specified on the command
line.  This partially addresses PR26698.

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

8 years ago[MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ vbases
David Majnemer [Mon, 22 Feb 2016 17:22:08 +0000 (17:22 +0000)]
[MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ vbases

We gave a VBTable dllimport storage class and external linkage while
also providing an initializer.  An initializer is only valid if the
VBTable has available_externally linkage.  Fix this by setting the
linkage to available_externally in situ while generating the
initializer.

This fixes PR26686.

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

8 years agoAdd a test for r261425.
David Majnemer [Mon, 22 Feb 2016 17:22:01 +0000 (17:22 +0000)]
Add a test for r261425.

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