]> granicus.if.org Git - clang/log
clang
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

7 years agoPass -fprofile-sample-use to lto backends.
Dehao Chen [Fri, 13 Jan 2017 00:51:55 +0000 (00:51 +0000)]
Pass -fprofile-sample-use to lto backends.

Summary: LTO backend will not invoke SampleProfileLoader pass even if -fprofile-sample-use is specified. This patch passes the flag down so that pass manager can add the SampleProfileLoader pass correctly.

Reviewers: mehdi_amini, tejohnson

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Add LocationContext as a parameter to checkRegionChanges
Anna Zaks [Fri, 13 Jan 2017 00:50:57 +0000 (00:50 +0000)]
[analyzer] Add LocationContext as a parameter to checkRegionChanges

This patch adds LocationContext to checkRegionChanges and removes
wantsRegionChangeUpdate as it was unused.

A patch by Krzysztof WiÅ›niewski!

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

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

7 years ago[tsan] Do not report errors in __destroy_helper_block_
Anna Zaks [Fri, 13 Jan 2017 00:50:50 +0000 (00:50 +0000)]
[tsan] Do not report errors in __destroy_helper_block_

There is a synchronization point between the reference count of a block dropping to zero and it's destruction, which TSan does not observe. Do not report errors in the compiler-emitted block destroy method and everything called from it.

This is similar to https://reviews.llvm.org/D25857

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

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

7 years ago[analyzer] Support inlining of '[self classMethod]' and '[[self class] classMethod]'
Anna Zaks [Fri, 13 Jan 2017 00:50:47 +0000 (00:50 +0000)]
[analyzer] Support inlining of '[self classMethod]' and '[[self class] classMethod]'

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

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

7 years ago[analyzer] Fix false positives in Keychain API checker
Anna Zaks [Fri, 13 Jan 2017 00:50:41 +0000 (00:50 +0000)]
[analyzer] Fix false positives in Keychain API checker

The checker has several false positives that this patch addresses:
- Do not check if the return status has been compared to error (or no error) at the time when leaks are reported since the status symbol might no longer be alive. Instead, pattern match on the assume and stop tracking allocated symbols on error paths.
- The checker used to report error when an unknown symbol was freed. This could lead to false positives, let's not repot those. This leads to loss of coverage in double frees.
- Do not enforce that we should only call free if we are sure that error was not returned and the pointer is not null. That warning is too noisy and we received several false positive reports about it. (I removed: "Only call free if a valid (non-NULL) buffer was returned")
- Use !isDead instead of isLive in leak reporting. Otherwise, we report leaks for objects we loose track of. This change triggered change #1.

This also adds checker specific dump to the state.

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

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

7 years agoImprove handling of instantiated thread_local variables in Itanium C++ ABI.
Richard Smith [Fri, 13 Jan 2017 00:43:31 +0000 (00:43 +0000)]
Improve handling of instantiated thread_local variables in Itanium C++ ABI.

 * Do not initialize these variables when initializing the rest of the
   thread_locals in the TU; they have unordered initialization so they can be
   initialized by themselves.

   This fixes a rejects-valid bug: we would make the per-variable initializer
   function internal, but put it in a comdat keyed off the variable, resulting
   in link errors when the comdat is selected from a different TU (as the per
   TU TLS init function tries to call an init function that does not exist).

 * On Darwin, when we decide that we're not going to emit a thread wrapper
   function at all, demote its linkage to External. Fixes a verifier failure
   on explicit instantiation of a thread_local variable on Darwin.

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

7 years agoFix two test cases I missed updating in r291850. Sorry for the noise.
Chandler Carruth [Thu, 12 Jan 2017 22:48:28 +0000 (22:48 +0000)]
Fix two test cases I missed updating in r291850. Sorry for the noise.

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

7 years agoReplace some stray uses of the old spelling of the flag with the new
Chandler Carruth [Thu, 12 Jan 2017 22:43:37 +0000 (22:43 +0000)]
Replace some stray uses of the old spelling of the flag with the new
spelling. NFC.

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

