]> granicus.if.org Git - clang/log
clang
7 years agoASTImporter: fix tests on Windows with removing slashed parts of paths
Aleksei Sidorin [Mon, 23 Jan 2017 10:39:45 +0000 (10:39 +0000)]
ASTImporter: fix tests on Windows with removing slashed parts of paths

Differential Revision: https://reviews.llvm.org/D26753

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

7 years agoASTImporter: quick test fix
Aleksei Sidorin [Mon, 23 Jan 2017 10:16:30 +0000 (10:16 +0000)]
ASTImporter: quick test fix

Differential Revision: https://reviews.llvm.org/D26753

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

7 years agoASTImporter: add forgotten tests for rL292776
Aleksei Sidorin [Mon, 23 Jan 2017 09:45:29 +0000 (09:45 +0000)]
ASTImporter: add forgotten tests for rL292776

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

7 years agoASTImporter: improve support for C++ templates
Aleksei Sidorin [Mon, 23 Jan 2017 09:30:36 +0000 (09:30 +0000)]
ASTImporter: improve support for C++ templates

 * Support template partial specialization
 * Avoid infinite recursion in IsStructurallyEquivalent for TemplateArgument with implementing IsStructurallyEquivalent for TemplateName

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

7 years agoDebugInfo: Omit class definitions even in the presence of available_externally vtables
David Blaikie [Mon, 23 Jan 2017 02:24:03 +0000 (02:24 +0000)]
DebugInfo: Omit class definitions even in the presence of available_externally vtables

To ensure optimization level doesn't pessimize the -fstandalone-debug
vtable debug info optimization (where class definitions are only emitted
where the vtable is emitted - reducing redundant debug info) ensure the
debug info class definition is still omitted when an
available_externally vtable definition is emitted for optimization
purposes.

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

7 years ago[NVPTX] Auto-upgrade some NVPTX intrinsics to LLVM target-generic code.
Justin Lebar [Sat, 21 Jan 2017 01:00:32 +0000 (01:00 +0000)]
[NVPTX] Auto-upgrade some NVPTX intrinsics to LLVM target-generic code.

Summary:
Specifically, we upgrade llvm.nvvm.:

 * brev{32,64}
 * clz.{i,ll}
 * popc.{i,ll}
 * abs.{i,ll}
 * {min,max}.{i,ll,u,ull}
 * h2f

These either map directly to an existing LLVM target-generic
intrinsic or map to a simple LLVM target-generic idiom.

In all cases, we check that the code we generate is lowered to PTX as we
expect.

These builtins don't need to be backfilled in clang: They're not
accessible to user code from nvcc.

Reviewers: tra

Subscribers: majnemer, cfe-commits, llvm-commits, jholewinski

Differential Revision: https://reviews.llvm.org/D28793

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

7 years ago[Basic] Remove the 32-bit x86 and ARM targets for Fuchsia
Petr Hosek [Fri, 20 Jan 2017 22:53:38 +0000 (22:53 +0000)]
[Basic] Remove the 32-bit x86 and ARM targets for Fuchsia

The 32-bit architectures are no longer supported by Fuchsia.

Differential Revision: https://reviews.llvm.org/D28974

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

7 years agoIRGen: Start using the WriteThinLTOBitcode pass.
Peter Collingbourne [Fri, 20 Jan 2017 22:39:16 +0000 (22:39 +0000)]
IRGen: Start using the WriteThinLTOBitcode pass.

This is the final change necessary to support CFI with ThinLTO.

Differential Revision: https://reviews.llvm.org/D28843

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

7 years ago[Altivec] Change vec_sl to a << (b % (sizeof(a) * 8))
Tim Shen [Fri, 20 Jan 2017 22:05:33 +0000 (22:05 +0000)]
[Altivec] Change vec_sl to a << (b % (sizeof(a) * 8))

For a << b (as original vec_sl does), if b >= sizeof(a) * 8, the
behavior is undefined. However, Power instructions do define the
behavior, which is equivalent to a << (b % (sizeof(a) * 8)).

This patch changes altivec.h to use a << (b % (sizeof(a) * 8)), to
ensure the consistent semantic of the instructions. Then it combines
the generated multiple instructions back to a single shift.

This patch handles left shift only. Right shift, on the other hand, is
more complicated, considering arithematic/logical right shift.

Differential Revision: https://reviews.llvm.org/D28037

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

7 years agoRevert "Don't inline dllimport functions referencing non-imported methods"
Reid Kleckner [Fri, 20 Jan 2017 20:44:50 +0000 (20:44 +0000)]
Revert "Don't inline dllimport functions referencing non-imported methods"

This reverts commit r292522. It appears to be causing crashes in builds
using dllimport.

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

7 years agoRevert r292508 given that we intend to remove driver options for cxx modules.
Manman Ren [Fri, 20 Jan 2017 20:03:00 +0000 (20:03 +0000)]
Revert r292508 given that we intend to remove driver options for cxx modules.

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

7 years ago[docs] Regenerate DiagnosticsReference.rst. We don't have automatic generation of...
Richard Smith [Fri, 20 Jan 2017 19:27:09 +0000 (19:27 +0000)]
[docs] Regenerate DiagnosticsReference.rst. We don't have automatic generation of this set up server-side yet.

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

7 years agoAMDGPU: Add builtin for getreg intrinsic
Matt Arsenault [Fri, 20 Jan 2017 19:24:22 +0000 (19:24 +0000)]
AMDGPU: Add builtin for getreg intrinsic

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

