]> granicus.if.org Git - clang/log
clang
8 years agorevert SVN r265702, r265640
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:00 +0000 (16:52 +0000)]
revert SVN r265702, r265640

Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

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

8 years ago[OpenCL] Complete image types support.
Alexey Bader [Fri, 8 Apr 2016 13:40:33 +0000 (13:40 +0000)]
[OpenCL] Complete image types support.

I. Current implementation of images is not conformant to spec in the following points:
  1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine:

        void write_image(write_only image2d_t img);
        kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code

     which is disallowed according to s6.13.14.

  2. It discards access qualifier on generated code, which leads to generated code for the above example:

        call void @write_image(%opencl.image2d_t* %img);

     In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images.
     Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently.

  3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names.
  4. Default access qualifier read_only is to be added if not provided explicitly.

II. This patch corrects the above points as follows:
  1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type.
  2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers).
  3. Improves testing of images in Clang.

Author: Anastasia Stulova
Reviewers: bader, mgrang.
Subscribers: pxli168, pekka.jaaskelainen, yaxunl.
Differential Revision: http://reviews.llvm.org/D17821

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

8 years agoSilencing a 32-bit shift implicit conversion warning from MSVC; NFC.
Aaron Ballman [Fri, 8 Apr 2016 12:21:58 +0000 (12:21 +0000)]
Silencing a 32-bit shift implicit conversion warning from MSVC; NFC.

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

8 years agoAdapt to LLVM API change
Sanjoy Das [Fri, 8 Apr 2016 01:31:02 +0000 (01:31 +0000)]
Adapt to LLVM API change

Replace mayBeOverridden with isInterposable

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

8 years ago[modules] Add a comment to explain why -E leaves some #includes in the preprocessed...
Richard Smith [Fri, 8 Apr 2016 01:23:59 +0000 (01:23 +0000)]
[modules] Add a comment to explain why -E leaves some #includes in the preprocessed output.

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

8 years ago[modules] Don't write @import in -E output if the current language mode doesn't
Richard Smith [Fri, 8 Apr 2016 00:09:53 +0000 (00:09 +0000)]
[modules] Don't write @import in -E output if the current language mode doesn't
support @import; use the form as written instead.

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