7 years agoAddress review comments on r290392:
Chandler Carruth [Thu, 12 Jan 2017 22:40:13 +0000 (22:40 +0000)]
Address review comments on r290392:
- Don't break using '-mllvm -disable-llvm-optzns' (yet).
- Don't add support for '-mllvm -disable-llvm-passes'.

This is important for LLVM 4 as we haven't yet really told folks this is
coming. I'll add release notes about this.

I've also added some explicit testing of this so its more obvious what
is happening here.

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

7 years agoClear the release notes for 5.0.0
Hans Wennborg [Thu, 12 Jan 2017 21:55:16 +0000 (21:55 +0000)]
Clear the release notes for 5.0.0

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

7 years agoUpdate docs/conf.py version
Hans Wennborg [Thu, 12 Jan 2017 21:41:38 +0000 (21:41 +0000)]
Update docs/conf.py version

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

7 years agoAdd entry for -MJ.
Joerg Sonnenberger [Thu, 12 Jan 2017 21:11:55 +0000 (21:11 +0000)]
Add entry for -MJ.

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

7 years agoclang-format: Fix regression introduced by r291801.
Daniel Jasper [Thu, 12 Jan 2017 20:06:28 +0000 (20:06 +0000)]
clang-format: Fix regression introduced by r291801.

Uncovered by polly tests.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa,
                                 {}, aaaaaaaaaaaaaaaaaaaaaaa);

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {},
                                 aaaaaaaaaaaaaaaaaaaaaaa);

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

7 years agoAdd additional testcases for nsw markings on ++ and --.
Eli Friedman [Thu, 12 Jan 2017 19:51:44 +0000 (19:51 +0000)]
Add additional testcases for nsw markings on ++ and --.

clang has generated correct IR for char/short decrement since r126816,
but we didn't have any test coverage for decrement.

Patch by Andrew Rogers.

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

7 years agoclang-format: Treat braced lists like other complex parameters.
Daniel Jasper [Thu, 12 Jan 2017 19:35:26 +0000 (19:35 +0000)]
clang-format: Treat braced lists like other complex parameters.

Specifically, wrap before them if they are multi-line so that we don't
create long hanging indents. This prevents having a lot of code
indented a lot in some cases.

Before:
  someFunction(Param, {List1, List2,
                       List3});

After:
  someFunction(Param,
               {List1, List2,
                List3});

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

7 years agoUsersManual.rst: Update clang-cl options list again
Hans Wennborg [Thu, 12 Jan 2017 19:26:54 +0000 (19:26 +0000)]
UsersManual.rst: Update clang-cl options list again

This time, make ignored options, such as /utf-8, show up as well if they
have help text.

Also, since we're now exposing -fdelayed-template-parsing, add help text
to the -fno version so that shows up as well.

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

7 years ago[Modules] Fix misleading warning about missing textual header in umbrella header
Bruno Cardoso Lopes [Thu, 12 Jan 2017 19:15:33 +0000 (19:15 +0000)]
[Modules] Fix misleading warning about missing textual header in umbrella header

When a textual header is present inside a umbrella dir but not in the
header, we get the misleading warning:

warning: umbrella header for module 'FooFramework' does not include
header 'Baz_Private.h'

The module map in question:

framework module FooFramework {
    umbrella header "FooUmbrella.h"

    export *
    module * { export * }

    module Private {
        textual header "Baz_Private.h"
    }
}

Fix this by taking textual headers into account.

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

7 years agoUsersManual.rst: Update clang-cl options list
Hans Wennborg [Thu, 12 Jan 2017 18:15:06 +0000 (18:15 +0000)]
UsersManual.rst: Update clang-cl options list

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

7 years ago[analyzer] Don't dereference the array value when binding it to a reference.
Artem Dergachev [Thu, 12 Jan 2017 18:00:03 +0000 (18:00 +0000)]
[analyzer] Don't dereference the array value when binding it to a reference.

This replaces the hack in r291754, which was fixing pr31592, which was
caused by r291754, with a more appropriate solution.

rdar://problem/28832541
Differential revision: https://reviews.llvm.org/D28602

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