7 years ago[Sema] Remove dead typedef
Bruno Cardoso Lopes [Fri, 20 Jan 2017 19:04:01 +0000 (19:04 +0000)]
[Sema] Remove dead typedef

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

7 years agoFix actually-reachable llvm_unreachable.
Richard Smith [Fri, 20 Jan 2017 18:50:12 +0000 (18:50 +0000)]
Fix actually-reachable llvm_unreachable.

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

7 years ago[Frontend] The macro that describes the Objective-C bool type should
Alex Lorenz [Fri, 20 Jan 2017 16:48:25 +0000 (16:48 +0000)]
[Frontend] The macro that describes the Objective-C bool type should
be defined for non Objective-C code as well

rdar://29794915

Differential Revision: https://reviews.llvm.org/D28349

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

7 years ago[Sema] Improve the error diagnostic for dot destructor calls on pointer objects
Alex Lorenz [Fri, 20 Jan 2017 15:38:58 +0000 (15:38 +0000)]
[Sema] Improve the error diagnostic for dot destructor calls on pointer objects

This commit improves the mismatched destructor type error by detecting when the
destructor call has used a '.' instead of a '->' on a pointer to the destructed
type. The diagnostic now suggests to use '->' instead of '.', and adds a fixit
where appropriate.

rdar://28766702

Differential Revision: https://reviews.llvm.org/D25817

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

7 years ago[clang-format] Remove redundant test in style-on-command-line.cpp
Krasimir Georgiev [Fri, 20 Jan 2017 12:39:05 +0000 (12:39 +0000)]
[clang-format] Remove redundant test in style-on-command-line.cpp

Summary:
rL292562 added a fix to always format if the fallback style is set to "none".
In test/Format/style-on-command-line.cpp:19 is redundant, since -fallback-style
has a default value of LLVM set in ClangFormat.cpp:72.

@amaiorano: I believe that the rest of the test cases still cover your change in
case the fallback style is explicitly set to "none". Please, if this is not the
case, initiate a discussion.

Reviewers: ioeric, bkramer

Reviewed By: ioeric

Subscribers: cfe-commits, klimek, amaiorano

Differential Revision: https://reviews.llvm.org/D28943

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

7 years agoRemove 'RUN: false' from Driver/response-file.c
Krasimir Georgiev [Fri, 20 Jan 2017 11:06:58 +0000 (11:06 +0000)]
Remove 'RUN: false' from Driver/response-file.c

Summary:
It seems that rL292518 introduced a RUN: false, but the continuation rL292545
forgot to remove it back.

This has flown under the radar, because it's a long test and doesn't get
executed by default during sanity testing.

To test:
$ cd llvm_build
$ ./bin/llvm-lit --param run_long_tests=true tools/clang/test/Driver/response-file.c

@rsmith: have a look if this change is OK please.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, rsmith

Differential Revision: https://reviews.llvm.org/D28941

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

7 years agoFix documentation typo.
Malcolm Parsons [Fri, 20 Jan 2017 09:54:26 +0000 (09:54 +0000)]
Fix documentation typo.

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

7 years agoUse UTF-8 for all communication with clang-format
Philipp Stephani [Fri, 20 Jan 2017 09:37:50 +0000 (09:37 +0000)]
Use UTF-8 for all communication with clang-format

Summary: Instead of picking the buffer file coding system, always use utf-8-unix for communicating with clang-format.  This is fine because clang-format never actually reads the file to be formatted, only standard input.  This is a bit simpler (process coding system is now a constant) and potentially faster, as utf-8-unix is Emacs's internal coding system.  Also add an end-to-end test that actually invokes clang-format.

Reviewers: klimek

Reviewed By: klimek

Differential Revision: https://reviews.llvm.org/D28904

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

7 years ago[OPENMP] Fix for PR31643: Clang crashes when compiling code on Windows
Alexey Bataev [Fri, 20 Jan 2017 08:57:28 +0000 (08:57 +0000)]
[OPENMP] Fix for PR31643: Clang crashes when compiling code on Windows
with SEH and openmp

In some cituations (during codegen for Windows SEH constructs)
CodeGenFunction instance may have CurFn equal to nullptr. OpenMP related
code does not expect such situation during cleanup.

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

7 years ago[AST Printer] Print attributes on enum constants
Jordan Rose [Fri, 20 Jan 2017 03:33:42 +0000 (03:33 +0000)]
[AST Printer] Print attributes on enum constants

The AST printer was dropping attributes on enumerators (enum
constants). Now it's not.

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

7 years ago[test] Remove an unwanted match for `UNSUPPORTED:`.
Greg Parker [Fri, 20 Jan 2017 02:12:22 +0000 (02:12 +0000)]
[test] Remove an unwanted match for `UNSUPPORTED:`.

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

7 years agoclang-format: fix fallback style set to "none" not always formatting
Antonio Maiorano [Fri, 20 Jan 2017 01:22:42 +0000 (01:22 +0000)]
clang-format: fix fallback style set to "none" not always formatting

This fixes clang-format not formatting if fallback-style is explicitly set to
"none", and either a config file is found or YAML is passed in without a
"BasedOnStyle". With this change, passing "none" in these cases will have no
affect, and LLVM style will be used as the base style.

Differential Revision: https://reviews.llvm.org/D28844

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

7 years agoPR31701: Fix crash on invalid caused by parsing a dependent initializer when we
Richard Smith [Fri, 20 Jan 2017 01:19:46 +0000 (01:19 +0000)]
PR31701: Fix crash on invalid caused by parsing a dependent initializer when we
don't know we're in a dependent context.

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