8 years ago[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.
Justin Lebar [Thu, 7 Apr 2016 23:55:53 +0000 (23:55 +0000)]
[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.

Summary:
See comments in patch; we were assuming that some stdlib math functions
would be defined in namespace std, when in fact the spec says they
should be defined in the global namespace.  libstdc++4.9 became more
conforming and broke us.

This new implementation seems to cover the known knowns.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

8 years agoReplace Sema-level implementation of -fassume-sane-operator-new with a
Richard Smith [Thu, 7 Apr 2016 21:46:12 +0000 (21:46 +0000)]
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.

This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).

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

8 years ago[modules] Allow differences in flags that only affect preprocessor predefines
Richard Smith [Thu, 7 Apr 2016 20:47:37 +0000 (20:47 +0000)]
[modules] Allow differences in flags that only affect preprocessor predefines
(and __has_feature checks) between explicitly-specified module files and the
current compilation.

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

8 years ago[ObjC kindof] Use type bound to filter out the candidate methods.
Manman Ren [Thu, 7 Apr 2016 19:32:24 +0000 (19:32 +0000)]
[ObjC kindof] Use type bound to filter out the candidate methods.

rdar://21306753

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

8 years agoNFC: simplify code in BuildInstanceMessage.
Manman Ren [Thu, 7 Apr 2016 19:30:20 +0000 (19:30 +0000)]
NFC: simplify code in BuildInstanceMessage.

Instead of searching the global pool multiple times: in
LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool,
CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool,
we now collect the method candidates in CollectMultipleMethodsInGlobalPool
only, and other functions will use the collected method set.

This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool,
and SelectBestMethod. It also changes the implementation of
CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is
found, to collect the other kind. This avoids the need to call both
LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool.

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

8 years agoBasic: move CodeGenOptions from Frontend
Saleem Abdulrasool [Thu, 7 Apr 2016 17:49:44 +0000 (17:49 +0000)]
Basic: move CodeGenOptions from Frontend

This is a mechanical move of CodeGenOptions from libFrontend to libBasic.  This
fixes the layering violation introduced earlier by threading CodeGenOptions into
TargetInfo.  It should also fix the modules based self-hosting builds.  NFC.

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

8 years agoMinor Wdocumentation fix. NFCI.
Simon Pilgrim [Thu, 7 Apr 2016 17:38:24 +0000 (17:38 +0000)]
Minor Wdocumentation fix. NFCI.

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

8 years agoFixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177
Michael Zuckerman [Thu, 7 Apr 2016 14:44:08 +0000 (14:44 +0000)]
Fixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177

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

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

8 years agomake __builtin_isfinite more efficient (PR27145)
Sanjay Patel [Thu, 7 Apr 2016 14:29:05 +0000 (14:29 +0000)]
make __builtin_isfinite more efficient (PR27145)

isinf (is infinite) and isfinite should be implemented with the same function
except we change the comparison operator.

See PR27145 for more details:
https://llvm.org/bugs/show_bug.cgi?id=27145

Ref: forked off of the discussion in D18513.

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

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

8 years ago[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
Alexey Bataev [Thu, 7 Apr 2016 12:45:37 +0000 (12:45 +0000)]
[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
construct.

OpenMP 4.0 defines '#pragma omp declare simd' construct that may have
associated 'simdlen' clause with constant positive expression as an
argument:
simdlen(<const_expr>)
Patch adds parsin and semantic analysis for simdlen clause.

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

8 years agoMove class into an anonymous namespace. NFC.
Benjamin Kramer [Thu, 7 Apr 2016 10:14:54 +0000 (10:14 +0000)]
Move class into an anonymous namespace. NFC.

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

8 years agoBasic: thread CodeGenOptions into TargetInfo
Saleem Abdulrasool [Thu, 7 Apr 2016 05:41:11 +0000 (05:41 +0000)]
Basic: thread CodeGenOptions into TargetInfo

This threads CodeGenOptions into the TargetInfo hierarchy.  This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi).  Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful.  NFC.

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

8 years agoDon't use PATH_MAX.
Sean Silva [Thu, 7 Apr 2016 01:58:14 +0000 (01:58 +0000)]
Don't use PATH_MAX.

This is a SmallVector anyway, and so the exact size doesn't matter.

clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
        llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'

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

8 years ago[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:12:18 +0000 (01:12 +0000)]
[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h

Use toUppercase instead of ::toupper()

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

8 years ago[CrashReproducer] Change std::toupper to ::toupper
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:04:09 +0000 (01:04 +0000)]
[CrashReproducer] Change std::toupper to ::toupper

Attempt to fix windows bots

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

8 years ago[CrashReproducer] Setup 'case-sensitive' in YAML files.
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:57 +0000 (00:00 +0000)]
[CrashReproducer] Setup 'case-sensitive' in YAML files.

The crash reproducer was not setting up case sensitivity in the
VFS yaml files, which defaults to true. Make the crash reproducer
explicitly set that flag based on the case sensitivity of the .cache
path where vfs and modules are dumped.

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

8 years ago[CrashReproducer] Move ModuleDependencyCollector method around. NFC
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:42 +0000 (00:00 +0000)]
[CrashReproducer] Move ModuleDependencyCollector method around. NFC

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

8 years agoNFC: use AtomicOrdering isStrongerThan
JF Bastien [Wed, 6 Apr 2016 23:37:36 +0000 (23:37 +0000)]
NFC: use AtomicOrdering isStrongerThan

Summary: As discussed in D18775.

Reviewers: jyknight

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

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

8 years agoKeep -fmodule-implementation-of as an alias of -fmodule-name.
Manman Ren [Wed, 6 Apr 2016 23:28:26 +0000 (23:28 +0000)]
Keep -fmodule-implementation-of as an alias of -fmodule-name.

This helps us transitioning to -fmodule-name. Once the transitioning is done,
we can remove this alias.

rdar://24800983

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

8 years agoRevert "Set the default C standard to C99 when targeting the PS4."
Sean Silva [Wed, 6 Apr 2016 21:06:52 +0000 (21:06 +0000)]
Revert "Set the default C standard to C99 when targeting the PS4."

This reverts r265359.

It breaks
- llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
- llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

Failing Tests (5):
    Clang :: FixIt/fixit-errors.c
    Clang :: Preprocessor/init.c
    Clang :: Sema/attr-deprecated.c
    Clang :: Sema/nullability.c
    Clang :: SemaObjC/objcbridge-attribute-arc.m

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

8 years ago[modules] Add forgotten test case to r265597.
Vassil Vassilev [Wed, 6 Apr 2016 20:58:12 +0000 (20:58 +0000)]
[modules] Add forgotten test case to r265597.

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