7 years ago[Docs][OpenCL] Added OpenCL feature description to Clang documentation.
Anastasia Stulova [Thu, 12 Jan 2017 17:52:22 +0000 (17:52 +0000)]
[Docs][OpenCL] Added OpenCL feature description to Clang documentation.

Updated index and UsersManual with OpenCL description.

Review: https://reviews.llvm.org/D28080

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

7 years agoRevert r291774 which caused buildbot failure.
Dehao Chen [Thu, 12 Jan 2017 16:56:18 +0000 (16:56 +0000)]
Revert r291774 which caused buildbot failure.

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

7 years agoPass -fprofile-sample-use to lto backends.
Dehao Chen [Thu, 12 Jan 2017 16:29:25 +0000 (16:29 +0000)]
Pass -fprofile-sample-use to lto backends.

Summary: LTO backend will not invoke SampleProfileLoader pass even if -fprofile-sample-use is specified. This patch passes the flag down so that pass manager can add the SampleProfileLoader pass correctly.

Reviewers: mehdi_amini, tejohnson

Subscribers: cfe-commits

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

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

7 years agoTracking exception specification source locations
Malcolm Parsons [Thu, 12 Jan 2017 16:11:28 +0000 (16:11 +0000)]
Tracking exception specification source locations

Summary:
We do not currently track the source locations for exception specifications such
that their source range can be queried through the AST. This leads to trying to
write more complex code to determine the source range for uses like FixItHints
(see D18575 for an example). In addition to use within tools like clang-tidy, I
think this information may become more important to track as exception
specifications become more integrated into the type system.

Patch by Don Hinton.

Reviewers: rsmith

Subscribers: malcolm.parsons, sbarzowski, alexfh, hintonda, cfe-commits

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

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

7 years agoAvoid multiple -Wunreachable-code diagnostics that are triggered by
Alex Lorenz [Thu, 12 Jan 2017 10:48:03 +0000 (10:48 +0000)]
Avoid multiple -Wunreachable-code diagnostics that are triggered by
the same source range and use the unary operator fixit only when it
actually silences the warning.

rdar://24570531

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

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

7 years ago[analyzer] Avoid a crash in DereferenceChecker on string literal initializers.
Artem Dergachev [Thu, 12 Jan 2017 09:46:16 +0000 (09:46 +0000)]
[analyzer] Avoid a crash in DereferenceChecker on string literal initializers.

A hotfix for pr31592 that fixes the crash but not the root cause of the problem.
We need to update the analyzer engine further to account for AST changes
introduced in r289618. At the moment we're erroneously performing a redundant
lvalue-to-rvalue cast in this scenario, and squashing the rvalue of the object
bound to the reference into the reference itself.

rdar://problem/28832541

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

7 years agoPR31469: Don't add friend template class decls to redecl chain in dependent contexts.
Vassil Vassilev [Thu, 12 Jan 2017 09:16:26 +0000 (09:16 +0000)]
PR31469: Don't add friend template class decls to redecl chain in dependent contexts.

Fixes a crash in modules where the template class decl becomes the most recent
decl in the redeclaration chain and forcing the template instantiator try to
instantiate the friend declaration, rather than the template definition.

In practice, A::list<int> produces a TemplateSpecializationType
A::__1::list<int, allocator<type-parameter-0-0> >' failing to replace to
subsitute the default argument to allocator<int>.

Kudos Richard Smith (D28399).

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

7 years agoRemove redundant passing around of a "ContainsAutoType" flag.
Richard Smith [Thu, 12 Jan 2017 02:27:38 +0000 (02:27 +0000)]
Remove redundant passing around of a "ContainsAutoType" flag.

This flag serves no purpose other than to prevent us walking through a type to
check whether it contains an 'auto' specifier; this duplication of information
is error-prone, does not appear to provide any performance benefit, and will
become less practical once we support C++1z deduced class template types and
eventually constrained types from the Concepts TS.

No functionality change intended.

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