7 years agoFix documentation typo.
Richard Smith [Fri, 20 Jan 2017 01:08:15 +0000 (01:08 +0000)]
Fix documentation typo.

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

7 years agoAdd documentation for constexpr string builtin support.
Richard Smith [Fri, 20 Jan 2017 00:57:59 +0000 (00:57 +0000)]
Add documentation for constexpr string builtin support.

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

7 years agoP0426: Make the library implementation of constexpr char_traits a little easier
Richard Smith [Fri, 20 Jan 2017 00:45:35 +0000 (00:45 +0000)]
P0426: Make the library implementation of constexpr char_traits a little easier
by providing a memchr builtin that returns char* instead of void*.

Also add a __has_feature flag to indicate the presence of constexpr forms of
the relevant <string> functions.

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

7 years agoFinish implementation of C++ DR1310 (http://wg21.link/cwg1310).
Richard Smith [Fri, 20 Jan 2017 00:20:39 +0000 (00:20 +0000)]
Finish implementation of C++ DR1310 (http://wg21.link/cwg1310).

Diagnose the case when a dependent template name instantiates to an
injected-class-name outside a nested-name-specifier.

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

7 years agoDon't inline dllimport functions referencing non-imported methods
Hans Wennborg [Thu, 19 Jan 2017 21:33:13 +0000 (21:33 +0000)]
Don't inline dllimport functions referencing non-imported methods

This is another follow-up to r246338. I had assumed methods were already
handled by the AST visitor, but turns out they weren't.

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

7 years agoPR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).
Richard Smith [Thu, 19 Jan 2017 21:00:13 +0000 (21:00 +0000)]
PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).

Under this defect resolution, the injected-class-name of a class or class
template cannot be used except in very limited circumstances (when declaring a
constructor, in a nested-name-specifier, in a base-specifier, or in an
elaborated-type-specifier). This is apparently done to make parsing easier, but
it's a pain for us since we don't know whether a template-id using the
injected-class-name is valid at the point when we annotate it (we don't yet
know whether the template-id will become part of an elaborated-type-specifier).

As a tentative resolution to a perceived language defect, mem-initializer-ids
are added to the list of exceptions here (they generally follow the same rules
as base-specifiers).

When the reference to the injected-class-name uses the 'typename' or 'template'
keywords, we permit it to be used to name a type or template as an extension;
other compilers also accept some cases in this area. There are also a couple of
corner cases with dependent template names that we do not yet diagnose, but
which will also get this treatment.

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

7 years agoModule: Improve diagnostic message when cxx modules are disabled and @import is used...
Manman Ren [Thu, 19 Jan 2017 19:05:55 +0000 (19:05 +0000)]
Module: Improve diagnostic message when cxx modules are disabled and @import is used in Objective CXX.

rdar://problem/19399671

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

7 years ago[Sema] Reword unused lambda capture warning
Malcolm Parsons [Thu, 19 Jan 2017 17:19:22 +0000 (17:19 +0000)]
[Sema] Reword unused lambda capture warning

Summary:
The warning doesn't know why the variable was looked up but not
odr-used, so reword it to not claim that it was used in an unevaluated
context.

Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28902

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

7 years ago[Sema] Fix PR28181 by avoiding calling BuildOverloadedBinOp in C mode
Alex Lorenz [Thu, 19 Jan 2017 17:17:57 +0000 (17:17 +0000)]
[Sema] Fix PR28181 by avoiding calling BuildOverloadedBinOp in C mode

rdar://28532840

Differential Revision: https://reviews.llvm.org/D25213

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

7 years ago[Hexagon] Linux linker does not support .gnu-hash
Sumanth Gundapaneni [Thu, 19 Jan 2017 16:54:04 +0000 (16:54 +0000)]
[Hexagon] Linux linker does not support .gnu-hash

Hexagon Linux dynamic loader does not use (in fact does not support)
.gnu-hash

Differential Revision: https://reviews.llvm.org/D28865

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