8 years agoFix order-of-evaluation bug (causing GCC buildbots to fail).
Richard Smith [Wed, 6 Apr 2016 20:57:53 +0000 (20:57 +0000)]
Fix order-of-evaluation bug (causing GCC buildbots to fail).

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

8 years ago[modules] Don't try to add lookup results to non-lookup contexts.
Vassil Vassilev [Wed, 6 Apr 2016 20:56:03 +0000 (20:56 +0000)]
[modules] Don't try to add lookup results to non-lookup contexts.

Fixes https://llvm.org/bugs/show_bug.cgi?id=27186

Patch reviewed by Richard Smith.

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

8 years agoMinor simplifications.
Richard Smith [Wed, 6 Apr 2016 20:12:34 +0000 (20:12 +0000)]
Minor simplifications.

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

8 years agoRestore slightly less dodgy diagnostic handler for inline asm
Tim Northover [Wed, 6 Apr 2016 19:58:07 +0000 (19:58 +0000)]
Restore slightly less dodgy diagnostic handler for inline asm

Turns out it was there mostly to prevent Clang asking people to report a bug.
This time we report something to Clang's real diagnostics handler so that it
exits with something approximating a real error and tidies up after itself.

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

8 years agoDiagnose template alias declarations in local classes.
Richard Smith [Wed, 6 Apr 2016 17:38:58 +0000 (17:38 +0000)]
Diagnose template alias declarations in local classes.

Patch by Erik Pilkington!

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

8 years agoNFC: make AtomicOrdering an enum class
JF Bastien [Wed, 6 Apr 2016 17:26:42 +0000 (17:26 +0000)]
NFC: make AtomicOrdering an enum class

Summary: See LLVM change D18775 for details, this change depends on it.

Reviewers: jyknight, reames

Subscribers: cfe-commits

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

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

