Commit Graph

63440 Commits

Author SHA1 Message Date
Reid Kleckner f463a8a424 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

llvm-svn: 267957
2016-04-29 00:37:43 +00:00
Akira Hatanaka b87faffdb9 [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

llvm-svn: 267956
2016-04-28 23:50:12 +00:00
Sriraman Tallam 70e70e6eb9 Differential Revision: http://reviews.llvm.org/D19687
Set module flag PIELevel. Simplify code that sets PICLevel flag.

llvm-svn: 267948
2016-04-28 22:34:00 +00:00
Michael Zuckerman de8d3753d3 [clang][AVX512][Builtin] Adding intrinsics for the SAD instruction set.
Differential Revision: http://reviews.llvm.org/D19591

llvm-svn: 267942
2016-04-28 21:21:08 +00:00
Richard Smith 9c52767f36 One more fix for use of invalid PresumedLocs missed by r267914.
llvm-svn: 267926
2016-04-28 19:54:51 +00:00
Devin Coughlin 97dc0c8c29 [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

llvm-svn: 267924
2016-04-28 19:44:40 +00:00
Richard Smith 41e6629100 Fix use of uninitialized value exposed by r267802. Accessors of an invalid
PresumedLoc should not be called.

llvm-svn: 267914
2016-04-28 18:26:32 +00:00
Paul Robinson 9253135c15 Make the test exercise all paths modified in r267746.
llvm-svn: 267909
2016-04-28 17:52:28 +00:00
Yaxun Liu ab93394a29 [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

llvm-svn: 267906
2016-04-28 17:34:57 +00:00
Adrian Prantl 06f445d65b 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

llvm-svn: 267904
2016-04-28 17:21:56 +00:00
Peter Collingbourne 3afb266886 Re-apply r267784, r267824 and r267830.
I have updated the compiler-rt tests.

llvm-svn: 267903
2016-04-28 17:09:37 +00:00
Manuel Klimek 9db931021e Fix build.
llvm-svn: 267883
2016-04-28 14:28:19 +00:00
Vassil Vassilev 928c8254a9 Reland r267691 fixing PR27535.
llvm-svn: 267882
2016-04-28 14:13:28 +00:00
Tim Northover 3261799573 Add accidentally dropped test to r267880.
Forgot "git add".

llvm-svn: 267881
2016-04-28 14:01:49 +00:00
Tim Northover 28fc0e1fcd 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.

llvm-svn: 267880
2016-04-28 13:59:55 +00:00
Bryan Chan e3f1ed5805 [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

llvm-svn: 267879
2016-04-28 13:56:43 +00:00
Manuel Klimek 13b7064b55 Fix spuriously dematerializing reference bug. Fixes PR26612.
llvm-svn: 267877
2016-04-28 13:37:45 +00:00
Michael Zuckerman 533e065bdc [Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set
Differential Revision: http://reviews.llvm.org/D19588

llvm-svn: 267876
2016-04-28 12:47:30 +00:00
Alexey Bataev 1e73ef3882 [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'.

llvm-svn: 267872
2016-04-28 12:14:51 +00:00
Benjamin Kramer 5556a5cf3b 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."

llvm-svn: 267871
2016-04-28 12:14:47 +00:00
Denis Zobnin 801d9b0cc4 Revert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"
This reverts commit r267866.

llvm-svn: 267870
2016-04-28 11:32:10 +00:00
Silviu Baranga 632fdc5919 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

llvm-svn: 267869
2016-04-28 11:29:08 +00:00
Denis Zobnin 2008dbb4ed [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.

llvm-svn: 267866
2016-04-28 10:13:18 +00:00
Dmitry Polukhin 5b4faeec87 Revert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"
This reverts commit r267534.

llvm-svn: 267865
2016-04-28 09:56:22 +00:00
Alexey Bataev 24b5baed27 [OPENMP] Simplified interface for codegen of tasks, NFC.
Reduced number of arguments in member functions of runtime support
library for task-based directives.

llvm-svn: 267863
2016-04-28 09:23:51 +00:00
Alexey Bataev 2b19a6fe53 [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'.

llvm-svn: 267862
2016-04-28 09:15:06 +00:00
Eric Liu 8d59829947 removed redundant '#'
llvm-svn: 267860
2016-04-28 07:52:06 +00:00
Eric Liu 635423e618 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

llvm-svn: 267859
2016-04-28 07:52:03 +00:00
Eric Liu c5cad396dd Addressed review's comments.
llvm-svn: 267858
2016-04-28 07:51:47 +00:00
NAKAMURA Takumi 01d07dbee5 CGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]
llvm-svn: 267845
2016-04-28 02:45:21 +00:00
Chih-Hung Hsieh a9ad1552ab [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

llvm-svn: 267832
2016-04-28 01:09:09 +00:00
NAKAMURA Takumi 7caac53729 clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi.
llvm-svn: 267830
2016-04-28 00:53:30 +00:00
Peter Collingbourne f10237b689 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).

llvm-svn: 267824
2016-04-28 00:18:30 +00:00
Samuel Antao 8dd6628743 [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

llvm-svn: 267814
2016-04-27 23:14:30 +00:00
Samuel Antao bd0ae2e14c [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

llvm-svn: 267812
2016-04-27 23:07:29 +00:00
Samuel Antao df158d5567 [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

llvm-svn: 267811
2016-04-27 22:58:19 +00:00
Samuel Antao 86ace55d53 [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

llvm-svn: 267808
2016-04-27 22:40:57 +00:00
Samuel Antao 610954a5c9 Remove unused LangOpts private variable in HeaderSearch.
Was causing warnings during the build.

llvm-svn: 267805
2016-04-27 22:28:32 +00:00
Paul Robinson 1c6fc20608 Minor test simplification (per David Blaikie suggestion).
llvm-svn: 267804
2016-04-27 22:18:46 +00:00
Richard Smith 4eb8393c63 [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.

llvm-svn: 267802
2016-04-27 21:57:05 +00:00
Peter Collingbourne 7dab685e55 Revert unnecessary tblgen change.
llvm-svn: 267788
2016-04-27 20:49:44 +00:00
Peter Collingbourne a8b2f7c0d7 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

llvm-svn: 267784
2016-04-27 20:39:53 +00:00
Sunil Srivastava bf01080672 Set the default C standard to C99 when targeting the PS4.
Patch by Douglas Yung!

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

llvm-svn: 267772
2016-04-27 19:53:03 +00:00
Justin Lebar 5a7df9c130 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

llvm-svn: 267764
2016-04-27 19:12:56 +00:00
Chris Bieneman 31046054a8 [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.

llvm-svn: 267756
2016-04-27 18:52:48 +00:00
Paul Robinson b17327d7b6 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

llvm-svn: 267746
2016-04-27 17:37:12 +00:00
Nico Weber 3a94763101 Revert r267691, it caused PR27535.
llvm-svn: 267744
2016-04-27 17:26:08 +00:00
Adrian Prantl 9bc3c4f373 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

llvm-svn: 267740
2016-04-27 17:06:22 +00:00
Michael Zuckerman 514f05543f [Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set
Differential Revision: http://reviews.llvm.org/D19525

llvm-svn: 267728
2016-04-27 15:35:13 +00:00
Jonathan Coe 2956535b7c 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

llvm-svn: 267706
2016-04-27 12:48:25 +00:00