7 years ago[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Malcolm Parsons [Thu, 19 Jan 2017 09:27:45 +0000 (09:27 +0000)]
[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing

Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.

Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html

Reviewers: aaron.ballman, klimek, alexfh

Subscribers: ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D28850

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

7 years agoAdd -fdebug-info-for-profiling to emit more debug info for sample pgo profile collection
Dehao Chen [Thu, 19 Jan 2017 00:44:21 +0000 (00:44 +0000)]
Add -fdebug-info-for-profiling to emit more debug info for sample pgo profile collection

Summary:
SamplePGO uses profile with debug info to collect profile. Unlike the traditional debugging purpose, sample pgo needs more accurate debug info to represent the profile. We add -femit-accurate-debug-info for this purpose. It can be combined with all debugging modes (-g, -gmlt, etc). It makes sure that the following pieces of info is always emitted:

* start line of all subprograms
* linkage name of all subprograms
* standalone subprograms (functions that has neither inlined nor been inlined)

The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch):

               -gmlt(orig) -gmlt(patched) -g
433.milc       4.68%       5.40%          19.73%
444.namd       8.45%       8.93%          45.99%
447.dealII     97.43%      115.21%        374.89%
450.soplex     27.75%      31.88%         126.04%
453.povray     21.81%      26.16%         92.03%
470.lbm        0.60%       0.67%          1.96%
482.sphinx3    5.77%       6.47%          26.17%
400.perlbench  17.81%      19.43%         73.08%
401.bzip2      3.73%       3.92%          12.18%
403.gcc        31.75%      34.48%         122.75%
429.mcf        0.78%       0.88%          3.89%
445.gobmk      6.08%       7.92%          42.27%
456.hmmer      10.36%      11.25%         35.23%
458.sjeng      5.08%       5.42%          14.36%
462.libquantum 1.71%       1.96%          6.36%
464.h264ref    15.61%      16.56%         43.92%
471.omnetpp    11.93%      15.84%         60.09%
473.astar      3.11%       3.69%          14.18%
483.xalancbmk  56.29%      81.63%         353.22%
geomean        15.60%      18.30%         57.81%

Debug info size change for -gmlt binary with this patch:

433.milc       13.46%
444.namd       5.35%
447.dealII     18.21%
450.soplex     14.68%
453.povray     19.65%
470.lbm        6.03%
482.sphinx3    11.21%
400.perlbench  8.91%
401.bzip2      4.41%
403.gcc        8.56%
429.mcf        8.24%
445.gobmk      29.47%
456.hmmer      8.19%
458.sjeng      6.05%
462.libquantum 11.23%
464.h264ref    5.93%
471.omnetpp    31.89%
473.astar      16.20%
483.xalancbmk  44.62%
geomean        16.83%

Reviewers: davidxl, andreadb, rob.lougher, dblaikie, echristo

Reviewed By: dblaikie, echristo

Subscribers: hfinkel, rob.lougher, andreadb, gbedwell, cfe-commits, probinson, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25435

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

7 years agoAdd llvm-dis dependency to check-clang.
Peter Collingbourne [Thu, 19 Jan 2017 00:04:44 +0000 (00:04 +0000)]
Add llvm-dis dependency to check-clang.

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

7 years agoMove vtable type metadata emission behind a cc1-level flag.
Peter Collingbourne [Wed, 18 Jan 2017 23:55:27 +0000 (23:55 +0000)]
Move vtable type metadata emission behind a cc1-level flag.

In ThinLTO mode, type metadata will require the module to be written as a
multi-module bitcode file, which is currently incompatible with the Darwin
linker. It is also useful to be able to enable or disable multi-module bitcode
for testing purposes. This introduces a cc1-level flag, -f{,no-}lto-unit,
which is used by the driver to enable multi-module bitcode on all but
Darwin+ThinLTO, and can also be used to enable/disable the feature manually.

Differential Revision: https://reviews.llvm.org/D28877

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

7 years agoRemove now redundant code that ensured debug info for class definitions was emitted...
David Blaikie [Wed, 18 Jan 2017 21:15:18 +0000 (21:15 +0000)]
Remove now redundant code that ensured debug info for class definitions was emitted under certain circumstances

Introduced in r181561 - it may've been subsumed by work done to allow
emission of declarations for vtable types while still emitting some of
their member functions correctly for those declarations. Whatever the
reason, the tests pass without this code now.

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

7 years ago[OpenMP] Support for the if-clause on the combined directive 'target parallel'.
Arpith Chacko Jacob [Wed, 18 Jan 2017 20:40:48 +0000 (20:40 +0000)]
[OpenMP] Support for the if-clause on the combined directive 'target parallel'.

The if-clause on the combined directive potentially applies to both the
'target' and the 'parallel' regions.  Codegen'ing the if-clause on the
combined directive requires additional support because the expression in
the clause must be captured by the 'target' capture statement but not
the 'parallel' capture statement.  Note that this situation arises for
other clauses such as num_threads.

The OMPIfClause class inherits OMPClauseWithPreInit to support capturing
of expressions in the clause.  A member CaptureRegion is added to
OMPClauseWithPreInit to indicate which captured statement (in this case
'target' but not 'parallel') captures these expressions.

To ensure correct codegen of captured expressions in the presence of
combined 'target' directives, OMPParallelScope was added to 'parallel'
codegen.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28781

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

7 years ago[ASTReader] Add a DeserializationListener callback for IMPORTED_MODULES
Graydon Hoare [Wed, 18 Jan 2017 20:36:59 +0000 (20:36 +0000)]
[ASTReader] Add a DeserializationListener callback for IMPORTED_MODULES

Summary:
Add a callback from ASTReader to DeserializationListener when the former
reads an IMPORTED_MODULES block. This supports Swift in using PCH for
bridging headers.

Reviewers: doug.gregor, manmanren, bruno

Reviewed By: manmanren

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28779

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

7 years ago[Modules] Correct test comment from obsolete earlier version of code. NFC
Graydon Hoare [Wed, 18 Jan 2017 20:34:44 +0000 (20:34 +0000)]
[Modules] Correct test comment from obsolete earlier version of code. NFC

Summary:
Code committed in rL290219 went through a few iterations; test wound up with
stale comment.

Reviewers: doug.gregor, manmanren

Reviewed By: manmanren

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28790

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

7 years ago[OpenMP] Codegen for the 'target parallel' directive on the NVPTX device.
Arpith Chacko Jacob [Wed, 18 Jan 2017 19:35:00 +0000 (19:35 +0000)]
[OpenMP] Codegen for the 'target parallel' directive on the NVPTX device.

This patch adds codegen for the 'target parallel' directive on the NVPTX
device.  We term offload OpenMP directives such as 'target parallel' and
'target teams distribute parallel for' as SPMD constructs.  SPMD constructs,
in contrast to Generic ones like the plain 'target', can never contain
a serial region.

SPMD constructs can be handled more efficiently on the GPU and do not
require the Warp Loop of the Generic codegen scheme. This patch adds
SPMD codegen support for 'target parallel' on the NVPTX device and can
be reused for other SPMD constructs.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28755

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

7 years agoPR9551: Implement DR1004 (http://wg21.link/cwg1004).
Richard Smith [Wed, 18 Jan 2017 19:19:22 +0000 (19:19 +0000)]
PR9551: Implement DR1004 (http://wg21.link/cwg1004).

This rule permits the injected-class-name of a class template to be used as
both a template type argument and a template template argument, with no extra
syntax required to disambiguate.

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

7 years ago[OpenMP] Codegen support for 'target parallel' on the host.
Arpith Chacko Jacob [Wed, 18 Jan 2017 18:18:53 +0000 (18:18 +0000)]
[OpenMP] Codegen support for 'target parallel' on the host.

This patch adds support for codegen of 'target parallel' on the host.
It is also the first combined directive that requires two or more
captured statements.  Support for this functionality is included in
the patch.

A combined directive such as 'target parallel' has two captured
statements, one for the 'target' and the other for the 'parallel'
region.  Two captured statements are required because each has
different implicit parameters (see SemaOpenMP.cpp).  For example,
the 'parallel' has 'global_tid' and 'bound_tid' while the 'target'
does not.  The patch adds support for handling multiple captured
statements based on the combined directive.

When codegen'ing the 'target parallel' directive, the 'target'
outlined function is created using the outer captured statement
and the 'parallel' outlined function is created using the inner
captured statement.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28753

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

7 years ago[ASTUnit] Reset diag state when creating the ASTUnit.
Benjamin Kramer [Wed, 18 Jan 2017 16:25:48 +0000 (16:25 +0000)]
[ASTUnit] Reset diag state when creating the ASTUnit.

A client could call this with a dirty diagnostic engine, don't crash.

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

7 years ago[Basic] Remove source manager references from diag state points.
Benjamin Kramer [Wed, 18 Jan 2017 15:50:26 +0000 (15:50 +0000)]
[Basic] Remove source manager references from diag state points.

This is just wasted space, we don't support state points from multiple
source managers. Validate that there's no state when resetting the
source manager and use the 'global' reference to the sourcemanager
instead of the ones in the diag state.

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

7 years agoRevert r292374 to debug Windows buildbot failure.
Arpith Chacko Jacob [Wed, 18 Jan 2017 15:36:05 +0000 (15:36 +0000)]
Revert r292374 to debug Windows buildbot failure.

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

7 years agoWarn when calling a non interrupt function from an interrupt on ARM
Jonathan Roelofs [Wed, 18 Jan 2017 15:31:11 +0000 (15:31 +0000)]
Warn when calling a non interrupt function from an interrupt on ARM

The idea for this originated from a really tricky bug: ISRs on ARM don't
automatically save off the VFP regs, so if say, memcpy gets interrupted and the
ISR itself calls memcpy, the regs are left clobbered when the ISR is done.

https://reviews.llvm.org/D28820

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

7 years ago[OpenMP] Codegen support for 'target parallel' on the host.
Arpith Chacko Jacob [Wed, 18 Jan 2017 15:14:52 +0000 (15:14 +0000)]
[OpenMP] Codegen support for 'target parallel' on the host.

This patch adds support for codegen of 'target parallel' on the host.
It is also the first combined directive that requires two or more
captured statements.  Support for this functionality is included in
the patch.

A combined directive such as 'target parallel' has two captured
statements, one for the 'target' and the other for the 'parallel'
region.  Two captured statements are required because each has
different implicit parameters (see SemaOpenMP.cpp).  For example,
the 'parallel' has 'global_tid' and 'bound_tid' while the 'target'
does not.  The patch adds support for handling multiple captured
statements based on the combined directive.

When codegen'ing the 'target parallel' directive, the 'target'
outlined function is created using the outer captured statement
and the 'parallel' outlined function is created using the inner
captured statement.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28753

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

7 years agoRevert "[xray] try to fix thumb buildbot"
Renato Golin [Wed, 18 Jan 2017 09:05:32 +0000 (09:05 +0000)]
Revert "[xray] try to fix thumb buildbot"

This reverts commit r292268, as it didn't fix the buildbots.

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

7 years ago[CMake] Separate LLVM_ENABLE_LTO and LLVM_ENABLE_LLD
Petr Hosek [Wed, 18 Jan 2017 05:41:17 +0000 (05:41 +0000)]
[CMake] Separate LLVM_ENABLE_LTO and LLVM_ENABLE_LLD

These two are independent: it's possible to use LLD without LTO,
and it's possible to do LTO build without LLD.

Differential Revision: https://reviews.llvm.org/D28821

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

7 years ago[AVX-512] Replace subvector broadcast builtins with shufflevectors and selects.
Craig Topper [Wed, 18 Jan 2017 02:17:10 +0000 (02:17 +0000)]
[AVX-512] Replace subvector broadcast builtins with shufflevectors and selects.

Verified that the backend codegens this equally well.

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

7 years ago[WebAssembly] Update grow_memory's return type.
Dan Gohman [Wed, 18 Jan 2017 01:03:35 +0000 (01:03 +0000)]
[WebAssembly] Update grow_memory's return type.

The grow_memory instruction now returns the previous memory size. Add the
return type to the clang intrinsic.

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

7 years ago[WebAssembly] Add minimal support for the new wasm object format triple.
Dan Gohman [Tue, 17 Jan 2017 21:46:38 +0000 (21:46 +0000)]
[WebAssembly] Add minimal support for the new wasm object format triple.

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

7 years ago[xray] try to fix thumb buildbot
Renato Golin [Tue, 17 Jan 2017 21:37:24 +0000 (21:37 +0000)]
[xray] try to fix thumb buildbot

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

7 years agoUsersManual.rst: add missing newline
Hans Wennborg [Tue, 17 Jan 2017 21:31:57 +0000 (21:31 +0000)]
UsersManual.rst: add missing newline

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

7 years agoFix Python 3 language issues and add an explicit check for Python version == 2.
Jonathan Coe [Tue, 17 Jan 2017 20:03:54 +0000 (20:03 +0000)]
Fix Python 3 language issues and add an explicit check for Python version == 2.

Summary:
Python bindings cannot support Python 3 without work being done to fix Unicode c-string conversion.

This was attempted in https://reviews.llvm.org/D26082. That patch was reverted due to memory access issues on Linux.

This revision fixes enough language compatibility issues for the clang module to be loaded and raise an error if the Python version is not 2.

Reviewers: mgorny, MathieuDuponchelle, rengolin, compnerd

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D28682

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

7 years ago[Sema] Fix bug in handling of designated initializer.
Akira Hatanaka [Tue, 17 Jan 2017 19:35:54 +0000 (19:35 +0000)]
[Sema] Fix bug in handling of designated initializer.

CheckDesignatedInitializer wasn't taking into account the base classes
when computing the index for the field in the derived class, which
caused the test case to crash during IRGen because of a malformed AST.

rdar://problem/26795040

Differential Revision: https://reviews.llvm.org/D28705

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

7 years agoMake sure that clang-format input is in the right encoding
Philipp Stephani [Tue, 17 Jan 2017 17:30:55 +0000 (17:30 +0000)]
Make sure that clang-format input is in the right encoding

Summary: Add unit tests.

Reviewers: klimek, massberg

Reviewed By: massberg

Differential Revision: https://reviews.llvm.org/D28800

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

7 years ago[Clang] - Update code to match upcoming llvm::zlib API.
George Rimar [Tue, 17 Jan 2017 15:45:31 +0000 (15:45 +0000)]
[Clang] - Update code to match upcoming llvm::zlib API.

D28684 changed llvm::zlib to return Error instead of Status.
It was accepted and committed in r292214, but then reverted in r292217
because I missed that clang code also needs to be updated.

Patch do that.

D28684 recommitted again as r292226

Differential revision: https://reviews.llvm.org/D28807

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

7 years ago[AST] AttributedType should derive type properties from the EquivalentType
David Majnemer [Tue, 17 Jan 2017 04:14:25 +0000 (04:14 +0000)]
[AST] AttributedType should derive type properties from the EquivalentType

Using the canonical type instead of the equivalent type can result in
insufficient template instantiations.

This fixes PR31656.

Differential Revision: https://reviews.llvm.org/D28788

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

7 years agoFix AArch64 global-merge backend option name.
Frederic Riss [Tue, 17 Jan 2017 03:38:45 +0000 (03:38 +0000)]
Fix AArch64 global-merge backend option name.

-mglobal-merge is translated to the appropriate backend option in
the driver. r277322 changed the AArch64 option name in the backend,
but the driver was never updated.

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

7 years agoPartial revert of r290511.
Richard Smith [Tue, 17 Jan 2017 02:14:37 +0000 (02:14 +0000)]
Partial revert of r290511.

The rules around typechecking deduced template arguments during partial
ordering are not clear, and while the prior behavior does not seem to be
correct (it doesn't follow the general model of partial ordering where each
template parameter is replaced by a non-dependent but unique value), the new
behavior is also not clearly right and breaks some existing idioms.

The new behavior is retained for dealing with non-type template parameters
with 'auto' types, as without it even the most basic uses of that feature
don't work. We can revisit this once CWG has come to an agreement on how
partial ordering with 'auto' non-type template parameters is supposed to
work.

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

7 years agoclang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle
Antonio Maiorano [Tue, 17 Jan 2017 00:12:27 +0000 (00:12 +0000)]
clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle

Change the contract of GetStyle so that it returns an error when an error occurs
(i.e. when it writes to stderr), and only returns the fallback style when it
can't find a configuration file.

Differential Revision: https://reviews.llvm.org/D28081

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

7 years ago[StaticAnalyzer] Fix android build
Pavel Labath [Mon, 16 Jan 2017 15:57:07 +0000 (15:57 +0000)]
[StaticAnalyzer] Fix android build

std::to_string is not available in the android NDK. Use llvm::to_string instead.

Committing as obvious.

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

7 years ago[OpenMP] Refactor code that calls codegen for target regions on the device.
Arpith Chacko Jacob [Mon, 16 Jan 2017 15:26:02 +0000 (15:26 +0000)]
[OpenMP] Refactor code that calls codegen for target regions on the device.

This patch refactors code that calls codegen for target regions.  Currently
the codebase only supports the 'target' directive.  The patch pulls out
common target processing code into a static function that can be called
by codegen for any target directive.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28752

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

7 years agoEnsure that clang -pthread creates the right macro. -D_POSIX_THREADS
Joerg Sonnenberger [Mon, 16 Jan 2017 14:07:24 +0000 (14:07 +0000)]
Ensure that clang -pthread creates the right macro. -D_POSIX_THREADS
seems to have been a C&P error from old GCC specs for OpenBSD.

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

7 years agoFix test failures after recent clang-format format change.
Daniel Jasper [Mon, 16 Jan 2017 13:43:46 +0000 (13:43 +0000)]
Fix test failures after recent clang-format format change.

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

7 years agoReplace non-ASCII ellipsis with "..." to silence Sphinx warnings.
Aaron Ballman [Mon, 16 Jan 2017 13:42:21 +0000 (13:42 +0000)]
Replace non-ASCII ellipsis with "..." to silence Sphinx warnings.

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

7 years agoAdd -fstrict-vtable-pointers to UsersManual
Piotr Padlewski [Mon, 16 Jan 2017 13:20:08 +0000 (13:20 +0000)]
Add -fstrict-vtable-pointers to UsersManual

Summary: Add missing flag to UsersManual
It would be good to merge it to 4.0 branch.

Reviewers: hans

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28727

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

7 years agoclang-format: Always wrap before multi-line parameters/operands.
Daniel Jasper [Mon, 16 Jan 2017 13:13:15 +0000 (13:13 +0000)]
clang-format: Always wrap before multi-line parameters/operands.

Before:
  aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                     aaaaaaaaaaaaaaaaaaaaa);

After:
  aaaaaaaaaaaaaaaaaa(aaaaaaaa,
                     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::
                         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                     aaaaaaaaaaaaaaaaaaaaa);

No new test cases, as the existing ones cover this fairly well.

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

7 years agoclang-format: [JS] revert over-eager ASI check.
Martin Probst [Mon, 16 Jan 2017 09:52:40 +0000 (09:52 +0000)]
clang-format: [JS] revert over-eager ASI check.

Summary: Change r291428 introduced ASI detection after closing curly braces. That would generally be correct, however this breaks indentation for structural statements. What happens is that CompoundStatementIndenter increases indentation for the current line, then after reading ASI creates a new line (with the increased line level), and only after the structural parser sees e.g. the if/then/else branch closed, line level is reduced. That leads to the new line started by ASI having a level too high.

Reviewers: djasper

Subscribers: sammccall, cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D28763

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

7 years ago[code-completion] Fix crash when trying to do postfix completion of instance member...
Argyrios Kyrtzidis [Sun, 15 Jan 2017 06:11:04 +0000 (06:11 +0000)]
[code-completion] Fix crash when trying to do postfix completion of instance member inside a static function.

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

7 years agoFix PR31644 introduced by r287138 and add a regression test.
Yaron Keren [Sat, 14 Jan 2017 21:12:08 +0000 (21:12 +0000)]
Fix PR31644 introduced by r287138 and add a regression test.
Thanks Dimitry Andric for the report and fix!

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

7 years agoUpdate the tests to match the typo fix done in r292015
Sylvestre Ledru [Sat, 14 Jan 2017 12:00:40 +0000 (12:00 +0000)]
Update the tests to match the typo fix done in r292015

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

7 years agofix a few typo in the doc but also in the clang messages
Sylvestre Ledru [Sat, 14 Jan 2017 11:41:45 +0000 (11:41 +0000)]
fix a few typo in the doc but also in the clang messages

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

7 years agoAdd LLVMOption to clang-interpreter, corresponding to r291938.
NAKAMURA Takumi [Sat, 14 Jan 2017 08:54:05 +0000 (08:54 +0000)]
Add LLVMOption to clang-interpreter, corresponding to r291938.

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

7 years agoFix a typo. NFC.
George Burgess IV [Sat, 14 Jan 2017 05:19:34 +0000 (05:19 +0000)]
Fix a typo. NFC.

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

7 years agoGive more accurate descriptions of what kind of template we found in diagnostics.
Richard Smith [Sat, 14 Jan 2017 02:19:59 +0000 (02:19 +0000)]
Give more accurate descriptions of what kind of template we found in diagnostics.

We were previouly assuming that every type template was a class template, which
is not true any more.

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

7 years agoclang-format: Fix bug in making line break decisions.
Daniel Jasper [Fri, 13 Jan 2017 23:18:16 +0000 (23:18 +0000)]
clang-format: Fix bug in making line break decisions.

Here, the optimization to not line wrap when it would not lead to a
reduction in columns was overwriting and enforced break that we want to
do no matter what.

Before:
  int i = someFunction(
              aaaaaaa,
              0).aaa(aaaaaaaaaaaaa) *
              aaaaaaa +
          aaaaaaa;

After:
  int i = someFunction(aaaaaaa, 0)
                  .aaa(aaaaaaaaaaaaa) *
              aaaaaaa +
          aaaaaaa;

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

7 years agoPR31631: fix bad CFG (and bogus warnings) when an if-statement has an init-statement...
Richard Smith [Fri, 13 Jan 2017 22:16:41 +0000 (22:16 +0000)]
PR31631: fix bad CFG (and bogus warnings) when an if-statement has an init-statement and has binary operator as its condition.

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

7 years ago[clang] Emit `diagnose_if` warnings from system headers
Eric Fiselier [Fri, 13 Jan 2017 22:11:40 +0000 (22:11 +0000)]
[clang] Emit `diagnose_if` warnings from system headers

Summary: In order for libc++ to meaningfully use `diagnose_if` warnings they need to be emitted from system headers by default. This patch changes the `diagnose_if` warning diagnostic to be shown in system headers.

Reviewers: george.burgess.iv, rsmith, aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28703

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

7 years agoPR31606: Generalize our tentative DR resolution for inheriting copy/move
Richard Smith [Fri, 13 Jan 2017 20:46:54 +0000 (20:46 +0000)]
PR31606: Generalize our tentative DR resolution for inheriting copy/move
constructors to better match the pre-P0136R1 behavior.

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

7 years agoFix shared library build after r291938 by adding missing dependency on libOption
David Blaikie [Fri, 13 Jan 2017 19:47:55 +0000 (19:47 +0000)]
Fix shared library build after r291938 by adding missing dependency on libOption

Thanks to Reid Kleckner for the help reproducing/fixing.

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

7 years agoRemove unused lambda captures. NFC
Malcolm Parsons [Fri, 13 Jan 2017 18:55:32 +0000 (18:55 +0000)]
Remove unused lambda captures. NFC

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

7 years agounique_ptrify Driver::ToolChains
David Blaikie [Fri, 13 Jan 2017 18:53:43 +0000 (18:53 +0000)]
unique_ptrify Driver::ToolChains

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

7 years agounique_ptrify createDriverOptTable
David Blaikie [Fri, 13 Jan 2017 17:34:15 +0000 (17:34 +0000)]
unique_ptrify createDriverOptTable

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

7 years agoUse less byval on 32-bit Windows x86 for classes with bases
Reid Kleckner [Fri, 13 Jan 2017 17:18:19 +0000 (17:18 +0000)]
Use less byval on 32-bit Windows x86 for classes with bases

This comes up in V8, which has a Handle template class that wraps a
typed pointer, and is frequently passed by value. The pointer is stored
in the base, HandleBase. This change allows us to pass the struct as a
pointer instead of using byval. This avoids creating tons of temporary
allocas that we copy from during call lowering.

Eventually, it would be good to use FCAs here instead.

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

7 years agoRevert "Support for Python 3 in libclang python bindings"
Jonathan Coe [Fri, 13 Jan 2017 16:06:59 +0000 (16:06 +0000)]
Revert "Support for Python 3 in libclang python bindings"

This reverts commit 4464581bb63e9789e9ee231a8c8800be5f614743.

Memory access issues on Linux were reported by Mathieu Duponchelle and
discussed here: https://reviews.llvm.org/D26082.

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

7 years ago[Sema] Add warning for unused lambda captures
Malcolm Parsons [Fri, 13 Jan 2017 15:01:06 +0000 (15:01 +0000)]
[Sema] Add warning for unused lambda captures

Summary:
Warn when a lambda explicitly captures something that is not used in its body.

The warning is part of -Wunused and can be enabled with -Wunused-lambda-capture.

Reviewers: rsmith, arphaman, jbcoe, aaron.ballman

Subscribers: Quuxplusone, arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D28467

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

7 years agoAnother fix for r291850 because there are apparently targets which add
Chandler Carruth [Fri, 13 Jan 2017 02:47:34 +0000 (02:47 +0000)]
Another fix for r291850 because there are apparently targets which add
"-mllvm" flags to the CC1 invocation (notably, Hexagon seems to hit
this).

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

7 years agoImplement DR1265 (wg21.link/cwg1265).
Richard Smith [Fri, 13 Jan 2017 02:22:01 +0000 (02:22 +0000)]
Implement DR1265 (wg21.link/cwg1265).

Diasllow a declaration using the 'auto' type specifier from using two different
meanings of it at once, or from declaring multiple functions with deduced
return types or introducing multiple trailing return types.

The standard does not technically disallow the multiple trailing return types
case if all the declarators declare variables (such as function pointers with
trailing return types), but we disallow that too, following the clear intent.

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

7 years agoAdd a necessary newline for diagnose_if documentation.
Eric Christopher [Fri, 13 Jan 2017 01:52:04 +0000 (01:52 +0000)]
Add a necessary newline for diagnose_if documentation.

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

7 years ago[Sema] Restrict explicit instantation definition dllexport
Shoaib Meenai [Fri, 13 Jan 2017 01:28:34 +0000 (01:28 +0000)]
[Sema] Restrict explicit instantation definition dllexport

In the case where the template class itself is already `dllexport`, the
implicit instantiation will have already emitted all members. When we
check the explicit instantiation definition, the `Specialization` will
have inherited the `dllexport` attribute, so we'll attempt to emit all
members for a second time, which causes an assertion failure. Restrict
the exporting to when the `dllexport` attribute is newly introduced by
the explicit instantiation definition.

Fixes PR31608.

Differential Revision: https://reviews.llvm.org/D28590

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

7 years ago[DOXYGEN] Documentation for the newly added x86 intrinsics.
Ekaterina Romanova [Fri, 13 Jan 2017 01:14:08 +0000 (01:14 +0000)]
[DOXYGEN] Documentation for the newly added x86 intrinsics.

Added doxygen comments for the newly added intrinsics in avxintrin.h, namely _mm256_cvtsd_f64, _mm256_cvtsi256_si32 and _mm256_cvtss_f32

Added doxygen comments for the new intrinsics in emmintrin.h, namely _mm_loadu_si64 and _mm_load_sd.

Explicit parameter names were added for _mm_clflush and _mm_setcsr

The rest of the changes are editorial, removing trailing spaces at the end of the lines.

Differential Revision: https://reviews.llvm.org/D28503

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

7 years agoTemporarily revert the test change in 291870, which is broken in certain buildbots.
Dehao Chen [Fri, 13 Jan 2017 01:09:43 +0000 (01:09 +0000)]
Temporarily revert the test change in 291870, which is broken in certain buildbots.

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

7 years agoUpdate C++ status pages for Clang 4 branch:
Richard Smith [Fri, 13 Jan 2017 00:57:54 +0000 (00:57 +0000)]
Update C++ status pages for Clang 4 branch:

 * Update version number in DR tests from 4.0 to 4
 * Teach make_cxx_dr_status script about version numbers that don't contain a
   period.
 * Update cxx_status.html and cxx_dr_status.html to list Clang 4 features as
   "Clang 4" rather than "SVN"

Clang 4 features are still listed in yellow rather than green until release.

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