7 years ago[index] Introduce symbol subkinds to mark an accessor getter or setter.
Argyrios Kyrtzidis [Wed, 11 Jan 2017 21:42:48 +0000 (21:42 +0000)]
[index] Introduce symbol subkinds to mark an accessor getter or setter.

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

7 years ago[index] Ignore invalid ObjC categories.
Argyrios Kyrtzidis [Wed, 11 Jan 2017 21:08:31 +0000 (21:08 +0000)]
[index] Ignore invalid ObjC categories.

We currently are unable to get a USR for those and it doesn't seem useful to try to index them.

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

7 years ago[index] Add 'IBTypeOf' relation for ObjC methods marked with IBAction and properties...
Argyrios Kyrtzidis [Wed, 11 Jan 2017 21:01:07 +0000 (21:01 +0000)]
[index] Add 'IBTypeOf' relation for ObjC methods marked with IBAction and properties with IBOutletCollection.

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

7 years ago[PowerPC] Fix the wrong implementation of builtin vec_rlnm.
Tony Jiang [Wed, 11 Jan 2017 20:59:42 +0000 (20:59 +0000)]
[PowerPC] Fix the wrong implementation of builtin vec_rlnm.

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

7 years ago[index] Add 'contained-by' relation between references and their lexical container.
Argyrios Kyrtzidis [Wed, 11 Jan 2017 20:51:10 +0000 (20:51 +0000)]
[index] Add 'contained-by' relation between references and their lexical container.

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

7 years agoModule: Do not add any link flags when an implementation TU of a module imports
Manman Ren [Wed, 11 Jan 2017 18:47:38 +0000 (18:47 +0000)]
Module: Do not add any link flags when an implementation TU of a module imports
a header of that same module.

This fixes a regression caused by r280409.
rdar://problem/29930553

This is an updated version for r291628 (which was reverted in r291688).

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

7 years agoThis reverts r291628. As suggested by Richard, we can simply
Manman Ren [Wed, 11 Jan 2017 18:32:30 +0000 (18:32 +0000)]
This reverts r291628. As suggested by Richard, we can simply
filter out the implicilty imported modules at CodeGen instead of removing the
implicit ImportDecl when an implementation TU of a module imports a header of
that same module.

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

7 years agoUnbreak the clang-fuzzer build after r291184.
Benjamin Kramer [Wed, 11 Jan 2017 16:42:26 +0000 (16:42 +0000)]
Unbreak the clang-fuzzer build after r291184.

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

7 years agoRemove repeated word in comment (NFC)
Malcolm Parsons [Wed, 11 Jan 2017 11:23:22 +0000 (11:23 +0000)]
Remove repeated word in comment (NFC)

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

7 years ago[Modules] Support #import when entering files with modules
Bruno Cardoso Lopes [Wed, 11 Jan 2017 02:14:51 +0000 (02:14 +0000)]
[Modules] Support #import when entering files with modules

Textual headers and builtins that are #import'd from different
modules should get re-entered when these modules are independent
from each other.

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

rdar://problem/25881934

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

7 years ago[analyzer] Fix crash in body farm for getter without implicit self.
Devin Coughlin [Wed, 11 Jan 2017 01:02:34 +0000 (01:02 +0000)]
[analyzer] Fix crash in body farm for getter without implicit self.

Fix a crash in body farm when synthesizing a getter for a property
synthesized for a property declared in a protocol on a class extension
that shadows a declaration of the property in a category.

In this case, Sema doesn't fill in the implicit 'self' parameter for the getter
in the category, which leads to a crash when trying to synthesize the getter
for it.

To avoid the crash, skip getter synthesis in body farm if the self parameter is
not filled int.

rdar://problem/29938138

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

7 years agoModule: Do not create Implicit ImportDecl for module X if we
Manman Ren [Wed, 11 Jan 2017 00:48:19 +0000 (00:48 +0000)]
Module: Do not create Implicit ImportDecl for module X if we
 are building an implemenation of module X.

This fixes a regression caused by r280409.
rdar://problem/29930553

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

7 years agoRemove dead code.
Richard Smith [Tue, 10 Jan 2017 23:04:46 +0000 (23:04 +0000)]
Remove dead code.

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