8 years agoRe-commit r265518 ("[modules] Continue factoring encoding of AST records out of
Richard Smith [Wed, 6 Apr 2016 17:06:00 +0000 (17:06 +0000)]
Re-commit r265518 ("[modules] Continue factoring encoding of AST records out of
ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug
(thanks, MSan!).

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

8 years agoclang-format: Fix label-in-if statement in macros where it is actually used.
Daniel Jasper [Wed, 6 Apr 2016 16:41:39 +0000 (16:41 +0000)]
clang-format: Fix label-in-if statement in macros where it is actually used.

Before:
  #define A \
    if (a)  \
    label:  \
    f()

After:
  #define A \
    if (a)  \
    label:  \
      f()

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

8 years agoEnable PIE for CloudABI.
Ed Schouten [Wed, 6 Apr 2016 15:37:06 +0000 (15:37 +0000)]
Enable PIE for CloudABI.

As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.

PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.

Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.

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

8 years agoclang-format: Support labels in brace-less ifs.
Daniel Jasper [Wed, 6 Apr 2016 15:02:46 +0000 (15:02 +0000)]
clang-format: Support labels in brace-less ifs.

While I am not personally convinced about the usefulness of this
construct, we should break it.

Before:
  if (a) label:
  f();

After:
  if (a)
  label:
    f();

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

8 years agoclang-format: Fix incorrect function annotation detection.
Daniel Jasper [Wed, 6 Apr 2016 13:58:09 +0000 (13:58 +0000)]
clang-format: Fix incorrect function annotation detection.

Before:
  MACRO(
      abc).function() // wrap
      << abc;

After:
  MACRO(abc).function() // wrap
      << abc;

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

8 years ago[OPENMP] Parsing and Sema support for 'omp declare target' directive
Dmitry Polukhin [Wed, 6 Apr 2016 11:38:59 +0000 (11:38 +0000)]
[OPENMP] Parsing and Sema support for 'omp declare target' directive

Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0
(4.5 support will be added in separate patch).

The declare target directive specifies that variables, functions (C, C++
and Fortran), and subroutines (Fortran) are mapped to a device. The declare
target directive is a declarative directive. In Clang declare target is
implemented as implicit attribute for the declaration.

The syntax of the declare target directive is as follows:

 #pragma omp declare target
 declarations-definition-seq
 #pragma omp end declare target

Based on patch from Michael Wong http://reviews.llvm.org/D15321

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

8 years agoRevert "[modules] Continue factoring encoding of AST records out of ASTWriter."
Dmitry Polukhin [Wed, 6 Apr 2016 10:01:46 +0000 (10:01 +0000)]
Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."

This reverts commit r265518.

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

8 years ago[modules] Continue factoring encoding of AST records out of ASTWriter.
Richard Smith [Wed, 6 Apr 2016 06:26:08 +0000 (06:26 +0000)]
[modules] Continue factoring encoding of AST records out of ASTWriter.

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

8 years agoUpdate testing cases after backend changes.
Manman Ren [Tue, 5 Apr 2016 23:27:51 +0000 (23:27 +0000)]
Update testing cases after backend changes.

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

8 years agoFix a crash on invalid with template handling
Richard Trieu [Tue, 5 Apr 2016 21:13:54 +0000 (21:13 +0000)]
Fix a crash on invalid with template handling

This is a fix for https://llvm.org/bugs/show_bug.cgi?id=25561 which was a
crash on invalid.  Change the handling of invalid decls to have a catch-all
case to prevent unexpecting decls from triggering an assertion.

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

8 years agoFix broken tests from no-jump-table commit
Nirav Dave [Tue, 5 Apr 2016 18:59:37 +0000 (18:59 +0000)]
Fix broken tests from no-jump-table commit

Summary: Fix failing tests from no-jump-table flag addition

Reviewers: jyknight

Subscribers: llvm-commits

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

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

8 years ago[CUDA] Show --cuda-gpu-arch option in clang --help.
Justin Lebar [Tue, 5 Apr 2016 18:26:25 +0000 (18:26 +0000)]
[CUDA] Show --cuda-gpu-arch option in clang --help.

For some reason it was hidden.

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

8 years ago[CUDA] Add -fcuda-flush-denormals-to-zero.
Justin Lebar [Tue, 5 Apr 2016 18:26:20 +0000 (18:26 +0000)]
[CUDA] Add -fcuda-flush-denormals-to-zero.

Summary:
Setting this flag causes all functions are annotated with the
"nvvm-f32ftz" = "true" attribute.

In addition, we annotate the module with "nvvm-reflect-ftz" set
to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set.
This is read by the NVVMReflect pass.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

8 years agoFix missing period in no-jump-table flag comment. NFC.
Nirav Dave [Tue, 5 Apr 2016 18:11:01 +0000 (18:11 +0000)]
Fix missing period in no-jump-table flag comment. NFC.

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

8 years agoAdd -fno-jump-tables and-fjump-tables flags
Nirav Dave [Tue, 5 Apr 2016 17:50:43 +0000 (17:50 +0000)]
Add -fno-jump-tables and-fjump-tables flags

Add no-jump-tables flag to disable use of jump tables when lowering
switch statements

Reviewers: echristo, hans

Subscribers: llvm-commits

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

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

8 years ago[X86] Introduction of -march=lakemont.
Andrey Turetskiy [Tue, 5 Apr 2016 15:04:26 +0000 (15:04 +0000)]
[X86] Introduction of -march=lakemont.

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

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

8 years agoclang-format: Fix cast detection on "this".
Daniel Jasper [Tue, 5 Apr 2016 11:46:06 +0000 (11:46 +0000)]
clang-format: Fix cast detection on "this".

Before:
  auto x = (X) this;

After:
  auto x = (X)this;

This fixes llvm.org/PR27198.

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

8 years agoConsolidate and improve the handling of built-in feature-like macros
Andy Gibbs [Tue, 5 Apr 2016 08:36:47 +0000 (08:36 +0000)]
Consolidate and improve the handling of built-in feature-like macros

Summary:
The parsing logic has been separated out from the macro implementation logic, leading to a number of improvements:

* Gracefully handle unexpected/invalid tokens, too few, too many and nested parameters
* Provide consistent behaviour between all built-in feature-like macros
* Simplify the implementation of macro logic
* Fix __is_identifier to correctly return '0' for non-identifiers

Reviewers: doug.gregor, rsmith

Subscribers: rsmith, cfe-commits

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

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

8 years agoMove local helper class into anonymous namespace.
Richard Smith [Mon, 4 Apr 2016 23:29:43 +0000 (23:29 +0000)]
Move local helper class into anonymous namespace.

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

8 years agoFix test failure from r265361
Reid Kleckner [Mon, 4 Apr 2016 23:14:14 +0000 (23:14 +0000)]
Fix test failure from r265361

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

8 years agoSet the default C standard to C99 when targeting the PS4.
Sunil Srivastava [Mon, 4 Apr 2016 22:56:05 +0000 (22:56 +0000)]
Set the default C standard to C99 when targeting the PS4.

Patch by Douglas Yung!

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

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

8 years agoFix "suggest parentheses" warning.
James Y Knight [Mon, 4 Apr 2016 22:35:56 +0000 (22:35 +0000)]
Fix "suggest parentheses" warning.

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

8 years agoFix an unused-variable warning by using the variable in the place
John McCall [Mon, 4 Apr 2016 20:39:50 +0000 (20:39 +0000)]
Fix an unused-variable warning by using the variable in the place
it was supposed to have been used.

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

8 years ago[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using...
Bruno Cardoso Lopes [Mon, 4 Apr 2016 20:26:57 +0000 (20:26 +0000)]
[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs

The reproducer should use -I/-F/-resource-dir in the same way as the
original command. The VFS already collects the right headers but without
these flags the reproducer will fail to do the right thing.

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

8 years ago[Sema] Delete FIXME that has been fixed. NFC.
George Burgess IV [Mon, 4 Apr 2016 19:44:16 +0000 (19:44 +0000)]
[Sema] Delete FIXME that has been fixed. NFC.

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

8 years agoFix redundant "typename typename T" in Visual Studio Native Visualizer
Mike Spertus [Mon, 4 Apr 2016 19:36:48 +0000 (19:36 +0000)]
Fix redundant "typename typename T" in Visual Studio Native Visualizer

Also, a little minor cleanup

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

8 years agoAssignment operators should return by reference.
John McCall [Mon, 4 Apr 2016 18:53:01 +0000 (18:53 +0000)]
Assignment operators should return by reference.

Thanks to Sean Silva for pointing this out.

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

8 years agoAdd copyright notice to the modulemap file.
Yunzhong Gao [Mon, 4 Apr 2016 18:46:09 +0000 (18:46 +0000)]
Add copyright notice to the modulemap file.

The module.modulemap file in the lib/Headers directory was missing the LLVM
copyright notice. This patch adds the copyright notice just like the rest of
the files in this directory.

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

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

8 years agoIRGen-level lowering for the Swift calling convention.
John McCall [Mon, 4 Apr 2016 18:33:08 +0000 (18:33 +0000)]
IRGen-level lowering for the Swift calling convention.

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

8 years agoAdd a couple of convenience operations to CharUnits.
John McCall [Mon, 4 Apr 2016 18:33:00 +0000 (18:33 +0000)]
Add a couple of convenience operations to CharUnits.

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

8 years ago[OPENMP] Codegen for teams directive for NVPTX
Carlo Bertolli [Mon, 4 Apr 2016 15:55:02 +0000 (15:55 +0000)]
[OPENMP] Codegen for teams directive for NVPTX

This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it:

Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region.
Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime.
Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region.

http://reviews.llvm.org/D17963

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

8 years agoAnnotateFunctions: Tweak for mingw.
NAKAMURA Takumi [Mon, 4 Apr 2016 15:30:44 +0000 (15:30 +0000)]
AnnotateFunctions: Tweak for mingw.

  - Externalize the registry.
  - Update libdeps.

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

8 years agoAdd a PragmaHandler Registry for plugins to add PragmaHandlers to
John Brawn [Mon, 4 Apr 2016 14:22:58 +0000 (14:22 +0000)]
Add a PragmaHandler Registry for plugins to add PragmaHandlers to

This allows plugins which add AST passes to also define pragmas to do things
like only enable certain behaviour of the AST pass in files where a certain
pragma is used.

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

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

8 years ago[OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
Alexey Bataev [Mon, 4 Apr 2016 10:12:15 +0000 (10:12 +0000)]
[OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
simd'.

Added parsing/semantic analysis for 'inbranch|notinbranch' clauses of
'#pragma omp declare simd' construct.

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

8 years agoFix test case committed in r265197.
Akira Hatanaka [Sun, 3 Apr 2016 03:36:22 +0000 (03:36 +0000)]
Fix test case committed in r265197.

The test was failing on some release build because the basic block names
I was expecting weren't printed.

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

8 years ago[c-index-test] Fix leak in print_completion_result, NFC
Vedant Kumar [Sun, 3 Apr 2016 00:54:46 +0000 (00:54 +0000)]
[c-index-test] Fix leak in print_completion_result, NFC

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

8 years agoclang-cl: Don't skip i_group flags other than -include when building pchs.
Nico Weber [Sat, 2 Apr 2016 19:10:07 +0000 (19:10 +0000)]
clang-cl: Don't skip i_group flags other than -include when building pchs.

Before this change, e.g. -isystem flags in front of the /FI corresponding to the
pch file would be incorrectly ignored.

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

8 years ago[test] Don't use "UNSUPPORTED" in FileCheck prefixes
Greg Parker [Sat, 2 Apr 2016 05:29:00 +0000 (05:29 +0000)]
[test] Don't use "UNSUPPORTED" in FileCheck prefixes

lit uses "UNSUPPORTED:" for its own purposes and may be
confused if that text appears elsewhere in the test file.

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

8 years ago[Objective-C] Introduce objc_runtime_visible attribute.
Douglas Gregor [Fri, 1 Apr 2016 23:23:52 +0000 (23:23 +0000)]
[Objective-C] Introduce objc_runtime_visible attribute.

The objc_runtime_visible attribute deals with an odd corner case where
a particular Objective-C class is known to the Objective-C runtime
(and, therefore, accessible by name) but its symbol has been hidden
for some reason. For such classes, teach CodeGen to use
objc_lookUpClass to retrieve the Class object, rather than referencing
the class symbol directly.

Classes annotated with objc_runtime_visible have two major limitations
that fall out from places where Objective-C metadata needs to refer to
the class (or metaclass) symbol directly:

* One cannot implement a subclass of an objc_runtime_visible class.
* One cannot implement a category on an objc_runtime_visible class.

Implements rdar://problem/25494092.

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

8 years ago[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
Akira Hatanaka [Fri, 1 Apr 2016 22:58:55 +0000 (22:58 +0000)]
[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
landing pads.

Previously, lifetime.end intrinsics were inserted only on normal control
flows. This prevented StackColoring from merging stack slots for objects
that were destroyed on the exception handling control flow since it
couldn't tell their lifetime ranges were disjoint. This patch fixes
code-gen to emit the intrinsic on both control flows.

rdar://problem/22181976

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

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

8 years ago[modules] Start moving the code for encoding AST records out of ASTWriter into
Richard Smith [Fri, 1 Apr 2016 22:52:03 +0000 (22:52 +0000)]
[modules] Start moving the code for encoding AST records out of ASTWriter into
a separate class. The goal is for this class to have a separate lifetime from
the AST writer so that it can meaningfully track pending statement nodes and
context for more compact encoding of various types.

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

8 years agoClean up a couple more preprocessor tests to use match-full-lines.
James Y Knight [Fri, 1 Apr 2016 21:33:20 +0000 (21:33 +0000)]
Clean up a couple more preprocessor tests to use match-full-lines.

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

8 years agoDiagnose missing macro argument following charize operator.
Andy Gibbs [Fri, 1 Apr 2016 19:02:20 +0000 (19:02 +0000)]
Diagnose missing macro argument following charize operator.

For completeness, add a test-case for the equivalent stringize operator
diagnostic too.

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

8 years ago[CrashReproducer] Add -fmodule-cache-path to reproducer script
Bruno Cardoso Lopes [Fri, 1 Apr 2016 17:39:08 +0000 (17:39 +0000)]
[CrashReproducer] Add -fmodule-cache-path to reproducer script

The cc1 invocation in the reproducer script should contain a valid path in
-fmodule-cache-path; for that reuse "<name>.cache/module" dir we already
use to dump the vfs and modules.

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

8 years ago[OpenCL] Moved nosvm attribute handling in Sema to other OpenCL attrs
Anastasia Stulova [Fri, 1 Apr 2016 16:05:09 +0000 (16:05 +0000)]
[OpenCL] Moved nosvm attribute handling in Sema to other OpenCL attrs

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

8 years ago[OPENMP] Fixed documentation category for 'declare simd' attribute, NFC.
Alexey Bataev [Fri, 1 Apr 2016 10:12:06 +0000 (10:12 +0000)]
[OPENMP] Fixed documentation category for 'declare simd' attribute, NFC.

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

8 years ago[Lexer] Let the compiler infer string lengths. No functionality change intended.
Benjamin Kramer [Fri, 1 Apr 2016 10:04:07 +0000 (10:04 +0000)]
[Lexer] Let the compiler infer string lengths. No functionality change intended.

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

8 years ago[Lexer] Don't read out of bounds if a conflict marker is at the end of a file
Benjamin Kramer [Fri, 1 Apr 2016 09:58:45 +0000 (09:58 +0000)]
[Lexer] Don't read out of bounds if a conflict marker is at the end of a file

This can happen as we look for '<<<<' while scanning tokens but then expect
'<<<<\n' to tell apart perforce from diff3 conflict markers. Just harden
the pointer arithmetic.

Found by libfuzzer + asan!

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

8 years ago[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC
Dmitry Polukhin [Fri, 1 Apr 2016 09:52:30 +0000 (09:52 +0000)]
[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC

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

8 years ago[OPENMP 4.5] Allow data members as loop counters in loop-based
Alexey Bataev [Fri, 1 Apr 2016 09:23:34 +0000 (09:23 +0000)]
[OPENMP 4.5] Allow data members as loop counters in loop-based
directives.

OpenMP 4.5 allows privatization of non-static data members in non-static
member functions. Patch allows to use and implicit privatization of data
members used as counters in loop-based directives.

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

8 years agoRevert "[OPENMP] Allow skip expression after comma in clauses with lists."
Alexey Bataev [Fri, 1 Apr 2016 08:43:42 +0000 (08:43 +0000)]
Revert "[OPENMP] Allow skip expression after comma in clauses with lists."

This reverts commit http://reviews.llvm.org/rL265003. After some
thoughts decided to emit errors here.

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

8 years agoVisual Studio native visualizers for clang::TemplateSpecializationType
Mike Spertus [Fri, 1 Apr 2016 03:31:43 +0000 (03:31 +0000)]
Visual Studio native visualizers for clang::TemplateSpecializationType

Displays a template specialization as, say, A<int, double>. Does not
yet handle UncommonTemplateNameStorage, QualifiedTemplateName, or
DependentTemplateName, but still more than worthwhile

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

8 years ago[analyzer] Prefer accessor method in extension over category in CallEvent.
Devin Coughlin [Fri, 1 Apr 2016 03:24:13 +0000 (03:24 +0000)]
[analyzer] Prefer accessor method in extension over category in CallEvent.

In ObjCMethodCall:getRuntimeDefinition(), if the method is an accessor in a
category, and it doesn't have a self declaration, first try to find the method
in a class extension. This works around a bug in Sema where multiple accessors
are synthesized for properties in class extensions that are redeclared in a
category. The implicit parameters are not filled in for the method on the
category, which causes a crash when trying to synthesize a getter for the
property in BodyFarm. The Sema bug is tracked as rdar://problem/25481164.

rdar://problem/25056531

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

8 years ago[CUDA] Fix typo in __clang_cuda_runtime_wrapper.h.
Justin Lebar [Fri, 1 Apr 2016 00:25:42 +0000 (00:25 +0000)]
[CUDA] Fix typo in __clang_cuda_runtime_wrapper.h.

We're #including the wrong file!

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

8 years agoAdapt to LLVM API change in r265077.
Adrian Prantl [Thu, 31 Mar 2016 23:57:45 +0000 (23:57 +0000)]
Adapt to LLVM API change in r265077.
EmissionKind moved from DIBuilder to DICompileUnit.

<rdar://problem/25427165>

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

8 years ago[index] Fix regression where ObjC method declarations may mistakenly get indexed...
Argyrios Kyrtzidis [Thu, 31 Mar 2016 20:18:22 +0000 (20:18 +0000)]
[index] Fix regression where ObjC method declarations may mistakenly get indexed as definition.

rdar://25372906

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

8 years agoDiagnostics: remove dodgy handler for bitcode inlineasm diagnostics.
Tim Northover [Thu, 31 Mar 2016 19:19:24 +0000 (19:19 +0000)]
Diagnostics: remove dodgy handler for bitcode inlineasm diagnostics.

Whatever crash it was there to present appears to have been fixed in the
backend now, and it had the nasty side-effect of causing clang to exit(0) and
leave a .o containing goodness knows what even when an error hit.

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

8 years ago[PGO] Avoid instrumenting constants at value sites
Betul Buyukkurt [Thu, 31 Mar 2016 18:41:34 +0000 (18:41 +0000)]
[PGO] Avoid instrumenting constants at value sites

Value profiling should not profile constants and/or constant
expressions when they appear as callees in call instructions.
Constant expressions form when a direct callee has bitcasts or
inttoptr(ptrtint (callee)) nests surrounding it. Value profiling
should avoid instrumenting such cases. Mostly NFC.

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

8 years agoFix the comment for the function added in r264998.
Akira Hatanaka [Thu, 31 Mar 2016 18:32:38 +0000 (18:32 +0000)]
Fix the comment for the function added in r264998.

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

8 years ago[OpenCL] Added nosvm attribute for OpenCL v2.0.
Anastasia Stulova [Thu, 31 Mar 2016 11:07:22 +0000 (11:07 +0000)]
[OpenCL] Added nosvm attribute for OpenCL v2.0.

It is not widely used and removed from OpenCL v2.1.

This change modifies Clang to parse the attribute for OpenCL
but ignores it afterwards.

Patch by Liu Yaxun (Sam)!

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

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

8 years ago[OPENMP] Support dumping OpenMP specific constructs.
Alexey Bataev [Thu, 31 Mar 2016 09:30:50 +0000 (09:30 +0000)]
[OPENMP] Support dumping OpenMP specific constructs.

Add proper dumping support for OpenMP declarations, directives and
clauses.

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

8 years ago[OPENMP] Allow skip expression after comma in clauses with lists.
Alexey Bataev [Thu, 31 Mar 2016 09:13:44 +0000 (09:13 +0000)]
[OPENMP] Allow skip expression after comma in clauses with lists.

Compatibility fix for better compatibility with the existing software.

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

8 years ago[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
Akira Hatanaka [Thu, 31 Mar 2016 06:36:07 +0000 (06:36 +0000)]
[CodeGenCXX] Fix ItaniumCXXABI::getAlignmentOfExnObject to return 8-byte
alignment on Darwin.

Itanium C++ ABI specifies that _Unwind_Exception should be double-word
aligned (16B). To conform to the ABI, libraries implementing exception
handling declare the struct with __attribute__((aligned)), which aligns
the unwindHeader field (and the end of __cxa_exception) to the default
target alignment (which is typically 16-bytes).

struct __cxa_exception {
  ...
  // struct is declared with __attribute__((aligned)).
  _Unwind_Exception unwindHeader;
};

Based on the assumption that _Unwind_Exception is declared with
__attribute__((aligned)), ItaniumCXXABI::getAlignmentOfExnObject returns
the target default alignment for __attribute__((aligned)). It turns out
that libc++abi, which is used on Darwin, doesn't declare the struct with
the attribute and therefore doesn't guarantee that unwindHeader is
aligned to the alignment specified by the ABI, which in some cases
causes the program to crash because of unaligned memory accesses.

This commit avoids crashes due to unaligned memory accesses by having
getAlignmentOfExnObject return an 8-byte alignment on Darwin. I've only
fixed the problem for Darwin, but we should also figure out whether other
platforms using libc++abi need similar fixes.

rdar://problem/25314277

Differential revision: http://reviews.llvm.org/D18479

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

8 years agoVisual Studio native visualization for clang::TemplateDecl
Mike Spertus [Thu, 31 Mar 2016 06:09:56 +0000 (06:09 +0000)]
Visual Studio native visualization for clang::TemplateDecl

With this change, TemplateDecls display in the Locals Window something like

  template<typename T, typename U> struct A;

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

8 years agoFix -Wdynamic-class-memaccess to skip invalid classes.
Richard Trieu [Thu, 31 Mar 2016 04:18:07 +0000 (04:18 +0000)]
Fix -Wdynamic-class-memaccess to skip invalid classes.

This warning sometimes will infinitely recurse on CXXRecordDecl's from
ill-formed recursive classes that have fields of themselves.  Skip processing
these classes to prevent this from happening.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27142

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

8 years ago[DarwinDriver] Increase the number of valid digits for ld64 version string.
Bruno Cardoso Lopes [Thu, 31 Mar 2016 02:45:46 +0000 (02:45 +0000)]
[DarwinDriver] Increase the number of valid digits for ld64 version string.

Previously only 3 digits were valid. Increase it to 5.

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

rdar://problem/24843016

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

8 years ago[Sema] Fix PR27122: ICE with enable_if+ill-formed call.
George Burgess IV [Thu, 31 Mar 2016 00:16:25 +0000 (00:16 +0000)]
[Sema] Fix PR27122: ICE with enable_if+ill-formed call.

In some cases, when we encounter a direct function call with an
incorrect number of arguments, we'll emit a diagnostic, and pretend that
the call to the function was valid. For example, in C:

int foo();
int a = foo(1);

Prior to this patch, we'd get an ICE if foo had an enable_if attribute,
because CheckEnableIf assumes that the number of arguments it gets
passed is valid for the function it's passed. Now, we check that the
number of args looks valid prior to checking enable_if conditions.

This fix was not done inside of CheckEnableIf because the problem
presently can only occur in one caller of CheckEnableIf (ActOnCallExpr).
Additionally, checking inside of CheckEnableIf would make us emit
multiple diagnostics for the same error (one "enable_if failed", one
"you gave this function the wrong number of arguments"), which seems
worse than just complaining about the latter.

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