]> granicus.if.org Git - clang/log
clang
7 years agoWdocumentation fix
Simon Pilgrim [Fri, 30 Dec 2016 22:55:33 +0000 (22:55 +0000)]
Wdocumentation fix

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

7 years ago[clang] Minor fix to libASTMatcherTutorial
Mads Ravn [Fri, 30 Dec 2016 20:49:44 +0000 (20:49 +0000)]
[clang] Minor fix to libASTMatcherTutorial

There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.

One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .

I found and fixed the error and one additional error.

Reviewers: aaron.ballman, malcolm.parsons

Subscribers: cfe-commits

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

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

7 years agoCodeGen: use a StringSwitch instead of cascasding ifs
Saleem Abdulrasool [Fri, 30 Dec 2016 18:45:03 +0000 (18:45 +0000)]
CodeGen: use a StringSwitch instead of cascasding ifs

Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

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

7 years agoAllow lexer to handle string_view literals. Patch from Anton Bikineev.
Eric Fiselier [Fri, 30 Dec 2016 04:51:10 +0000 (04:51 +0000)]
Allow lexer to handle string_view literals. Patch from Anton Bikineev.

This implements the compiler side of p0403r0. This patch was reviewed as
https://reviews.llvm.org/D26829.

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

7 years agoRemove bogus assertion and add testcase that triggers it.
Richard Smith [Fri, 30 Dec 2016 04:32:02 +0000 (04:32 +0000)]
Remove bogus assertion and add testcase that triggers it.

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma
Kelvin Li [Thu, 29 Dec 2016 22:16:30 +0000 (22:16 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma

This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma.

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

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

7 years ago[ADT] Delete RefCountedBaseVPTR.
Justin Lebar [Thu, 29 Dec 2016 19:59:26 +0000 (19:59 +0000)]
[ADT] Delete RefCountedBaseVPTR.

Summary:
This class is unnecessary.

Its comment indicated that it was a compile error to allocate an
instance of a class that inherits from RefCountedBaseVPTR on the stack.
This may have been true at one point, but it's not today.

Moreover you really do not want to allocate *any* refcounted object on
the stack, vptrs or not, so if we did have a way to prevent these
objects from being stack-allocated, we'd want to apply it to regular
RefCountedBase too, obviating the need for a separate RefCountedBaseVPTR
class.

It seems that the main way RefCountedBaseVPTR provides safety is by
making its subclass's destructor virtual.  This may have been helpful at
one point, but these days clang will emit an error if you define a class
with virtual functions that inherits from RefCountedBase but doesn't
have a virtual destructor.

Reviewers: compnerd, dblaikie

Subscribers: cfe-commits, klimek, llvm-commits, mgorny

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

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

7 years ago[ItaniumABI] NFC changes
Piotr Padlewski [Wed, 28 Dec 2016 18:26:08 +0000 (18:26 +0000)]
[ItaniumABI] NFC changes

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

7 years agoRevert "Mention devirtualization in release notes"
Piotr Padlewski [Wed, 28 Dec 2016 18:25:30 +0000 (18:25 +0000)]
Revert "Mention devirtualization in release notes"

Accidental commit. LLVM changes have not been pushed yet
This reverts commit 592453413690a2d16784667d1644758b9af700c1.

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

7 years agoMention devirtualization in release notes
Piotr Padlewski [Wed, 28 Dec 2016 18:23:23 +0000 (18:23 +0000)]
Mention devirtualization in release notes

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

7 years ago[ThinLTO] No need to rediscover imports in distributed backend
Teresa Johnson [Wed, 28 Dec 2016 18:00:08 +0000 (18:00 +0000)]
[ThinLTO] No need to rediscover imports in distributed backend

Summary:
We can simply import all external values with summaries included in
the individual index file created for the distributed backend job,
as only those are added to the individual index file created by the
WriteIndexesThinBackend (in addition to summaries for the original
module, which are skipped here).

While computing the cross module imports on this index would come to
the same conclusion as the original thin link import logic, it is
unnecessary work. And when tuning, it avoids the need to pass the
same function importing parameters (e.g. -import-instr-limit) to
both the thin link and the backends (otherwise they won't make the
same decisions).

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits

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

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

7 years agoFix format. NFC
Kelvin Li [Wed, 28 Dec 2016 17:57:07 +0000 (17:57 +0000)]
Fix format. NFC

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

7 years agoRevert "Driver: switch Windows to static RelocModel"
Reid Kleckner [Wed, 28 Dec 2016 17:41:36 +0000 (17:41 +0000)]
Revert "Driver: switch Windows to static RelocModel"

This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

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

7 years ago[ThinLTO] Add missing FileCheck invocation
Teresa Johnson [Wed, 28 Dec 2016 16:45:37 +0000 (16:45 +0000)]
[ThinLTO] Add missing FileCheck invocation

One of the intended checks was not being performed.

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

7 years ago[CodeGen] Unique constant CompoundLiterals.
George Burgess IV [Wed, 28 Dec 2016 07:27:40 +0000 (07:27 +0000)]
[CodeGen] Unique constant CompoundLiterals.

Our newly aggressive constant folding logic makes it possible for
CGExprConstant to see the same CompoundLiteralExpr more than once. So,
emitting a new GlobalVariable every time we see a CompoundLiteral is no
longer correct.

We had a similar issue with BlockExprs that was caught while testing
said aggressive folding, so I applied the same style of fix (see D26410)
here. If we find yet another case where this needs to happen, we should
probably refactor this so we don't have a third DenseMap+getter+setter.

As a design note: getAddrOfConstantCompoundLiteralIfEmitted is really
only intended to be called by ConstExprEmitter::EmitLValue. So,
returning a GlobalVariable* instead of a ConstantAddress costs us
effectively nothing, and saves us either a few bytes per entry in our
map or a bit of code duplication.

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

7 years agoMark 'auto' as dependent when instantiating the type of a non-type template
Richard Smith [Wed, 28 Dec 2016 06:27:18 +0000 (06:27 +0000)]
Mark 'auto' as dependent when instantiating the type of a non-type template
parameter. Fixes failed deduction for 'auto' non-type template parameters
nested within templates.

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

7 years agoDR1315: a non-type template argument in a partial specialization is permitted
Richard Smith [Wed, 28 Dec 2016 02:37:25 +0000 (02:37 +0000)]
DR1315: a non-type template argument in a partial specialization is permitted
to make reference to template parameters. This is only a partial
implementation; we retain the restriction that the argument must not be
type-dependent, since it's unclear how that would work given the existence of
other language rules requiring an exact type match in this context, even for
type-dependent cases (a question has been raised on the core reflector).

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

7 years agoUpdate test that relies on the optimizer to match new output.
Michael Kuperstein [Wed, 28 Dec 2016 00:30:43 +0000 (00:30 +0000)]
Update test that relies on the optimizer to match new output.

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

7 years agoDebugInfo: Don't include size/alignment on class declarations
David Blaikie [Tue, 27 Dec 2016 22:05:35 +0000 (22:05 +0000)]
DebugInfo: Don't include size/alignment on class declarations

This seems like it must've been a leftover by accident - no tests were
backing it up & it doesn't make much sense to include size/alignment on
class declarations (it'd only be on those declarations for which the
definition was available - otherwise the size/alignment would not be
known).

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

7 years agoAdd warning flag for "partial specialization is not more specialized than primary...
Richard Smith [Tue, 27 Dec 2016 20:03:09 +0000 (20:03 +0000)]
Add warning flag for "partial specialization is not more specialized than primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning.

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

7 years ago[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.
Ekaterina Romanova [Tue, 27 Dec 2016 18:53:29 +0000 (18:53 +0000)]
[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.

Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.

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

7 years agoDR1495: A partial specialization is ill-formed if it is not (strictly) more
Richard Smith [Tue, 27 Dec 2016 07:56:27 +0000 (07:56 +0000)]
DR1495: A partial specialization is ill-formed if it is not (strictly) more
specialized than the primary template. (Put another way, if we imagine there
were a partial specialization matching the primary template, we should never
select it if some other partial specialization also matches.)

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

7 years agoAdd reference/non-reference mismatch test.
Richard Smith [Tue, 27 Dec 2016 06:18:22 +0000 (06:18 +0000)]
Add reference/non-reference mismatch test.

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

7 years agoWork around a standard defect: template argument deduction for non-type
Richard Smith [Tue, 27 Dec 2016 06:14:37 +0000 (06:14 +0000)]
Work around a standard defect: template argument deduction for non-type
template parameters of reference type basically doesn't work, because we're
always deducing from an argument expression of non-reference type, so the type
of the deduced expression never matches. Instead, compare the type of an
expression naming the parameter to the type of the argument.

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

7 years agoEmit CCEDiags when evaluating a const variable.
George Burgess IV [Tue, 27 Dec 2016 05:33:20 +0000 (05:33 +0000)]
Emit CCEDiags when evaluating a const variable.

This addresses post-review feedback from r290577.

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

7 years ago[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added...
Craig Topper [Tue, 27 Dec 2016 04:04:57 +0000 (04:04 +0000)]
[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects.

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

7 years agoRevert r290574 "foo"
Craig Topper [Tue, 27 Dec 2016 04:03:29 +0000 (04:03 +0000)]
Revert r290574 "foo"

This was supposed to be merged with another commit with a real commit message. Sorry.

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

7 years agoRevert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with...
Craig Topper [Tue, 27 Dec 2016 04:03:25 +0000 (04:03 +0000)]
Revert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects."

I failed to merge this with r290574.

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

7 years agoAdd a test for `const` folding introduced by r290297. NFC.
George Burgess IV [Tue, 27 Dec 2016 04:01:22 +0000 (04:01 +0000)]
Add a test for `const` folding introduced by r290297. NFC.

AFAICT, we didn't add a test targeted at the new "const can sometimes
act as constexpr" behavior introduced by r290297.

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

7 years agoFactor out repeated code for deducing a non-type template parameter as a given
Richard Smith [Tue, 27 Dec 2016 03:59:58 +0000 (03:59 +0000)]
Factor out repeated code for deducing a non-type template parameter as a given
argument value. No functionality change intended.

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

7 years ago[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added...
Craig Topper [Tue, 27 Dec 2016 03:46:16 +0000 (03:46 +0000)]
[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects.

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

7 years agofoo
Craig Topper [Tue, 27 Dec 2016 03:46:13 +0000 (03:46 +0000)]
foo

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

7 years agoDriver: switch Windows to static RelocModel
Saleem Abdulrasool [Tue, 27 Dec 2016 02:20:35 +0000 (02:20 +0000)]
Driver: switch Windows to static RelocModel

Windows uses PE/COFF which is inherently position independent.  The use
of the PIC model is unnecessary.  In fact, we would generate invalid
code using the ELF PIC model when PIC was enabled previously.  Now that
we no longer accept -fPIC and -fpoc, this switches the internal
representation to the static model to permit us to make PIC modules
invalid when targeting Windows.  This should not change the code
generation, only the internal state management.

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

7 years agoCheck and build conversion sequences for non-type template arguments in
Richard Smith [Tue, 27 Dec 2016 02:02:09 +0000 (02:02 +0000)]
Check and build conversion sequences for non-type template arguments in
dependent contexts when processing the template in C++11 and C++14, just like
we do in C++98 and C++1z. This allows us to diagnose invalid templates earlier.

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

7 years ago[DOXYGEN] Improved doxygen comments for x86 intrinsics.
Ekaterina Romanova [Tue, 27 Dec 2016 00:49:38 +0000 (00:49 +0000)]
[DOXYGEN] Improved doxygen comments for x86 intrinsics.

Improved doxygen comments for the following intrinsics headers:  __wmmintrin_pclmul.h, bmiintrin.h, emmintrin.h, f16cintrin.h, immintrin.h, mmintrin.h, pmmintrin.h, tmmintrin.h

Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.

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

7 years ago[PM] The new pass manager requires a registered target for these, and
Chandler Carruth [Tue, 27 Dec 2016 00:31:34 +0000 (00:31 +0000)]
[PM] The new pass manager requires a registered target for these, and
given that they hard code specific triples that seems reasonable so add
the REQUIRES.

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

7 years ago[PH] Teach the new PM code path to support -disable-llvm-passes.
Chandler Carruth [Tue, 27 Dec 2016 00:13:09 +0000 (00:13 +0000)]
[PH] Teach the new PM code path to support -disable-llvm-passes.

This is kind of funny because I specifically did work to make this easy
and then it didn't actually get implemented.

I've also ported a set of tests that rely on this functionality to run
with the new PM as well as the old PM so that we don't mess this up in
the future.

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

7 years agoUpdate comment to match dr1770.
Richard Smith [Mon, 26 Dec 2016 22:28:29 +0000 (22:28 +0000)]
Update comment to match dr1770.

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

7 years agoWdocumentation fix
Simon Pilgrim [Mon, 26 Dec 2016 18:11:49 +0000 (18:11 +0000)]
Wdocumentation fix

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

7 years agoFix build error caused by r290539.
Marina Yatsina [Mon, 26 Dec 2016 13:16:40 +0000 (13:16 +0000)]
Fix build error caused by r290539.

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

7 years ago[inline-asm]No error for conflict between inputs\outputs and clobber list
Marina Yatsina [Mon, 26 Dec 2016 12:23:42 +0000 (12:23 +0000)]
[inline-asm]No error for conflict between inputs\outputs and clobber list

According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict.
for example:

const long double a = 0.0;
int main()
{

char b;
double t1 = a;
__asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)");

return 0;
}

This should conflict with the output - t1 which is st, and st which is st aswell.
The patch fixes it.

Commit on behald of Ziv Izhar.

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

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

7 years agotest: add explicit triples to the invocation
Saleem Abdulrasool [Mon, 26 Dec 2016 04:00:54 +0000 (04:00 +0000)]
test: add explicit triples to the invocation

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

7 years agoDriver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows
Saleem Abdulrasool [Mon, 26 Dec 2016 03:35:24 +0000 (03:35 +0000)]
Driver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows

Use of these flags would result in the use of ELF-style PIE/PIC code
which is incorrect on Windows.  Windows is inherently PIC by means of
the DLL slide that occurs at load.  This also mirrors the behaviour on
GCC for MinGW.  Currently, the Windows x86_64 forces the relocation
model to PIC (Level 2).  This is unchanged for now, though we should
remove any assumptions on that and change it to a static relocation
model.

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

7 years agoFix assertion failure when deducing an auto-typed argument against a different-width...
Richard Smith [Sun, 25 Dec 2016 20:21:12 +0000 (20:21 +0000)]
Fix assertion failure when deducing an auto-typed argument against a different-width int.

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

7 years ago[DebugInfo] Added support for Checksum debug info feature.
Amjad Aboud [Sun, 25 Dec 2016 10:12:27 +0000 (10:12 +0000)]
[DebugInfo] Added support for Checksum debug info feature.

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

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

7 years agoFix some subtle wrong partial ordering bugs particularly with C++1z auto-typed
Richard Smith [Sun, 25 Dec 2016 08:05:23 +0000 (08:05 +0000)]
Fix some subtle wrong partial ordering bugs particularly with C++1z auto-typed
non-type template parameters.

During partial ordering, when checking the substituted deduced template
arguments match the original, check the types of non-type template arguments
match even if they're dependent. The only way we get dependent types here is if
they really represent types of the other template (which are supposed to be
modeled as being substituted for unique, non-dependent types).

In order to make this work for auto-typed non-type template arguments, we need
to be able to perform auto deduction even when the initializer and
(potentially) the auto type are dependent, support for which is the bulk of
this patch. (Note that this requires the ability to deduce only a single level
of a multi-level dependent type.)

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

7 years ago[MS ABI] Mangle unnamed enums correctly
David Majnemer [Sun, 25 Dec 2016 05:26:02 +0000 (05:26 +0000)]
[MS ABI] Mangle unnamed enums correctly

Unnamed enums take the name of the first enumerator they define.

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute' pragma
Kelvin Li [Sun, 25 Dec 2016 04:52:54 +0000 (04:52 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute' pragma

This patch is to implement sema and parsing for 'target teams distribute' pragma.

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

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

7 years agoFix for PR15623 (corrected r290413 reverted at 290415). The patch eliminates unwanted...
Anton Yartsev [Sun, 25 Dec 2016 00:57:51 +0000 (00:57 +0000)]
Fix for PR15623 (corrected r290413 reverted at 290415). The patch eliminates unwanted ProgramState checker data propagation from an operand of the logical operation to operation result.
The patch also simplifies an assume of a constraint of the form: "(exp comparison_op expr) != 0" to true into an assume of "exp comparison_op expr" to true. (And similarly, an assume of the form "(exp comparison_op expr) == 0" to true as an assume of exp comparison_op expr to false.) which improves precision overall.
https://reviews.llvm.org/D22862

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

7 years agoFactor out duplication between partial ordering for class template partial
Richard Smith [Sat, 24 Dec 2016 16:40:51 +0000 (16:40 +0000)]
Factor out duplication between partial ordering for class template partial
specializations and variable template partial specializations.

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

7 years agoDeduplicate several GD.getDecl() calls into Decl * local variable.
Yaron Keren [Sat, 24 Dec 2016 15:32:39 +0000 (15:32 +0000)]
Deduplicate several GD.getDecl() calls into Decl * local variable.

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

7 years ago[ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.
Malcolm Parsons [Sat, 24 Dec 2016 13:35:14 +0000 (13:35 +0000)]
[ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.

Summary:
I needed to know whether a FieldDecl had an in-class
initializer for D26453. I used a narrowing matcher there, but a
traversal matcher might be generally useful.

Reviewers: sbenza, bkramer, klimek, aaron.ballman

Subscribers: aaron.ballman, Prazek, cfe-commits

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

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

7 years ago[ASTMatchers] Fix doc for hasBitWidth
Malcolm Parsons [Sat, 24 Dec 2016 13:22:26 +0000 (13:22 +0000)]
[ASTMatchers] Fix doc for hasBitWidth

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

7 years agoRemove accidentally-left-behind commented out code.
Richard Smith [Sat, 24 Dec 2016 04:22:52 +0000 (04:22 +0000)]
Remove accidentally-left-behind commented out code.

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

7 years agoFix crash if substitution fails during deduction of variable template partial special...
Richard Smith [Sat, 24 Dec 2016 04:20:31 +0000 (04:20 +0000)]
Fix crash if substitution fails during deduction of variable template partial specialization arguments.

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

7 years agoWhen producing a name of a partial specialization in a diagnostic, use the
Richard Smith [Sat, 24 Dec 2016 04:09:05 +0000 (04:09 +0000)]
When producing a name of a partial specialization in a diagnostic, use the
template arguments as written rather than the canonical template arguments,
so we print more user-friendly names for template parameters.

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

7 years agoclangCodeGen: Add LLVMPasses to libdeps. r290450 introduced it.
NAKAMURA Takumi [Sat, 24 Dec 2016 01:55:12 +0000 (01:55 +0000)]
clangCodeGen: Add LLVMPasses to libdeps. r290450 introduced it.

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

7 years agoArrayRefize lists of TemplateArguments in template argument deduction.
Richard Smith [Fri, 23 Dec 2016 23:46:56 +0000 (23:46 +0000)]
ArrayRefize lists of TemplateArguments in template argument deduction.

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

7 years ago[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.
Ekaterina Romanova [Fri, 23 Dec 2016 23:36:26 +0000 (23:36 +0000)]
[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.

Added \n commands to insert a line breaks where necessary to make the documentation more readable.
Formatted comments to fit into 80 chars.

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

7 years ago[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.
Ekaterina Romanova [Fri, 23 Dec 2016 22:47:16 +0000 (22:47 +0000)]
[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.

Tagged parameter names with \a doxygen command to display parameters in italics.
Added \n commands to insert a line break to make the documentation more readable.
Formatted comments to fit into 80 chars.

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

7 years ago[PM] Fix up from r290449 to start requiring the x86 target to be
Chandler Carruth [Fri, 23 Dec 2016 21:19:16 +0000 (21:19 +0000)]
[PM] Fix up from r290449 to start requiring the x86 target to be
available.

It doesn't seem terribly important to test this with a specific target
triple but without that target available.

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

7 years ago[PM] Introduce options to enable the (still experimental) new pass
Chandler Carruth [Fri, 23 Dec 2016 20:44:01 +0000 (20:44 +0000)]
[PM] Introduce options to enable the (still experimental) new pass
manager, and a code path to use it.

The option is actually a top-level option but does contain
'experimental' in the name. This is the compromise suggested by Richard
in discussions. We expect this option will be around long enough and
have enough users towards the end that it merits not being relegated to
CC1, but it still needs to be clear that this option will go away at
some point.

The backend code is a fresh codepath dedicated to handling the flow with
the new pass manager. This was also Richard's suggested code structuring
to essentially leave a clean path for development rather than carrying
complexity or idiosyncracies of how we do things just to share code with
the parts of this in common with the legacy pass manager. And it turns
out, not much is really in common even though we use the legacy pass
manager for codegen at this point.

I've switched a couple of tests to run with the new pass manager, and
they appear to work. There are still plenty of bugs that need squashing
(just with basic experiments I've found two already!) but they aren't in
this code, and the whole point is to expose the necessary hooks to start
experimenting with the pass manager in more realistic scenarios.

That said, I want to *strongly caution* anyone itching to play with
this: it is still *very shaky*. Several large components have not yet
been shaken down. For example I have bugs in both the always inliner and
inliner that I have already spotted and will be fixing independently.

Still, this is a fun milestone. =D

One thing not in this patch (but that might be very reasonable to add)
is some level of support for raw textual pass pipelines such as what
Sean had a patch for some time ago. I'm mostly interested in the more
traditional flow of getting the IR out of Clang and then running it
through opt, but I can see other use cases so someone may want to add
it.

And of course, *many* features are not yet supported!
- O1 is currently more like O2
- None of the sanitizers are wired up
- ObjC ARC optimizer isn't wired up
- ...

So plenty of stuff still lef to do!

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

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

7 years agoExtend the tests for -Wmissing-variable-declarations.
Ed Schouten [Fri, 23 Dec 2016 19:20:07 +0000 (19:20 +0000)]
Extend the tests for -Wmissing-variable-declarations.

We shouldn't throw a warning when the static keyword is not present in
an anonymous namespace, just like we do for -Wmissing-prototypes.

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

7 years ago[OpenCL] Align fake address space map with the SPIR target maps.
Egor Churaev [Fri, 23 Dec 2016 16:11:25 +0000 (16:11 +0000)]
[OpenCL] Align fake address space map with the SPIR target maps.

Summary:
We compile user opencl kernel code with spir triple. But built-ins are written in OpenCL and we compile it with triple x86_64 to be able to use x86 intrinsics. And we need address spaces to match in both cases. So, we change fake address space map in OpenCL for matching with spir.

On CPU address spaces are not really important but we'd like to preserve address space information in order to perform optimizations relying on this info like enhanced alias analysis.

Reviewers: pekka.jaaskelainen, Anastasia

Subscribers: pekka.jaaskelainen, yaxunl, bader, cfe-commits

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

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

7 years agoFix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand."
Egor Churaev [Fri, 23 Dec 2016 14:55:49 +0000 (14:55 +0000)]
Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand."

Summary: Fixed warnings in commit: https://reviews.llvm.org/rL290171

Reviewers: djasper, Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years agoUse after move bug fixes
Piotr Padlewski [Fri, 23 Dec 2016 11:40:44 +0000 (11:40 +0000)]
Use after move bug fixes

Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy.

Reviewers: rsmith, mboehme

Subscribers: cfe-commits, klimek

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

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

7 years agoAdd an assert to catch improperly constructed %diff sequences in
Chandler Carruth [Fri, 23 Dec 2016 05:19:47 +0000 (05:19 +0000)]
Add an assert to catch improperly constructed %diff sequences in
diagnostics and fix one such diagnostic.

Sadly, this assert doesn't catch this bug because we have no tests that
emit this diagnostic! Doh! I'm following up on the commit that
introduces it to get that fixed. Then this assert will help in a more
direct way.

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

7 years agoRevert changes made by r290413 until regression is fixed.
Anton Yartsev [Fri, 23 Dec 2016 04:09:18 +0000 (04:09 +0000)]
Revert changes made by r290413 until regression is fixed.

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

7 years agoFix for PR15623. The patch eliminates unwanted ProgramState checker data propagation...
Anton Yartsev [Fri, 23 Dec 2016 03:31:00 +0000 (03:31 +0000)]
Fix for PR15623. The patch eliminates unwanted ProgramState checker data propagation from an operand of the logical operation to operation result.
The patch also simplifies an assume of a constraint of the form: "(exp comparison_op expr) != 0" to true into an assume of "exp comparison_op expr" to true. (And similarly, an assume of the form "(exp comparison_op expr) == 0" to true as an assume of exp comparison_op expr to false.) which improves precision overall.
https://reviews.llvm.org/D22862

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

7 years agoMove generation of injected template arguments for a template parameter list
Richard Smith [Fri, 23 Dec 2016 02:10:11 +0000 (02:10 +0000)]
Move generation of injected template arguments for a template parameter list
out of an internal function and into ASTContext; this is needed in template
argument deduction for P0522R0.

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

7 years agoOnly substitute into type of non-type template parameter once, rather than
Richard Smith [Fri, 23 Dec 2016 02:00:24 +0000 (02:00 +0000)]
Only substitute into type of non-type template parameter once, rather than
twice, in finalization of template argument deduction.

This is a re-commit of r290310 (reverted in r290329); the bug found by the
buildbots was fixed in r290399 (we would sometimes build a deduced template
argument with a bogus type).

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

7 years agoWhen merging two deduced non-type template arguments for the same parameter,
Richard Smith [Fri, 23 Dec 2016 01:30:39 +0000 (01:30 +0000)]
When merging two deduced non-type template arguments for the same parameter,
fail the merge if the arguments have different types (except if one of them was
deduced from an array bound, in which case take the type from the other).

This is correct because (except in the array bound case) the type of the
template argument in each deduction must match the type of the parameter, so at
least one of the two deduced arguments must have a mismatched type.

This is necessary because we would otherwise lose the type information for the
discarded template argument in the merge, and fail to diagnose the mismatch.

In order to power this, we now properly retain the type of a deduced non-type
template argument deduced from a declaration, rather than giving it the type of
the template parameter; we'll convert it to the template parameter type when
checking the deduced arguments.

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

7 years agoCleanup the handling of noinline function attributes, -fno-inline,
Chandler Carruth [Fri, 23 Dec 2016 01:24:49 +0000 (01:24 +0000)]
Cleanup the handling of noinline function attributes, -fno-inline,
-fno-inline-functions, -O0, and optnone.

These were really, really tangled together:
- We used the noinline LLVM attribute for -fno-inline
  - But not for -fno-inline-functions (breaking LTO)
  - But we did use it for -finline-hint-functions (yay, LTO is happy!)
  - But we didn't for -O0 (LTO is sad yet again...)
- We had weird structuring of CodeGenOpts with both an inlining
  enumeration and a boolean. They interacted in weird ways and
  needlessly.
- A *lot* of set smashing went on with setting these, and then got worse
  when we considered optnone and other inlining-effecting attributes.
- A bunch of inline affecting attributes were managed in a completely
  different place from -fno-inline.
- Even with -fno-inline we failed to put the LLVM noinline attribute
  onto many generated function definitions because they didn't show up
  as AST-level functions.
- If you passed -O0 but -finline-functions we would run the normal
  inliner pass in LLVM despite it being in the O0 pipeline, which really
  doesn't make much sense.
- Lastly, we used things like '-fno-inline' to manipulate the pass
  pipeline which forced the pass pipeline to be much more
  parameterizable than it really needs to be. Instead we can *just* use
  the optimization level to select a pipeline and control the rest via
  attributes.

Sadly, this causes a bunch of churn in tests because we don't run the
optimizer in the tests and check the contents of attribute sets. It
would be awesome if attribute sets were a bit more FileCheck friendly,
but oh well.

I think this is a significant improvement and should remove the semantic
need to change what inliner pass we run in order to comply with the
requested inlining semantics by relying completely on attributes. It
also cleans up tho optnone and related handling a bit.

One unfortunate aspect of this is that for generating alwaysinline
routines like those in OpenMP we end up removing noinline and then
adding alwaysinline. I tried a bunch of other approaches, but because we
recompute function attributes from scratch and don't have a declaration
here I couldn't find anything substantially cleaner than this.

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

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

7 years agoMake '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.
Chandler Carruth [Fri, 23 Dec 2016 00:23:01 +0000 (00:23 +0000)]
Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.

Much to my surprise, '-disable-llvm-optzns' which I thought was the
magical flag I wanted to get at the raw LLVM IR coming out of Clang
deosn't do that. It still runs some passes over the IR. I don't want
that, I really want the *raw* IR coming out of Clang and I strongly
suspect everyone else using it is in the same camp.

There is actually a flag that does what I want that I didn't know about
called '-disable-llvm-passes'. I suspect many others don't know about it
either. It both does what I want and is much simpler.

This removes the confusing version and makes that spelling of the flag
an alias for '-disable-llvm-passes'. I've also moved everything in Clang
to use the 'passes' spelling as it seems both more accurate (*all* LLVM
passes are disabled, not just optimizations) and much easier to remember
and spell correctly.

This is part of simplifying how Clang drives LLVM to make it cleaner to
wire up to the new pass manager.

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

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

7 years agoFix example: byref struct's init was incorrect, and the block literal's holder should...
Jonathan Roelofs [Thu, 22 Dec 2016 23:48:23 +0000 (23:48 +0000)]
Fix example: byref struct's init was incorrect, and the block literal's holder should point to it.

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

7 years agoTestbed and skeleton of a new expression parser
Sean Callanan [Thu, 22 Dec 2016 20:03:14 +0000 (20:03 +0000)]
Testbed and skeleton of a new expression parser

Recommitted after formal approval.

LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.

Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.

Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.

I propose that the parts required to build a simple expression parser be added to Clang. Initially, I aim to have the following features:

A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.
A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.
This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter. When complete, this tester will implement the first of the above goals.

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

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

7 years ago[OPENMP] Fix for PR31417: assert failure when compiling trivial openmp
Alexey Bataev [Thu, 22 Dec 2016 19:44:05 +0000 (19:44 +0000)]
[OPENMP] Fix for PR31417: assert failure when compiling trivial openmp
program

Offload related code is not quite ready yet, but some simple examples
must not crash the compiler. Patch fixes the problem in offloading code
with exceptions.

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

7 years agoFix warning introduced by r290297.
George Burgess IV [Thu, 22 Dec 2016 19:00:31 +0000 (19:00 +0000)]
Fix warning introduced by r290297.

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

7 years agoMake alloc_size only applicable to Functions.
George Burgess IV [Thu, 22 Dec 2016 18:48:34 +0000 (18:48 +0000)]
Make alloc_size only applicable to Functions.

I don't remember why I didn't make alloc_size only applicable to
Functions a year ago, but I can't see any compelling reason not to do
so now.

Fixes PR31453.

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

7 years ago[analyzer] Update GTestChecker to tighten API detection
Devin Coughlin [Thu, 22 Dec 2016 17:52:57 +0000 (17:52 +0000)]
[analyzer] Update GTestChecker to tighten API detection

Update the GTestChecker to tighten up the API detection and make it
cleaner in response to post-commit feedback. Also add tests for when
temporary destructors are enabled to make sure we get the expected behavior
when inlining constructors for temporaries.

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

7 years ago[analyzer] Improve suppress-on-sink behavior in incomplete analyses.
Artem Dergachev [Thu, 22 Dec 2016 14:48:52 +0000 (14:48 +0000)]
[analyzer] Improve suppress-on-sink behavior in incomplete analyses.

Warnings with suppress-on-sink are discarded during FlushReports when
BugReporter notices that all paths in ExplodedGraph that pass through the
warning eventually run into a sink node.

However, suppress-on-sink fails to filter out false positives when the analysis
terminates too early - by running into analyzer limits, such as block count
limits or graph size limits - and the interruption hits the narrow window
between throwing the leak report and reaching the no-return function call. In
such case the report is there, however suppression-on-sink doesn't work, because
the sink node was never constructed in the incomplete ExplodedGraph.

This patch implements a very partial solution: also suppress reports thrown
against a statement-node that corresponds to a statement that belongs to a
no-return block of the CFG.

rdar://problem/28832541

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

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

7 years agoclang-format: Less eagerly try to keep label-value pairs on a line.
Daniel Jasper [Thu, 22 Dec 2016 12:37:06 +0000 (12:37 +0000)]
clang-format: Less eagerly try to keep label-value pairs on a line.

Before:
  string v =
      StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa,
                                                           aaaaaaaaaaaaaaa),
             bbbbbbbbbbbbbbbbbbbbbbb);

After:
  string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ",
                    SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa),
                    bbbbbbbbbbbbbbbbbbbbbbb);

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

7 years agoSpeculative revert of r290310 to see if that's the change that's making some of
Richard Smith [Thu, 22 Dec 2016 07:24:39 +0000 (07:24 +0000)]
Speculative revert of r290310 to see if that's the change that's making some of
the bots unhappy.

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

7 years ago[CrashReproducer] Add support for merging -ivfsoverlay
Bruno Cardoso Lopes [Thu, 22 Dec 2016 07:06:03 +0000 (07:06 +0000)]
[CrashReproducer] Add support for merging -ivfsoverlay

Merge all VFS mapped files inside -ivfsoverlay inputs into the vfs
overlay provided by the crash reproducer. This is the last missing piece
to allow crash reproducers to fully work with user frameworks; when
combined with headermaps, it allows clang to find additional frameworks.

rdar://problem/27913709

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

7 years agoMake FormatStyle.GetStyleOfFile test work on MSVC
Antonio Maiorano [Thu, 22 Dec 2016 05:10:07 +0000 (05:10 +0000)]
Make FormatStyle.GetStyleOfFile test work on MSVC

Modify getStyle to use vfs::FileSystem::makeAbsolute just like FS.addFile does,
rather than sys::fs::make_absolute. The latter gets the CWD from the platform,
while the former expects it to be set by the client, causing a mismatch when
converting relative paths to absolute.

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

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

7 years agoSema: print qualified name for overload candidates
Saleem Abdulrasool [Thu, 22 Dec 2016 04:26:57 +0000 (04:26 +0000)]
Sema: print qualified name for overload candidates

Print the fully qualified names for the overload candidates.  This makes
it easier to tell what the ambiguity is.  Especially if a template
is instantiated after a using namespace, it will not inherit the
namespace where it was declared.  The specialization will give a message
about a partial order being ambiguous for the same (unqualified) name,
which does not help identify the failure.

Addresses PR31450!

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

7 years agoOnly substitute into type of non-type template parameter once, rather than
Richard Smith [Thu, 22 Dec 2016 03:52:37 +0000 (03:52 +0000)]
Only substitute into type of non-type template parameter once, rather than
twice, in finalization of template argumetn deduction.

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

7 years agoDriver: use the triple to query the arch, not the toolchain
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:04 +0000 (03:09 +0000)]
Driver: use the triple to query the arch, not the toolchain

Although the result is the same, the intent is much more clear this way:
we care about the architecture we are targeting.  NFC.

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

7 years agoDriver: remove unnecessary parameter
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:02 +0000 (03:09 +0000)]
Driver: remove unnecessary parameter

We can query the Triple and EffectiveTriple from the ToolChain.  Avoid
passing in the argument and query it in the function.  NFC.

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

7 years agoDriver: rename parameter to reduce confusion
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:00 +0000 (03:09 +0000)]
Driver: rename parameter to reduce confusion

The parameter to ParsePICOpts passed the effective triple and then used
that in a few places and used the actual triple in others.  This was
slightly confusing.  Rename the parameter to make it more obvious.

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

7 years agoAdd the alloc_size attribute to clang, attempt 2.
George Burgess IV [Thu, 22 Dec 2016 02:50:20 +0000 (02:50 +0000)]
Add the alloc_size attribute to clang, attempt 2.

This is a recommit of r290149, which was reverted in r290169 due to msan
failures. msan was failing because we were calling
`isMostDerivedAnUnsizedArray` on an invalid designator, which caused us
to read uninitialized memory. To fix this, the logic of the caller of
said function was simplified, and we now have a `!Invalid` assert in
`isMostDerivedAnUnsizedArray`, so we can catch this particular bug more
easily in the future.

Fingers crossed that this patch sticks this time. :)

Original commit message:

This patch does three things:
- Gives us the alloc_size attribute in clang, which lets us infer the
  number of bytes handed back to us by malloc/realloc/calloc/any user
  functions that act in a similar manner.
- Teaches our constexpr evaluator that evaluating some `const` variables
  is OK sometimes. This is why we have a change in
  test/SemaCXX/constant-expression-cxx11.cpp and other seemingly
  unrelated tests. Richard Smith okay'ed this idea some time ago in
  person.
- Uniques some Blocks in CodeGen, which was reviewed separately at
  D26410. Lack of uniquing only really shows up as a problem when
  combined with our new eagerness in the face of const.

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

7 years agoPerform type-checking for a converted constant expression in a template
Richard Smith [Wed, 21 Dec 2016 21:42:57 +0000 (21:42 +0000)]
Perform type-checking for a converted constant expression in a template
argument even if the expression is value-dependent (we need to suppress the
final portion of the narrowing check, but the rest of the checking can still be
done eagerly).

This affects template template argument validity and partial ordering under
p0522r0.

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

7 years agoARM: define a macro for the FPv5 FPU in ARM mode.
Tim Northover [Wed, 21 Dec 2016 20:49:43 +0000 (20:49 +0000)]
ARM: define a macro for the FPv5 FPU in ARM mode.

FPv5 is in Cortex-M7 and the 64-bit CPUs when running in 32-bit mode. The name
is from the Cortex-M7 TRM.

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

7 years agoMake some diagnostic tests C++11 clean.
Paul Robinson [Wed, 21 Dec 2016 18:33:17 +0000 (18:33 +0000)]
Make some diagnostic tests C++11 clean.

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

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

7 years agoclang-format: Fix bug in handling of single-column lists.
Daniel Jasper [Wed, 21 Dec 2016 17:02:06 +0000 (17:02 +0000)]
clang-format: Fix bug in handling of single-column lists.

Members that are themselves wrapped in fake parentheses would lead to
AvoidBinPacking be set on the wrong ParenState.

After:
  vector<int> aaaa = {
      aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaa.aaaaaaa,
      aaaaaa.aaaaaaa,
      aaaaaa.aaaaaaa,
      aaaaaa.aaaaaaa,
  };

Before we were falling back to bin-packing these.

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

7 years agoWdocumentation fix
Simon Pilgrim [Wed, 21 Dec 2016 16:39:09 +0000 (16:39 +0000)]
Wdocumentation fix

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

7 years agoRename several methods on ASTRecordReader to follow LLVM style (lowerCamelCase).
David L. Jones [Wed, 21 Dec 2016 04:34:52 +0000 (04:34 +0000)]
Rename several methods on ASTRecordReader to follow LLVM style (lowerCamelCase).

Summary:
This follows up to r290217, and makes functions on ASTRecordReader consistent
and valid style.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

7 years agoFix windows build breakage in r290219. Unix path separators in testcase.
Graydon Hoare [Wed, 21 Dec 2016 03:00:11 +0000 (03:00 +0000)]
Fix windows build breakage in r290219. Unix path separators in testcase.

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

7 years agoFix defaulted-functions-in-C++98 extension to give the functions the same
Richard Smith [Wed, 21 Dec 2016 01:57:02 +0000 (01:57 +0000)]
Fix defaulted-functions-in-C++98 extension to give the functions the same
effect they would have in C++11. In particular, they do not prevent
value-initialization from performing zero-initialization, nor do they prevent a
struct from being an aggregate.

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

7 years ago[c++1z] When initializing a const-qualified class type, don't forget to add on
Richard Smith [Wed, 21 Dec 2016 01:31:56 +0000 (01:31 +0000)]
[c++1z] When initializing a const-qualified class type, don't forget to add on
the requested cv-qualifiers after construction. This usually doesn't matter,
but it does matter within a ?: operator.

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