]> granicus.if.org Git - clang/log
clang
8 years agoPR27549: fix bug that resulted in us giving a translation-unit-scope variable a
Richard Smith [Fri, 29 Apr 2016 01:23:20 +0000 (01:23 +0000)]
PR27549: fix bug that resulted in us giving a translation-unit-scope variable a
mangled name if it happened to be declared in an 'extern "C++"' context. This
also causes us to use the '_ZL' mangling rather than the '_Z' mangling for
internal-linkage entities that are wrapped in a language linkage construct.

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

8 years agoAvoid -Wshadow warnings about constructor parameters named after fields
Reid Kleckner [Fri, 29 Apr 2016 00:37:43 +0000 (00:37 +0000)]
Avoid -Wshadow warnings about constructor parameters named after fields

Usually these parameters are used solely to initialize the field in the
initializer list, and there is no real shadowing confusion.

There is a new warning under -Wshadow called
-Wshadow-field-in-constructor-modified. It attempts to find
modifications of such constructor parameters that probably intended to
modify the field.

It has some false negatives, though, so there is another warning group,
-Wshadow-field-in-constructor, which always warns on this special case.
For users who just want the old behavior and don't care about these fine
grained groups, we have a new warning group called -Wshadow-all that
activates everything.

Fixes PR16088.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

8 years ago[Sema] Fix a crash that occurs when a variable template is initialized
Akira Hatanaka [Thu, 28 Apr 2016 23:50:12 +0000 (23:50 +0000)]
[Sema] Fix a crash that occurs when a variable template is initialized
with a generic lambda.

This patch fixes Sema::InstantiateVariableInitializer to switch to the
context of the variable before instantiating its initializer, which is
necessary to set the correct type for VarTemplateSpecializationDecl.

This is the first part of the patch that was reviewed here:
http://reviews.llvm.org/D19175

rdar://problem/23440346

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

8 years agoDifferential Revision: http://reviews.llvm.org/D19687
Sriraman Tallam [Thu, 28 Apr 2016 22:34:00 +0000 (22:34 +0000)]
Differential Revision: http://reviews.llvm.org/D19687

Set module flag PIELevel. Simplify code that sets PICLevel flag.

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

8 years ago[clang][AVX512][Builtin] Adding intrinsics for the SAD instruction set.
Michael Zuckerman [Thu, 28 Apr 2016 21:21:08 +0000 (21:21 +0000)]
[clang][AVX512][Builtin] Adding intrinsics for the SAD instruction set.

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

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

8 years agoOne more fix for use of invalid PresumedLocs missed by r267914.
Richard Smith [Thu, 28 Apr 2016 19:54:51 +0000 (19:54 +0000)]
One more fix for use of invalid PresumedLocs missed by r267914.

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

8 years ago[analyzer] Add path note for localizability checker.
Devin Coughlin [Thu, 28 Apr 2016 19:44:40 +0000 (19:44 +0000)]
[analyzer] Add path note for localizability checker.

Add a path note indicating the location of the non-localized string
literal in NonLocalizedStringChecker.

rdar://problem/25981525

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

8 years agoFix use of uninitialized value exposed by r267802. Accessors of an invalid
Richard Smith [Thu, 28 Apr 2016 18:26:32 +0000 (18:26 +0000)]
Fix use of uninitialized value exposed by r267802. Accessors of an invalid
PresumedLoc should not be called.

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

8 years agoMake the test exercise all paths modified in r267746.
Paul Robinson [Thu, 28 Apr 2016 17:52:28 +0000 (17:52 +0000)]
Make the test exercise all paths modified in r267746.

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

8 years ago[OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different.
Yaxun Liu [Thu, 28 Apr 2016 17:34:57 +0000 (17:34 +0000)]
[OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different.

When comparing unqualified types, canonical types should be used, otherwise equivalent types may be treated as different type.

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

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

8 years agoDebug info: Apply an artificial debug location to __cyg_profile_func.* calls.
Adrian Prantl [Thu, 28 Apr 2016 17:21:56 +0000 (17:21 +0000)]
Debug info: Apply an artificial debug location to __cyg_profile_func.* calls.
The LLVM Verifier expects all inlinable calls in debuggable functions to
have a location.

rdar://problem/25818489

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

8 years agoRe-apply r267784, r267824 and r267830.
Peter Collingbourne [Thu, 28 Apr 2016 17:09:37 +0000 (17:09 +0000)]
Re-apply r267784, r267824 and r267830.

I have updated the compiler-rt tests.

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

8 years agoFix build.
Manuel Klimek [Thu, 28 Apr 2016 14:28:19 +0000 (14:28 +0000)]
Fix build.

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

8 years agoReland r267691 fixing PR27535.
Vassil Vassilev [Thu, 28 Apr 2016 14:13:28 +0000 (14:13 +0000)]
Reland r267691 fixing PR27535.

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

8 years agoAdd accidentally dropped test to r267880.
Tim Northover [Thu, 28 Apr 2016 14:01:49 +0000 (14:01 +0000)]
Add accidentally dropped test to r267880.

Forgot "git add".

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

8 years agoARMv7k: define __ARM_PCS_VFP since we're hard-float.
Tim Northover [Thu, 28 Apr 2016 13:59:55 +0000 (13:59 +0000)]
ARMv7k: define __ARM_PCS_VFP since we're hard-float.

It's a little debateable because we're not truly AAPCS, so I'm
certainly not going to define __ARM_PCS, but __ARM_PCS_VFP seems to be
really an "hard-float" define, which is a useful thing to have.

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

8 years ago[SystemZ] Support Swift calling convention
Bryan Chan [Thu, 28 Apr 2016 13:56:43 +0000 (13:56 +0000)]
[SystemZ] Support Swift calling convention

Summary:
Port rL265324 to SystemZ to allow using the 'swiftcall' attribute on that architecture.

Depends on D19414.

Reviewers: kbarton, rjmccall, uweigand

Subscribers: cfe-commits

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

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

8 years agoFix spuriously dematerializing reference bug. Fixes PR26612.
Manuel Klimek [Thu, 28 Apr 2016 13:37:45 +0000 (13:37 +0000)]
Fix spuriously dematerializing reference bug. Fixes PR26612.

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

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set
Michael Zuckerman [Thu, 28 Apr 2016 12:47:30 +0000 (12:47 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set

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

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

8 years ago[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.
Alexey Bataev [Thu, 28 Apr 2016 12:14:51 +0000 (12:14 +0000)]
[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.

OpenMP 4.5 defines 'taskloop simd' directive, which is combined
directive for 'taskloop' and 'simd' directives. Patch adds initial
codegen support for this directive and its 2 basic clauses 'safelen' and
'simdlen'.

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

8 years agoRevert r267784, r267824 and r267830.
Benjamin Kramer [Thu, 28 Apr 2016 12:14:47 +0000 (12:14 +0000)]
Revert r267784, r267824 and r267830.

It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

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

8 years agoRevert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"
Denis Zobnin [Thu, 28 Apr 2016 11:32:10 +0000 (11:32 +0000)]
Revert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"

This reverts commit r267866.

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

8 years agoPR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4
Silviu Baranga [Thu, 28 Apr 2016 11:29:08 +0000 (11:29 +0000)]
PR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4

Summary:
According to the ACLE spec, "__ARM_FEATURE_FMA is defined to 1 if
the hardware floating-point architecture supports fused floating-point
multiply-accumulate".

This changes clang's behaviour from emitting this macro for v7-A and v7-R
cores to only emitting it when the target has VFPv4 (and therefore support
for the floating point multiply-accumulate instruction).

Fixes PR27216

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, cfe-commits

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

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

8 years ago[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)
Denis Zobnin [Thu, 28 Apr 2016 10:13:18 +0000 (10:13 +0000)]
[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)

Rework implementation of several MS pragmas that use internal stack:
vtordisp, {bss|code|const|data}_seg.
This patch:
  1. Makes #pragma vtordisp use PragmaStack class as *_seg pragmas do;
  2. Fixes "#pragma vtordisp()" behavior: it shouldn't affect stack;
  3. Saves/restores the stacks on enter/exit a C++ method body.

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

8 years agoRevert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"
Dmitry Polukhin [Thu, 28 Apr 2016 09:56:22 +0000 (09:56 +0000)]
Revert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"

This reverts commit r267534.

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

8 years ago[OPENMP] Simplified interface for codegen of tasks, NFC.
Alexey Bataev [Thu, 28 Apr 2016 09:23:51 +0000 (09:23 +0000)]
[OPENMP] Simplified interface for codegen of tasks, NFC.

Reduced number of arguments in member functions of runtime support
library for task-based directives.

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

8 years ago[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
Alexey Bataev [Thu, 28 Apr 2016 09:15:06 +0000 (09:15 +0000)]
[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
directive.

OpenMP 4.5 defines 'taskloop' directive and 2 additional clauses
'grainsize' and 'num_tasks' for this directive. Patch adds codegen for
these clauses.
These clauses are generated as arguments of the '__kmpc_taskloop'
libcall and are encoded the following way:

void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup,  int sched, kmp_uint64 grainsize, void *task_dup);

If 'grainsize' is specified, 'sched' argument must be set to '1' and
'grainsize' argument must be set to the value of the 'grainsize' clause.
If 'num_tasks' is specified, 'sched' argument must be set to '2' and
'grainsize' argument must be set to the value of the 'num_tasks' clause.
It is possible because these 2 clauses are mutually exclusive and can't
be used at the same time on the same directive.
If none of these clauses is specified, 'sched' argument must be set to
'0'.

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

8 years agoremoved redundant '#'
Eric Liu [Thu, 28 Apr 2016 07:52:06 +0000 (07:52 +0000)]
removed redundant '#'

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

8 years agoAddressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.
Eric Liu [Thu, 28 Apr 2016 07:52:03 +0000 (07:52 +0000)]
Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

Summary: Make SourceManager in Environment, WhitespaceManager, and FormatTokenAnalyzer etc constant members.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

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

8 years agoAddressed review's comments.
Eric Liu [Thu, 28 Apr 2016 07:51:47 +0000 (07:51 +0000)]
Addressed review's comments.

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

8 years agoCGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]
NAKAMURA Takumi [Thu, 28 Apr 2016 02:45:21 +0000 (02:45 +0000)]
CGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]

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

8 years ago[analyzer] Move Checkers.inc to clang/include/...
Chih-Hung Hsieh [Thu, 28 Apr 2016 01:09:09 +0000 (01:09 +0000)]
[analyzer] Move Checkers.inc to clang/include/...

Simplify sharing of Checkers.inc with other files like ClangTidy.cpp.

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

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

8 years agoclang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi.
NAKAMURA Takumi [Thu, 28 Apr 2016 00:53:30 +0000 (00:53 +0000)]
clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi.

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

8 years agoDriver: only produce CFI -fvisibility= error when compiling.
Peter Collingbourne [Thu, 28 Apr 2016 00:18:30 +0000 (00:18 +0000)]
Driver: only produce CFI -fvisibility= error when compiling.

The -fvisibility= flag only affects compile jobs, so there's no need to
error out because of it if we aren't compiling (e.g. if we are only linking).

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

8 years ago[OpenMP] Code generation for target exit data directive
Samuel Antao [Wed, 27 Apr 2016 23:14:30 +0000 (23:14 +0000)]
[OpenMP] Code generation for target exit data directive

Summary:
This patch adds support for the target exit data directive code generation.

Given that, apart from the employed runtime call, target exit data requires the same code generation pattern as target enter data, the OpenMP codegen entry point was renamed and reused for both.

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

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[OpenMP] Code generation for target enter data directive
Samuel Antao [Wed, 27 Apr 2016 23:07:29 +0000 (23:07 +0000)]
[OpenMP] Code generation for target enter data directive

Summary: This patch adds support for the target enter data directive code generation.

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

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[OpenMP] Code generation for target data directive
Samuel Antao [Wed, 27 Apr 2016 22:58:19 +0000 (22:58 +0000)]
[OpenMP] Code generation for target data directive

Summary:
This patch adds support for the target data directive code generation.

Part of the already existent functionality related with data maps is moved to a new function so that it could be reused.

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

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[OpenMP] Map clause codegeneration.
Samuel Antao [Wed, 27 Apr 2016 22:40:57 +0000 (22:40 +0000)]
[OpenMP] Map clause codegeneration.

Summary:
Implement codegen for the map clause. All the new list items in 4.5 specification are supported.

Fix bug in the generation of array sections that was exposed by some of the map clause tests: for pointer types the offsets have to be calculated from the pointee not the pointer.

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

Subscribers: ABataev, cfe-commits, caomhin, fraggamuffin

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

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

8 years agoRemove unused LangOpts private variable in HeaderSearch.
Samuel Antao [Wed, 27 Apr 2016 22:28:32 +0000 (22:28 +0000)]
Remove unused LangOpts private variable in HeaderSearch.

Was causing warnings during the build.

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

8 years agoMinor test simplification (per David Blaikie suggestion).
Paul Robinson [Wed, 27 Apr 2016 22:18:46 +0000 (22:18 +0000)]
Minor test simplification (per David Blaikie suggestion).

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

8 years ago[modules] When diagnosing a missing module import, suggest adding a #include if
Richard Smith [Wed, 27 Apr 2016 21:57:05 +0000 (21:57 +0000)]
[modules] When diagnosing a missing module import, suggest adding a #include if
the current language doesn't have an import syntax and we can figure out a
suitable file to include.

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

8 years agoRevert unnecessary tblgen change.
Peter Collingbourne [Wed, 27 Apr 2016 20:49:44 +0000 (20:49 +0000)]
Revert unnecessary tblgen change.

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

8 years agoRework interface for bitset-using features to use a notion of LTO visibility.
Peter Collingbourne [Wed, 27 Apr 2016 20:39:53 +0000 (20:39 +0000)]
Rework interface for bitset-using features to use a notion of LTO visibility.

Bitsets, and the compiler features they rely on (vtable opt, CFI),
only have visibility within the LTO'd part of the linkage unit. Therefore,
only enable these features for classes with hidden LTO visibility. This
notion is based on object file visibility or (on Windows)
dllimport/dllexport attributes.

We provide the [[clang::lto_visibility_public]] attribute to override the
compiler's LTO visibility inference in cases where the class is defined
in the non-LTO'd part of the linkage unit, or where the ABI supports
calling classes derived from abstract base classes with hidden visibility
in other linkage units (e.g. COM on Windows).

If the cross-DSO CFI mode is enabled, bitset checks are emitted even for
classes with public LTO visibility, as that mode uses a separate mechanism
to cause bitsets to be exported.

This mechanism replaces the whole-program-vtables blacklist, so remove the
-fwhole-program-vtables-blacklist flag.

Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the
support for the special attr:uuid blacklist entry is removed.

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

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

8 years agoSet the default C standard to C99 when targeting the PS4.
Sunil Srivastava [Wed, 27 Apr 2016 19:53:03 +0000 (19:53 +0000)]
Set the default C standard to C99 when targeting the PS4.

Patch by Douglas Yung!

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

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

8 years agoCall TargetMachine::addEarlyAsPossiblePasses from BackendUtil.
Justin Lebar [Wed, 27 Apr 2016 19:12:56 +0000 (19:12 +0000)]
Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.

Summary:
As of D18614, TargetMachine exposes a hook to add a set of passes that should
be run as early as possible.  Invoke this hook from clang when setting up the
pass manager.

Reviewers: chandlerc

Subscribers: rnk, cfe-commits, tra

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

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

8 years ago[CMake] On Darwin bootstrap LTO builds set DYLD_LIBRARY_PATH instead of using llvm-ar
Chris Bieneman [Wed, 27 Apr 2016 18:52:48 +0000 (18:52 +0000)]
[CMake] On Darwin bootstrap LTO builds set DYLD_LIBRARY_PATH instead of using llvm-ar

llvm-ar isn't really supported for Darwin, instead the host tools will load libLTO, so we can use the just-built libLTO.

This actually makes Darwin bootstrap builds a little faster because you don't need to build llvm-ar before starting the next stage.

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

8 years agoPR21823: 'nodebug' attribute on global/static variables.
Paul Robinson [Wed, 27 Apr 2016 17:37:12 +0000 (17:37 +0000)]
PR21823: 'nodebug' attribute on global/static variables.

Make 'nodebug' on a global/static variable suppress all debug info
for the variable. Previously it would only suppress info for the
associated initializer function, if any.

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

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

8 years agoRevert r267691, it caused PR27535.
Nico Weber [Wed, 27 Apr 2016 17:26:08 +0000 (17:26 +0000)]
Revert r267691, it caused PR27535.

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

8 years agoModule debugging: Fix the DWO filename for PCH in a relative path.
Adrian Prantl [Wed, 27 Apr 2016 17:06:22 +0000 (17:06 +0000)]
Module debugging: Fix the DWO filename for PCH in a relative path.
PCH in a relative location had a redundant relative path on the DWO
filename and the DW_AT_compilation_dir.
This patch fixes this and adds testcases for PCH in the same directory,
in a relative, and an absolute location.

rdar://problem/25537947

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

8 years ago[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set
Michael Zuckerman [Wed, 27 Apr 2016 15:35:13 +0000 (15:35 +0000)]
[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set

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

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

8 years agoExpose cxx constructor and method properties through libclang and python bindings.
Jonathan Coe [Wed, 27 Apr 2016 12:48:25 +0000 (12:48 +0000)]
Expose cxx constructor and method properties through libclang and python bindings.

Summary:
I have exposed the following function through libclang and the clang.cindex python bindings:

clang_CXXConstructor_isConvertingConstructor,
clang_CXXConstructor_isCopyConstructor,
clang_CXXConstructor_isDefaultConstructor,
clang_CXXConstructor_isMoveConstructor,
clang_CXXMethod_isDefaulted

I need (some of) these methods for a C++ code model I am building in Python to drive a code generator.

Reviewers: compnerd, skalinichev

Subscribers: cfe-commits

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

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

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAS...
Michael Zuckerman [Wed, 27 Apr 2016 11:43:14 +0000 (11:43 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAST instruction set .

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

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

8 years ago[OPENMP] Fix crash on initialization of classes with no init clause in
Alexey Bataev [Wed, 27 Apr 2016 11:38:05 +0000 (11:38 +0000)]
[OPENMP] Fix crash on initialization of classes with no init clause in
declare reductions.

If reduction clause is applied to instance of class with user-defined
reduction operation without initialization clause, it may cause a crash.
Patch fixes this issue.

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

8 years ago[modules] Fix Decl's Used invariant.
Vassil Vassilev [Wed, 27 Apr 2016 10:46:06 +0000 (10:46 +0000)]
[modules] Fix Decl's Used invariant.

The Decl::isUsed has a value for every decl. In non-module builds it is very
difficult (but possible) to break this invariant but when we walk up the redecl
chain we find the neccessary information.

When deserializing the decls from a module it is much more difficult to update
correctly this invariant. The patch centralizes the information whether a decl
is used in the canonical decl marking the entire entity as being used.

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

Patch by Cristina Cristescu and me.

Thanks to Richard Smith who helped to debug and understand the issue!

Reviewed by Richard Smith.

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

8 years ago[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set
Michael Zuckerman [Wed, 27 Apr 2016 10:44:15 +0000 (10:44 +0000)]
[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set

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

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

8 years ago[OPENMP] Fix for codegen of captured variables in inlined directives.
Alexey Bataev [Wed, 27 Apr 2016 07:56:03 +0000 (07:56 +0000)]
[OPENMP] Fix for codegen of captured variables in inlined directives.

Currently there is a problem with codegen of inlined directives inside
lambdas, it may cause a crash during codegen because of incorrect
capturing of variables. Patch fixes this problem.

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

8 years agoUpdated doxygen comments for intrinsics.
Ekaterina Romanova [Wed, 27 Apr 2016 07:14:02 +0000 (07:14 +0000)]
Updated doxygen comments for intrinsics.
(1) Removed \code.. \endcode tags around the instruction name. This matches the doxygen format for all other intrinsics.
(2) Did a better formatting for the comments (to fit into 80 columns more compactly).

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

8 years agoModule debugging: Add an assertion.
Adrian Prantl [Tue, 26 Apr 2016 23:42:43 +0000 (23:42 +0000)]
Module debugging: Add an assertion.

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

8 years agoPR27513: When determining which declaration to put into an exported lookup
Richard Smith [Tue, 26 Apr 2016 23:40:43 +0000 (23:40 +0000)]
PR27513: When determining which declaration to put into an exported lookup
table for a module / PCH, never map from a normal declaration of a class to an
injected-class-name declaration (or vice versa). Those declarations live in
distinct lookup tables and should not be confused.

We really shouldn't be using a CXXRecordDecl to represent an
injected-class-name in the first place; I've filed PR27532 so we don't forget.

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

8 years agoModule debugging: Also correctly handle typedef'd foward-declared members.
Adrian Prantl [Tue, 26 Apr 2016 23:37:38 +0000 (23:37 +0000)]
Module debugging: Also correctly handle typedef'd foward-declared members.
Thanks again to Richard Smith for pointing this out.

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

8 years agoCheck 'r' and 'y specifiers of freebsd_kernel_printf format strings on PS4
Sunil Srivastava [Tue, 26 Apr 2016 23:19:00 +0000 (23:19 +0000)]
Check 'r' and 'y specifiers of freebsd_kernel_printf format strings on PS4

This is an addendum to r229921.

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

8 years agoModule debugging: Add testcase for member classes of class template specializations.
Adrian Prantl [Tue, 26 Apr 2016 21:58:23 +0000 (21:58 +0000)]
Module debugging: Add testcase for member classes of class template specializations.

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

8 years agoModule debugging: Use the definition to determine module-defined types.
Adrian Prantl [Tue, 26 Apr 2016 21:58:18 +0000 (21:58 +0000)]
Module debugging: Use the definition to determine module-defined types.

Follow-up to r267464. Thanks to Richard Smith for pointing this out!

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

8 years agoTest commit
Erik Pilkington [Tue, 26 Apr 2016 20:55:48 +0000 (20:55 +0000)]
Test commit

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

8 years agoTry to get at_file_missing.c passing after LLVM r267556.
Nico Weber [Tue, 26 Apr 2016 20:40:23 +0000 (20:40 +0000)]
Try to get at_file_missing.c passing after LLVM r267556.

r267556 made backslashes escape the next character
unconditionally in rsp files.  This test echos a path into
a rsp file, and paths contain backslashes on Windows. Since
it's not important for this test to get the filename from
the rsp file, just pass it regularly.

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

8 years ago[OpenCL] Add predefined macros.
Yaxun Liu [Tue, 26 Apr 2016 19:25:46 +0000 (19:25 +0000)]
[OpenCL] Add predefined macros.

OpenCL spec requires __OPENCL_C_VERSION__ to be defined based on -cl-std option. This patch implements that.

The patch also defines __FAST_RELAXED_MATH__ based on -cl-fast-relaxed-math option.

Also fixed a test using -std=c99 for OpenCL program. Limit allowed language standard of OpenCL to be OpenCL standards.

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

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

8 years ago[CMake] Use just-built clang and build iOS support when building stage2
Chris Bieneman [Tue, 26 Apr 2016 18:39:20 +0000 (18:39 +0000)]
[CMake] Use just-built clang and build iOS support when building stage2

The Apple stage2 build should include compiler-rt iOS libraries and be built with the stage2 compiler. This matches Apple's production clang builds.

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

8 years ago[SPIR] Remove an assert mandating SPIR for OpenCL sources only.
Anastasia Stulova [Tue, 26 Apr 2016 15:14:01 +0000 (15:14 +0000)]
[SPIR] Remove an assert mandating SPIR for OpenCL sources only.

SPIR target can be used for C/C++ inputs too (i.e. in OpenCL compatible mode for the libs creation).

Patch by Neil Henning!

Review: http://reviews.llvm.org/D19478

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

8 years ago[OpenMP] Improve mappable expressions Sema.
Samuel Antao [Tue, 26 Apr 2016 14:54:23 +0000 (14:54 +0000)]
[OpenMP] Improve mappable expressions Sema.

Summary:
This patch adds logic to save the components of mappable expressions in the clause that uses it, so that they don't have to be recomputed during codegen. Given that the mappable components are (will be) used in several clauses a new geneneric implementation `OMPMappableExprListClause` is used that extends the existing `OMPVarListClause`.

This patch does not add new tests. The goal is to preserve the existing functionality while storing more info in the clauses.

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

Subscribers: cfe-commits, caomhin

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

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

8 years agoUpdate test after LLVM r267556.
Nico Weber [Tue, 26 Apr 2016 13:54:29 +0000 (13:54 +0000)]
Update test after LLVM r267556.

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

8 years ago[MSVC] PR27337: allow static_cast from private base to derived for WTL
Dmitry Polukhin [Tue, 26 Apr 2016 09:21:17 +0000 (09:21 +0000)]
[MSVC] PR27337: allow static_cast from private base to derived for WTL

MSVC doesn't report even warning for cast from private base class to
derived.

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

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

8 years agotrying to fix the windows build broken by r267496
Kostya Serebryany [Tue, 26 Apr 2016 01:53:49 +0000 (01:53 +0000)]
trying to fix the windows build broken by r267496

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

8 years agoCGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]
NAKAMURA Takumi [Tue, 26 Apr 2016 00:45:00 +0000 (00:45 +0000)]
CGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]

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

8 years ago[Docs] Fix indentation error introduced by r267447.
George Burgess IV [Tue, 26 Apr 2016 00:31:29 +0000 (00:31 +0000)]
[Docs] Fix indentation error introduced by r267447.

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

8 years ago[lanai] Update handling of structs in arguments to be passed in registers.
Jacques Pienaar [Tue, 26 Apr 2016 00:09:29 +0000 (00:09 +0000)]
[lanai] Update handling of structs in arguments to be passed in registers.

Previously aggregate types were passed byval, change the ABI to pass these in registers instead.

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

8 years agodriver: Add a `--rsp-quoting` flag to pick response file quoting.
Nico Weber [Mon, 25 Apr 2016 21:15:49 +0000 (21:15 +0000)]
driver: Add a `--rsp-quoting` flag to pick response file quoting.

Currently, clang-cl always uses Windows style for unquoting, and clang always
uses POSIX style for unquoting.

With this flag, it's possible to change these defaults.

In general, response file quoting should match the shell the response file is
used in.  On Windows, it's possible to run clang-cl in a bash shell, or clang in
cmd.exe, so a flag for overriding the default behavior is natural there.

On non-Windows, Windows quoting probably never makes sense (except maybe in
Wine), but having clang-cl behave differently based on the host OS seems
strange too.  So require that people who want to use posix-style response
files with clang-cl on non-Windows pass --rsp-quoting=posix.

http://reviews.llvm.org/D19425

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

8 years agoModule Debugging: Fix the condition for determining whether a template
Adrian Prantl [Mon, 25 Apr 2016 20:52:40 +0000 (20:52 +0000)]
Module Debugging: Fix the condition for determining whether a template
instantiation is in a module.

This patch fixes the condition for determining whether the debug info for a
template instantiation will exist in an imported clang module by:

- checking whether the ClassTemplateSpecializationDecl is complete and
- checking that the instantiation was in a module by looking at the first field.

I also added a negative check to make sure that a typedef to a forward-declared
template (with the definition outside of the module) is handled correctly.

http://reviews.llvm.org/D19443
rdar://problem/25553724

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

8 years agoImplement support for conditional between xvalues of reference-compatible
Richard Smith [Mon, 25 Apr 2016 19:30:37 +0000 (19:30 +0000)]
Implement support for conditional between xvalues of reference-compatible
types. Patch by Erik Pilkington!

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

8 years agoRefactor traversal of bases in deduction of template parameters from base
Richard Smith [Mon, 25 Apr 2016 19:28:08 +0000 (19:28 +0000)]
Refactor traversal of bases in deduction of template parameters from base
classes of an argument to use CXXRecordDecl::forallBases. Fix forallBases to
only visit each base class once.

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

8 years ago[Docs] Clarify what the object-size sanitizer does.
George Burgess IV [Mon, 25 Apr 2016 19:21:45 +0000 (19:21 +0000)]
[Docs] Clarify what the object-size sanitizer does.

Currently, the UBSan docs make it sound like the object-size sanitizer
will only detect out-of-bounds reads/writes. It also catches some
operations that don't necessarily access memory (invalid downcasts,
calls of methods on invalid pointers, ...). This patch adds a note
about this behavior in the docs.

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

8 years agoWhen deducing template parameters from base classes of an argument type, don't
Richard Smith [Mon, 25 Apr 2016 19:09:05 +0000 (19:09 +0000)]
When deducing template parameters from base classes of an argument type, don't
preserve any deduced types from a failed deduction to a subsequent attempt at
deduction. Patch by Erik Pilkington!

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

8 years ago[Clang][Builtin][AVX512]Adding k-register logic intrinsics KAND, KANDN, KOR, KORTEST...
Michael Zuckerman [Mon, 25 Apr 2016 16:42:29 +0000 (16:42 +0000)]
[Clang][Builtin][AVX512]Adding k-register logic intrinsics KAND, KANDN, KOR, KORTEST, KXNOR, KXOR, KUNPACK instruction set.

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

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

8 years agoAdded Fixer implementation and fix() interface in clang-format for removing redundant...
Eric Liu [Mon, 25 Apr 2016 15:09:22 +0000 (15:09 +0000)]
Added Fixer implementation and fix() interface in clang-format for removing redundant code.

Summary:
After applying replacements, redundant code like extra commas or empty namespaces
might be introduced. Fixer can detect and remove any redundant code introduced by replacements.
The current implementation only handles redundant commas.

Reviewers: djasper, klimek

Subscribers: ioeric, mprobst, klimek, cfe-commits

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

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

8 years ago[Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} vfpclass{pd|ps} instruc...
Michael Zuckerman [Mon, 25 Apr 2016 14:48:23 +0000 (14:48 +0000)]
[Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} vfpclass{pd|ps} instruction set

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

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

8 years ago[analyzer] Let TK_PreserveContents span across the whole base region.
Artem Dergachev [Mon, 25 Apr 2016 14:44:25 +0000 (14:44 +0000)]
[analyzer] Let TK_PreserveContents span across the whole base region.

If an address of a field is passed through a const pointer,
the whole structure's base region should receive the
TK_PreserveContents trait and avoid invalidation.

Additionally, include a few FIXME tests shown up during testing.

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

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

8 years ago[Clang][AVX512][BUILTIN] Adding intrinsics for VSCATTERPF{1|0}{DPS|QPS|DPD|QPD} instr...
Michael Zuckerman [Mon, 25 Apr 2016 13:01:40 +0000 (13:01 +0000)]
[Clang][AVX512][BUILTIN] Adding intrinsics for VSCATTERPF{1|0}{DPS|QPS|DPD|QPD} instruction set

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

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

8 years ago[OPENMP 4.5] Codegen for 'taskloop' directive.
Alexey Bataev [Mon, 25 Apr 2016 12:22:29 +0000 (12:22 +0000)]
[OPENMP 4.5] Codegen for 'taskloop' directive.

The taskloop construct specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. The iterations are distributed across tasks created by the construct and scheduled to be executed.
The next code will be generated for the taskloop directive:
    #pragma omp taskloop num_tasks(N) lastprivate(j)
        for( i=0; i<N*GRAIN*STRIDE-1; i+=STRIDE ) {
          int th = omp_get_thread_num();
          #pragma omp atomic
            counter++;
          #pragma omp atomic
            th_counter[th]++;
          j = i;
    }

Generated code:
task = __kmpc_omp_task_alloc(NULL,gtid,1,sizeof(struct
task),sizeof(struct shar),&task_entry);
psh = task->shareds;
psh->pth_counter = &th_counter;
psh->pcounter = &counter;
psh->pj = &j;
task->lb = 0;
task->ub = N*GRAIN*STRIDE-2;
task->st = STRIDE;
__kmpc_taskloop(
NULL,             // location
gtid,             // gtid
task,             // task structure
1,                // if clause value
&task->lb,        // lower bound
&task->ub,        // upper bound
STRIDE,           // loop increment
0,                // 1 if nogroup specified
2,                // schedule type: 0-none, 1-grainsize, 2-num_tasks
N,                // schedule value (ignored for type 0)
(void*)&__task_dup_entry // tasks duplication routine
);

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

8 years ago[Clang][AVX512][BuiltIn] Adding support to intrinsics of VPERMD and VPERMW instructio...
Michael Zuckerman [Mon, 25 Apr 2016 05:32:35 +0000 (05:32 +0000)]
[Clang][AVX512][BuiltIn] Adding support to intrinsics of VPERMD and VPERMW instruction set

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

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

8 years agoDebug info: Apply an empty debug location for global OpenMP destructors.
Adrian Prantl [Sun, 24 Apr 2016 22:22:29 +0000 (22:22 +0000)]
Debug info: Apply an empty debug location for global OpenMP destructors.
LLVM really wants a debug location on every inlinable call in a function
with debug info, because it otherwise cannot set up inlining debug info.

This change applies an artificial line 0 debug location (which is how
DWARF marks automatically generated code that has no corresponding
source code) to the .__kmpc_global_dtor_. functions to avoid the
LLVM Verifier complaining.

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

8 years agoclang-format: [JS] generator and async functions.
Martin Probst [Sun, 24 Apr 2016 22:05:09 +0000 (22:05 +0000)]
clang-format: [JS] generator and async functions.

For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spec yet, but stage 3 and already widely used:
http://tc39.github.io/ecmascript-asyncawait/

Reviewers: djasper

Subscribers: klimek

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

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

8 years agoImprove diagnostic checking for va_start to also warn on other instances of undefined...
Aaron Ballman [Sun, 24 Apr 2016 13:30:21 +0000 (13:30 +0000)]
Improve diagnostic checking for va_start to also warn on other instances of undefined behavior, such as a parameter declared with the register keyword in C, or a parameter of a type that undergoes default argument promotion.

This helps cover some more of the CERT secure coding rule EXP58-CPP. Pass an object of the correct type to va_start (https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start).

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

8 years agoMake thinlto clang test more robust against LLVM changes.
Mehdi Amini [Sun, 24 Apr 2016 03:44:55 +0000 (03:44 +0000)]
Make thinlto clang test more robust against LLVM changes.

We should just test the effect of the clang level option here, i.e.
that a summary is correctly emitted with -flto=thin

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoFix a couple assertions that can never fire because the condition ANDed with the...
Craig Topper [Sun, 24 Apr 2016 02:08:22 +0000 (02:08 +0000)]
Fix a couple assertions that can never fire because the condition ANDed with the string is just true or 1.

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

8 years agoDebugInfo: DIGlobalVariables became 'distinct' in LLVM r267301
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 22:29:26 +0000 (22:29 +0000)]
DebugInfo: DIGlobalVariables became 'distinct' in LLVM r267301

Update testcases due to DIBuilder change.

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

8 years agoDebugInfo: Adapt to loss of DITypeRef in LLVM r267296
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:08:27 +0000 (21:08 +0000)]
DebugInfo: Adapt to loss of DITypeRef in LLVM r267296

LLVM stopped using MDString-based type references, and DIBuilder no
longer fills 'retainedTypes:' with every DICompositeType that has an
'identifier:' field.   There are just minor changes to keep the same
behaviour in CFE.

Leaving 'retainedTypes:' unfilled has a dramatic impact on the output
order of the IR though.  There are a huge number of testcase changes,
which were unfortunately not really scriptable.

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

8 years ago[profile] Fix another use of the driver.
Sean Silva [Sat, 23 Apr 2016 02:13:48 +0000 (02:13 +0000)]
[profile] Fix another use of the driver.

Follow-on to r267262.

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

8 years ago[profile] Use cc1 in these tests instead of the driver.
Sean Silva [Sat, 23 Apr 2016 02:11:16 +0000 (02:11 +0000)]
[profile] Use cc1 in these tests instead of the driver.

I ran into this when seeing what tests would break if we make a
driver-level decision about whether FEPGO or IRPGO is the default.

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

8 years agoRevert the bool portion of r267054
Richard Trieu [Fri, 22 Apr 2016 22:14:32 +0000 (22:14 +0000)]
Revert the bool portion of r267054

Remove the floating point to bool conversion warnings.  Some of these
conversions will be caught by -Wliteral-conversion and -Wfloat-conversion

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

8 years agoPGO] PGOFuncName meta data if PGOFuncName is different from function's raw name
Rong Xu [Fri, 22 Apr 2016 21:19:05 +0000 (21:19 +0000)]
PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name

Write out the PGOFuncName meta data if PGOFuncName is different from function's
raw name. This should only apply to internal linkage functions. This is to be
consumed by indirect-call promotion when called in LTO optimization pass.

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

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

8 years agoFix a bug involving deferred decl emission and PCH
Reid Kleckner [Fri, 22 Apr 2016 18:46:33 +0000 (18:46 +0000)]
Fix a bug involving deferred decl emission and PCH

For various reasons, involving dllexport and class linkage compuations,
we have to wait until after the semicolon after a class declaration to
emit inline methods. These are "deferred" decls. Before this change,
finishing the tag decl would trigger us to deserialize some PCH so that
we could make a "pretty" IR-level type. Deserializing the PCH triggered
calls to HandleTopLevelDecl, which, when done, checked the deferred decl
list, and emitted some dllexported decls that weren't ready.

Avoid this re-entrancy. Deferred decls should not get emitted when a tag
is finished, they should only be emitted after a real top level decl in
the main file.

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