]> granicus.if.org Git - clang/log
clang
8 years agoMove diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic...
Craig Topper [Sat, 14 Nov 2015 19:31:56 +0000 (19:31 +0000)]
Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics.

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

8 years agoFix indentation. NFC
Craig Topper [Sat, 14 Nov 2015 19:31:52 +0000 (19:31 +0000)]
Fix indentation. NFC

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

8 years agoMerge some similar diagnostics using %select.
Craig Topper [Sat, 14 Nov 2015 18:16:08 +0000 (18:16 +0000)]
Merge some similar diagnostics using %select.

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

8 years agoMinor formatting fixes. NFC
Craig Topper [Sat, 14 Nov 2015 18:16:02 +0000 (18:16 +0000)]
Minor formatting fixes. NFC

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

8 years agoFix 80 column violation. NFC.
Craig Topper [Sat, 14 Nov 2015 18:16:00 +0000 (18:16 +0000)]
Fix 80 column violation. NFC.

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

8 years agoFix spelling error in comment.
Craig Topper [Sat, 14 Nov 2015 18:15:55 +0000 (18:15 +0000)]
Fix spelling error in comment.

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

8 years ago[X86][MMX] Sorted MMX IR + assembly codegen builtin tests
Simon Pilgrim [Sat, 14 Nov 2015 13:25:06 +0000 (13:25 +0000)]
[X86][MMX] Sorted MMX IR + assembly codegen builtin tests

Makes it easier to track what tests are missing....

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

8 years ago[X86][MMX] Added MMX IR + assembly codegen builtin tests
Simon Pilgrim [Sat, 14 Nov 2015 12:47:44 +0000 (12:47 +0000)]
[X86][MMX] Added MMX IR + assembly codegen builtin tests

Improved tests as discussed in PR24580

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

8 years agoMark is_destructible/is_nothrow_destructible as implemented
David Majnemer [Sat, 14 Nov 2015 07:21:35 +0000 (07:21 +0000)]
Mark is_destructible/is_nothrow_destructible as implemented

These were implemented back in r244564.  However, I forgot to update the
docs.

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

8 years ago[modules] Allow "redefinition" of typedef of anon tag from unimported submodule
Ben Langmuir [Sat, 14 Nov 2015 03:26:14 +0000 (03:26 +0000)]
[modules] Allow "redefinition" of typedef of anon tag from unimported submodule

r233345 started being stricter about typedef names for linkage purposes
in non-visible modules, but broke languages without the ODR.

rdar://23527954

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

8 years agoAdd support for the always_inline + target feature diagnostic to print
Eric Christopher [Sat, 14 Nov 2015 02:38:37 +0000 (02:38 +0000)]
Add support for the always_inline + target feature diagnostic to print
out the first missing target feature that's required and reword
the diagnostic accordingly.

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

8 years agoUse %select to merge similar diagnostics. NFC
Craig Topper [Sat, 14 Nov 2015 02:09:55 +0000 (02:09 +0000)]
Use %select to merge similar diagnostics. NFC

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

8 years agoClarify and elaborate the conditions on which we're checking target
Eric Christopher [Sat, 14 Nov 2015 01:56:04 +0000 (01:56 +0000)]
Clarify and elaborate the conditions on which we're checking target
features for calls.

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

8 years agoMake some tests LLVM-optimization agnostic and remove some others that were beyond...
David Blaikie [Sat, 14 Nov 2015 01:10:38 +0000 (01:10 +0000)]
Make some tests LLVM-optimization agnostic and remove some others that were beyond value/repair

Several of these tests (the two deleted, and the one removal edit) were
relying on the optimizer to collapse things to test some frontend
feature. The tests were really old and features seemed amply covered by
other parts of the test suite, so I just removed them.

If anyone thinks they're valuable enough to keep/fix, we can play around
with that, for sure.

(inspired by r252872)

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

8 years agoCFG: Delay creating Dtors for CompoundStmts which end in ReturnStmt
Matthias Gehre [Sat, 14 Nov 2015 00:36:50 +0000 (00:36 +0000)]
CFG: Delay creating Dtors for CompoundStmts which end in ReturnStmt

Summary:
VisitReturnStmt would create a new block with including Dtors, so the Dtors created
in VisitCompoundStmts would be in an unreachable block.

Example:

struct S {
  ~S();
};

void f()
{
  S s;
  return;
}

void g()
{
  S s;
}

Before this patch, f has one additional unreachable block containing just the
destructor of S. With this patch, both f and g have the same blocks.

Reviewers: krememek

Subscribers: cfe-commits

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

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

8 years agoRevert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."
Justin Bogner [Fri, 13 Nov 2015 23:07:31 +0000 (23:07 +0000)]
Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."

This reverts r243310, which is redundant as of r253102.

Conflicts:
lib/Driver/Tools.cpp

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

8 years ago[CMake] Don't install c-index-test when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.
Argyrios Kyrtzidis [Fri, 13 Nov 2015 22:41:14 +0000 (22:41 +0000)]
[CMake] Don't install c-index-test when LLVM_INSTALL_TOOLCHAIN_ONLY=ON.

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

8 years agoFix build... again
Jonathan Roelofs [Fri, 13 Nov 2015 21:04:14 +0000 (21:04 +0000)]
Fix build... again

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

8 years ago[scan-build] Make scan-build work whether it's installed or not
Jonathan Roelofs [Fri, 13 Nov 2015 20:34:15 +0000 (20:34 +0000)]
[scan-build] Make scan-build work whether it's installed or not

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

8 years agoRelax mingw-useld test to fix bot failures.
Yaron Keren [Fri, 13 Nov 2015 20:02:08 +0000 (20:02 +0000)]
Relax mingw-useld test to fix bot failures.

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

8 years ago[scan-build] Move non user-facing utilities to share
Jonathan Roelofs [Fri, 13 Nov 2015 19:56:07 +0000 (19:56 +0000)]
[scan-build] Move non user-facing utilities to share

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

8 years agoAdd test case for mingw -fuse-ld= support introduced in r242121.
Yaron Keren [Fri, 13 Nov 2015 19:46:02 +0000 (19:46 +0000)]
Add test case for mingw -fuse-ld= support introduced in r242121.

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

8 years agoFix auto-link for text-based dynamic library SDKs.
Juergen Ributzka [Fri, 13 Nov 2015 19:08:07 +0000 (19:08 +0000)]
Fix auto-link for text-based dynamic library SDKs.

When linking against text-based dynamic library SDKs the library name of a
framework has now more than one possible filename extensions. This fix tests for
both possible extensions (none, and .tbd).

This fixes rdar://problem/20609975

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

8 years agoSlacken the norecurse test slightly
James Molloy [Fri, 13 Nov 2015 17:29:18 +0000 (17:29 +0000)]
Slacken the norecurse test slightly

It has been reported that this test currently fails on some Power buildbots due to them adding a "signext" function attribute.

As that's not what we're checking here, slacken off the test a bit.

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

8 years agoDeduplicate three identical copies of isExplicitInstantiationOrSpecialization, NFC.
Yaron Keren [Fri, 13 Nov 2015 15:39:39 +0000 (15:39 +0000)]
Deduplicate three identical copies of isExplicitInstantiationOrSpecialization, NFC.

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

8 years agoscan-build: Fix install.
NAKAMURA Takumi [Fri, 13 Nov 2015 06:48:02 +0000 (06:48 +0000)]
scan-build: Fix install.

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

8 years ago[Sema] __is_constructible should return false for function types
David Majnemer [Fri, 13 Nov 2015 05:32:43 +0000 (05:32 +0000)]
[Sema] __is_constructible should return false for function types

While functions types are complete, they cannot be constructed.

This fixes PR25513.

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

8 years ago[modules] When a declaration has non-trivial visibility, check whether it's
Richard Smith [Fri, 13 Nov 2015 05:14:45 +0000 (05:14 +0000)]
[modules] When a declaration has non-trivial visibility, check whether it's
actually hidden before we check its linkage. This avoids computing the linkage
"too early" for an anonymous struct with a typedef name for linkage.

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

8 years agoclang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.
NAKAMURA Takumi [Fri, 13 Nov 2015 04:44:51 +0000 (04:44 +0000)]
clang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.

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

8 years ago[modules] Follow the C++ standard's rule for linkage of enumerators: they have
Richard Smith [Fri, 13 Nov 2015 03:52:13 +0000 (03:52 +0000)]
[modules] Follow the C++ standard's rule for linkage of enumerators: they have
the linkage of the enumeration. For enumerators of unnamed enumerations, extend
the -Wmodules-ambiguous-internal-linkage extension to allow selecting an
arbitrary enumerator (but only if they all have the same value, otherwise it's
ambiguous).

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

8 years ago[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install desti...
Argyrios Kyrtzidis [Fri, 13 Nov 2015 01:46:18 +0000 (01:46 +0000)]
[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the install destination of c-index-test and the libclang headers.

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

8 years agoFix build
Jonathan Roelofs [Fri, 13 Nov 2015 01:23:40 +0000 (01:23 +0000)]
Fix build

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

8 years agoAdd support for function attribute 'disable_tail_calls'.
Akira Hatanaka [Fri, 13 Nov 2015 00:42:21 +0000 (00:42 +0000)]
Add support for function attribute 'disable_tail_calls'.

The ``disable_tail_calls`` attribute instructs the backend to not
perform tail call optimization inside the marked function.

For example,

int callee(int);

int foo(int a) __attribute__((disable_tail_calls)) {
  return callee(a); // This call is not tail-call optimized.
}

Note that this attribute is different from 'not_tail_called', which
prevents tail-call optimization to the marked function.

rdar://problem/8973573

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

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

8 years ago[scan-build] Create share directory similar to scan-view's
Jonathan Roelofs [Fri, 13 Nov 2015 00:32:54 +0000 (00:32 +0000)]
[scan-build] Create share directory similar to scan-view's

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

8 years ago[scan-view] Rename 'Resources' --> 'share'
Jonathan Roelofs [Fri, 13 Nov 2015 00:25:04 +0000 (00:25 +0000)]
[scan-view] Rename 'Resources' --> 'share'

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

8 years agoclang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for targeting...
NAKAMURA Takumi [Thu, 12 Nov 2015 23:56:37 +0000 (23:56 +0000)]
clang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for targeting win32.

I will remove REQUIRES later.

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

8 years agoRemove -Wobjc-weak-compat; there isn't a compelling use case for this.
John McCall [Thu, 12 Nov 2015 23:39:39 +0000 (23:39 +0000)]
Remove -Wobjc-weak-compat; there isn't a compelling use case for this.

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

8 years agoAvoid duplicated diagnostic when lookup for a nested-name-specifier fails due to...
Richard Smith [Thu, 12 Nov 2015 22:40:09 +0000 (22:40 +0000)]
Avoid duplicated diagnostic when lookup for a nested-name-specifier fails due to ambiguity.

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

8 years agoMark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.
NAKAMURA Takumi [Thu, 12 Nov 2015 22:25:38 +0000 (22:25 +0000)]
Mark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.

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

8 years ago[modules] Simplify and generalize the existing rule for finding hidden
Richard Smith [Thu, 12 Nov 2015 22:19:45 +0000 (22:19 +0000)]
[modules] Simplify and generalize the existing rule for finding hidden
declarations in redeclaration lookup. A declaration is now visible to
lookup if:

 * It is visible (not in a module, or in an imported module), or
 * We're doing redeclaration lookup and it's externally-visible, or
 * We're doing typo correction and looking for unimported decls.

We now support multiple modules having different internal-linkage or no-linkage
definitions of the same name for all entities, not just for functions,
variables, and some typedefs. As previously, if multiple such entities are
visible, any attempt to use them will result in an ambiguity error.

This patch fixes the linkage calculation for a number of entities where we
previously didn't need to get it right (using-declarations, namespace aliases,
and so on).  It also classifies enumerators as always having no linkage, which
is a slight deviation from the C++ standard's definition, but not an observable
change outside modules (this change is being discussed on the -core reflector
currently).

This also removes the prior special case for tag lookup, which made some cases
of this work, but also led to bizarre, bogus "must use 'struct' to refer to type
'Foo' in this scope" diagnostics in C++.

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

8 years agoDR407: Rationalize how we handle tags being hidden by typedefs. Even with
Richard Smith [Thu, 12 Nov 2015 22:04:34 +0000 (22:04 +0000)]
DR407: Rationalize how we handle tags being hidden by typedefs. Even with
DR407, the C++ standard doesn't really say how this should work. Here's what we
do (which is consistent with DR407 as far as I can tell):

 * When performing name lookup for an elaborated-type-specifier, a tag
   declaration hides a typedef declaration that names the same type.
 * When performing any other kind of lookup, a typedef declaration hides
   a tag declaration that names the same type.

In any other case where lookup finds both a typedef and a tag (that is, when
they name different types), the lookup will be ambiguous. If lookup finds a
tag and a typedef that name the same type, and finds anything else, the lookup
will always be ambiguous (even if the other entity would hide the tag, it does
not also hide the typedef).

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

8 years agoRevert r240335.
Richard Smith [Thu, 12 Nov 2015 21:55:58 +0000 (21:55 +0000)]
Revert r240335.

This failed to solve the problem it was aimed at, and introduced just as many
issues as it resolved. Realistically, we need to deal with the possibility that
multiple modules might define different internal linkage symbols with the same
name, and this isn't a problem unless two such symbols are simultaneously
visible.

The case where two modules define equivalent internal linkage symbols is
handled by r252063: if lookup finds multiple sufficiently-similar entities from
different modules, we just pick one of them as an extension (but we keep them
separate).

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

8 years agoAdditional tests from r252690 that I forgot to 'svn add'.
Richard Smith [Thu, 12 Nov 2015 21:42:39 +0000 (21:42 +0000)]
Additional tests from r252690 that I forgot to 'svn add'.

From a patch by Nicholas Allegra!

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

8 years agoCorrect atomic libcall support for __atomic_*_fetch builtins.
James Y Knight [Thu, 12 Nov 2015 18:37:29 +0000 (18:37 +0000)]
Correct atomic libcall support for __atomic_*_fetch builtins.

In r244063, I had caused these builtins to call the same-named library
functions, __atomic_*_fetch_SIZE. However, this was incorrect: while
those functions are in fact supported by GCC's libatomic, they're not
documented by the spec (and gcc doesn't ever call them).

Instead, you're /supposed/ to call the __atomic_fetch_* builtins and
then redo the operation inline to return the final value.

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

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

8 years agoAdd support for driver option -mno-ms-bitfields.
Akira Hatanaka [Thu, 12 Nov 2015 17:21:22 +0000 (17:21 +0000)]
Add support for driver option -mno-ms-bitfields.

This option is used to cancel -mms-bitfields on the command line.

rdar://problem/15898553

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

8 years agoCull non-standard variants of ARM architectures (NFC)
Artyom Skrobov [Thu, 12 Nov 2015 15:52:02 +0000 (15:52 +0000)]
Cull non-standard variants of ARM architectures (NFC)

Summary: Clang-side update, corresponding to D14577

Reviewers: rengolin

Subscribers: aemerson, cfe-commits, rengolin

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

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

8 years ago[C++] Add the "norecurse" attribute to main() if in C++ mode
James Molloy [Thu, 12 Nov 2015 15:36:04 +0000 (15:36 +0000)]
[C++] Add the "norecurse" attribute to main() if in C++ mode

The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit.

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

8 years agoRe-recommit: Add support for the new mips-mti-linux toolchain.
Vasileios Kalintiris [Thu, 12 Nov 2015 15:26:54 +0000 (15:26 +0000)]
Re-recommit: Add support for the new mips-mti-linux toolchain.

Last time, this caused two Windows buildbots and a single ARM buildbot to fail.
I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM
buildbot complains again.

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

8 years agoSilencing an MSVC warning about linkage specifications and C-incompatible UDTs by...
Aaron Ballman [Thu, 12 Nov 2015 15:25:06 +0000 (15:25 +0000)]
Silencing an MSVC warning about linkage specifications and C-incompatible UDTs by moving a function definition out of an extern "C" block.

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

8 years agoFix c-index-test install path
Ismail Donmez [Thu, 12 Nov 2015 13:47:35 +0000 (13:47 +0000)]
Fix c-index-test install path

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

8 years agoUpdate clang regression tests for 'norecurse'
James Molloy [Thu, 12 Nov 2015 10:56:51 +0000 (10:56 +0000)]
Update clang regression tests for 'norecurse'

FunctionAttrs has just been taught how to infer 'norecurse'. Update clang tests for LLVM r252871.

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

8 years agoUse %select to merge two diagnostics that only differ in one word and are emitted...
Craig Topper [Thu, 12 Nov 2015 07:36:50 +0000 (07:36 +0000)]
Use %select to merge two diagnostics that only differ in one word and are emitted in the same place. NFC

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

8 years ago[Sema] Remove unnecessary parens in check using logical or; NFC.
Nathan Wilson [Thu, 12 Nov 2015 04:25:03 +0000 (04:25 +0000)]
[Sema] Remove unnecessary parens in check using logical or; NFC.

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

8 years agolibclang: add clang_Cursor_getCXXManglings
Saleem Abdulrasool [Thu, 12 Nov 2015 03:57:22 +0000 (03:57 +0000)]
libclang: add clang_Cursor_getCXXManglings

This function permits the mangling of a C++ 'structor.  Depending on the ABI and
the declaration, the declaration may contain more than one associated symbol for
a given declaration.  This allows the consumer to retrieve all of the associated
symbols for the declaration the cursor points to.

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

8 years agolibclang: add new StringSet type
Saleem Abdulrasool [Thu, 12 Nov 2015 03:57:16 +0000 (03:57 +0000)]
libclang: add new StringSet type

This allows the return of a set of CXStrings from libclang.  This is setup work
for an upcoming change to permit returning multiple mangled symbols.

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

8 years ago[AttrDocs] Insert blank lines before and after code-block directives.
Akira Hatanaka [Thu, 12 Nov 2015 02:41:56 +0000 (02:41 +0000)]
[AttrDocs] Insert blank lines before and after code-block directives.

The code snippets were not being displayed. This commit fixes the bug.

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

8 years agoChange code owner for Clang Static Analyzer to Anna Zaks.
Ted Kremenek [Thu, 12 Nov 2015 01:31:27 +0000 (01:31 +0000)]
Change code owner for Clang Static Analyzer to Anna Zaks.

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

8 years agoRefactor out some common code from r252834
David Blaikie [Thu, 12 Nov 2015 01:09:58 +0000 (01:09 +0000)]
Refactor out some common code from r252834

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

8 years ago[CMake] Setup an install component for libclang and c-index-test.
Argyrios Kyrtzidis [Thu, 12 Nov 2015 00:46:57 +0000 (00:46 +0000)]
[CMake] Setup an install component for libclang and c-index-test.

Also don't create libclang dylib symlinks on darwin.

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

8 years agoProvide a frontend based error for always_inline functions that require
Eric Christopher [Thu, 12 Nov 2015 00:44:12 +0000 (00:44 +0000)]
Provide a frontend based error for always_inline functions that require
target features that the caller function doesn't provide. This matches
the existing backend failure to inline functions that don't have
matching target features - and diagnoses earlier in the case of
always_inline.

Fix up a few test cases that were, in fact, invalid if you tried
to generate code from the backend with the specified target features
and add a couple of tests to illustrate what's going on.

This should fix PR25246.

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

8 years agoMove checkTargetFeatures to CodeGenFunction.cpp to make it
Eric Christopher [Thu, 12 Nov 2015 00:44:07 +0000 (00:44 +0000)]
Move checkTargetFeatures to CodeGenFunction.cpp to make it
more obvious that it's generic.

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

8 years agoIn preparation to use it in more places rename
Eric Christopher [Thu, 12 Nov 2015 00:44:04 +0000 (00:44 +0000)]
In preparation to use it in more places rename
checkBuiltinTargetFeatures to checkTargetFeatures and sink
the error handling into the function.

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

8 years ago[Basic] Fix DRY violation, just call getLineTable() (NFC)
Vedant Kumar [Thu, 12 Nov 2015 00:11:19 +0000 (00:11 +0000)]
[Basic] Fix DRY violation, just call getLineTable() (NFC)

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

8 years agoAdd diagnostics which fall under [dcl.spec.concept]p5
Nathan Wilson [Wed, 11 Nov 2015 23:53:35 +0000 (23:53 +0000)]
Add diagnostics which fall under [dcl.spec.concept]p5

Summary: Diagnose when a function concept declaration has parameter(s)

Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast

Subscribers: cfe-commits

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

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

8 years ago[TLS on Darwin] treat all Darwin platforms in the same way.
Manman Ren [Wed, 11 Nov 2015 23:08:18 +0000 (23:08 +0000)]
[TLS on Darwin] treat all Darwin platforms in the same way.

rdar://problem/9001553

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

8 years agoExtract out a function onto CodeGenModule for getting the map of
Eric Christopher [Wed, 11 Nov 2015 23:05:08 +0000 (23:05 +0000)]
Extract out a function onto CodeGenModule for getting the map of
features for a particular function, then use it to clean up some
code.

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

8 years ago[TLS on Darwin] change how we handle globals with linkonce or weak linkage.
Manman Ren [Wed, 11 Nov 2015 22:42:31 +0000 (22:42 +0000)]
[TLS on Darwin] change how we handle globals with linkonce or weak linkage.

This is about how we handle static member of a template. Before this commit,
we use internal linkage for the IR thread-local variable, which is inefficient.
With this commit, we will start to follow Itanium C++ ABI.

rdar://problem/23415206

Reviewed by John McCall.

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

8 years ago[CMake] Fixing passthrough for variables starting with COMPILER_RT
Chris Bieneman [Wed, 11 Nov 2015 21:53:08 +0000 (21:53 +0000)]
[CMake] Fixing passthrough for variables starting with COMPILER_RT

This allows COMPILER_RT_* variables to be passed from the top-level CMake into the external project when LLVM_BUILD_EXTERNAL_COMPILER_RT=On.

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

8 years ago[analyzer] Fix scan-build to handle missing output directories.
Devin Coughlin [Wed, 11 Nov 2015 20:39:03 +0000 (20:39 +0000)]
[analyzer] Fix scan-build to handle missing output directories.

Cwd::abs_path has a somewhat tricky semantics: if it's operand directory does not exist,
it'll return undefined (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=257568).
This may cause scan-build to silently ignore output directory (specified with -o) and
use /tmp instead of trying to create directory. This tiny patch fixes the problem.

A patch by Yury Gribov!

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

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

8 years ago[SemaDeclCXX] Use isTemplateParamScope() rather than accessing raw bits.
Davide Italiano [Wed, 11 Nov 2015 20:06:35 +0000 (20:06 +0000)]
[SemaDeclCXX] Use isTemplateParamScope() rather than accessing raw bits.

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

8 years ago[Lit Test] Updated 26 Lit tests to be C++11 compatible.
Charles Li [Wed, 11 Nov 2015 19:34:47 +0000 (19:34 +0000)]
[Lit Test] Updated 26 Lit tests to be C++11 compatible.

Expected diagnostics have been expanded to vary by C++ dialect.
RUN line has also been expanded to: default, C++98/03 and C++11.

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

8 years ago[TLS] move setting tls_guard in tls_init.
Manman Ren [Wed, 11 Nov 2015 19:19:26 +0000 (19:19 +0000)]
[TLS] move setting tls_guard in tls_init.

We used to emit the store prior to branch in the entry block. To make it more
efficient, this commit moves it to the init block. We still mark as initialized
before initializing anything else.

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

8 years agoHiding the scan-build and scan-view projects under the Misc folder in IDEs instead...
Aaron Ballman [Wed, 11 Nov 2015 18:13:42 +0000 (18:13 +0000)]
Hiding the scan-build and scan-view projects under the Misc folder in IDEs instead of having them at the root view.

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

8 years agoSilencing a -Wreturn-type warning for control reaching the end of a non-void function.
Aaron Ballman [Wed, 11 Nov 2015 13:42:02 +0000 (13:42 +0000)]
Silencing a -Wreturn-type warning for control reaching the end of a non-void function.

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

8 years ago[ASan] Allow -fsanitize-recover=address.
Yury Gribov [Wed, 11 Nov 2015 10:45:48 +0000 (10:45 +0000)]
[ASan] Allow -fsanitize-recover=address.

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

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

8 years agoMake test/Driver/biarch.c use FileCheck instead of grep
Artyom Skrobov [Wed, 11 Nov 2015 10:45:44 +0000 (10:45 +0000)]
Make test/Driver/biarch.c use FileCheck instead of grep

Summary:
For clarity and ease of maintenance, I suggest porting this test
to use the same tooling as the rest of the tests.

Reviewers: joerg, rengolin, dougk, yaron.keren

Subscribers: cfe-commits

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

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

8 years ago[X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembl...
Craig Topper [Wed, 11 Nov 2015 08:13:33 +0000 (08:13 +0000)]
[X86] Add 'pause' builtin that's already in llvm and use it instead of inline assembly to implement _mm_pause.

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

8 years ago[X86] Use __builtin_ia32_paddq and __builtin_ia32_psubq to implement a couple intrins...
Craig Topper [Wed, 11 Nov 2015 08:00:41 +0000 (08:00 +0000)]
[X86] Use __builtin_ia32_paddq and __builtin_ia32_psubq to implement a couple intrinsics that were supposed to operate on MMX registers. Otherwise we end up operating on GPRs. Throw in a test for _mm_mul_su32 while I was there.

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

8 years ago[X86] Header formatting fixes. NFC
Craig Topper [Wed, 11 Nov 2015 08:00:39 +0000 (08:00 +0000)]
[X86] Header formatting fixes. NFC

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

8 years ago[X86] Add missing typecasts in intrinsic macros. This should make them more robust...
Craig Topper [Wed, 11 Nov 2015 03:47:10 +0000 (03:47 +0000)]
[X86] Add missing typecasts in intrinsic macros. This should make them more robust against inputs that aren't already the right type.

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

8 years ago[X86] Change pointer type in AVX2 gather builtins to be the scalar type instead of...
Craig Topper [Wed, 11 Nov 2015 02:51:18 +0000 (02:51 +0000)]
[X86] Change pointer type in AVX2 gather builtins to be the scalar type instead of the vector type. This matches gcc and removes extras casts.

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

8 years agoReorder the check strings in test case following r252692.
Akira Hatanaka [Wed, 11 Nov 2015 02:13:36 +0000 (02:13 +0000)]
Reorder the check strings in test case following r252692.

rdar://problem/19836465

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

8 years agoFix a FIXME about using std::is_sorted.
Eric Christopher [Wed, 11 Nov 2015 02:04:08 +0000 (02:04 +0000)]
Fix a FIXME about using std::is_sorted.

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

8 years agoAdd support for GCC's '__auto_type' extension, per the GCC manual:
Richard Smith [Wed, 11 Nov 2015 02:02:15 +0000 (02:02 +0000)]
Add support for GCC's '__auto_type' extension, per the GCC manual:
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html

Differences from the GCC extension:
 * __auto_type is also permitted in C++ (but only in places where
   it could appear in C), allowing its use in headers that might
   be shared across C and C++, or used from C++98
 * __auto_type can be combined with a declarator, as with C++ auto
   (for instance, "__auto_type *p")
 * multiple variables can be declared in a single __auto_type
   declaration, with the C++ semantics (the deduced type must be
   the same in each case)

This patch also adds a missing restriction on applying typeof to
a bit-field, which GCC has historically rejected in C (due to
lack of clarity as to whether the operand should be promoted).
The same restriction also applies to __auto_type in C (in both
GCC and Clang).

This also fixes PR25449.

Patch by Nicholas Allegra!

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

8 years agoN3922: direct-list-initialization of an auto-typed variable no longer deduces a
Richard Smith [Wed, 11 Nov 2015 01:36:17 +0000 (01:36 +0000)]
N3922: direct-list-initialization of an auto-typed variable no longer deduces a
std::initializer_list<T> type. Instead, the list must contain a single element
and the type is deduced from that.

In Clang 3.7, we warned by default on all the cases that would change meaning
due to this change. In Clang 3.8, we will support only the new rules -- per
the request in N3922, this change is applied as a Defect Report against earlier
versions of the C++ standard.

This change is not entirely trivial, because for lambda init-captures we
previously did not track the difference between direct-list-initialization and
copy-list-initialization. The difference was not previously observable, because
the two forms of initialization always did the same thing (the elements of the
initializer list were always copy-initialized regardless of the initialization
style used for the init-capture).

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

8 years ago[static analyzer] Don't flag nil storage into NSMutableDictionary.
Anna Zaks [Wed, 11 Nov 2015 00:49:22 +0000 (00:49 +0000)]
[static analyzer] Don't flag nil storage into NSMutableDictionary.

This is now allowed and has the behavior of removing the mapping.

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

8 years agoDefine __unsafe_unretained and __autoreleasing in ObjC GC mode.
John McCall [Tue, 10 Nov 2015 23:00:25 +0000 (23:00 +0000)]
Define __unsafe_unretained and __autoreleasing in ObjC GC mode.

This was an accidental regression from the MRC __weak patch.

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

8 years agoFix build
Jonathan Roelofs [Tue, 10 Nov 2015 22:59:18 +0000 (22:59 +0000)]
Fix build

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

8 years agoImplement post-commit review feedback on r252662
Jonathan Roelofs [Tue, 10 Nov 2015 22:48:11 +0000 (22:48 +0000)]
Implement post-commit review feedback on r252662

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

8 years agoImplement the fix that r252641 should have been
Jonathan Roelofs [Tue, 10 Nov 2015 22:38:59 +0000 (22:38 +0000)]
Implement the fix that r252641 should have been

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

8 years ago[COFF] Don't try to emit weak aliases on COFF
Reid Kleckner [Tue, 10 Nov 2015 22:23:58 +0000 (22:23 +0000)]
[COFF] Don't try to emit weak aliases on COFF

This comes up when a derived class destructor is equivalent to a base
class destructor defined in the same TU, and we try to alias them.

A COFF weak alias cannot satisfy a normal undefined symbol reference
from another TU. The other TU must also mark the referenced symbol as
weak, and we can't rely on that.

Clang already has a special case here for dllexport, but we failed to
realize that the problem also applies to other non-discardable symbols
such as those from explicit template instantiations.

Fixes PR25477.

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

8 years agoImplement __attribute__((internal_linkage)).
Evgeniy Stepanov [Tue, 10 Nov 2015 21:28:44 +0000 (21:28 +0000)]
Implement __attribute__((internal_linkage)).

The attrubite is applicable to functions and variables and changes
the linkage of the subject to internal.

This is the same functionality as C-style "static", but applicable to
class methods; and the same as anonymouns namespaces, but can apply
to individual methods of a class.

Following the proposal in
http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html

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

8 years ago[WebAssembly] Change long double to be quadruple-precision floating point.
Dan Gohman [Tue, 10 Nov 2015 21:01:46 +0000 (21:01 +0000)]
[WebAssembly] Change long double to be quadruple-precision floating point.

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

8 years agoFix missing CMake dependency introduced in r252474
Jonathan Roelofs [Tue, 10 Nov 2015 20:01:22 +0000 (20:01 +0000)]
Fix missing CMake dependency introduced in r252474

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

8 years agoAdd the variant of __sparc_v9__ with five underscores, not just four.
Joerg Sonnenberger [Tue, 10 Nov 2015 19:28:17 +0000 (19:28 +0000)]
Add the variant of __sparc_v9__ with five underscores, not just four.

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

8 years agoNo longer creating the install-clang target for IDEs, as it was never meant for those.
Aaron Ballman [Tue, 10 Nov 2015 12:51:25 +0000 (12:51 +0000)]
No longer creating the install-clang target for IDEs, as it was never meant for those.

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

8 years ago[Analyzer] Fix comments and formatting. NFC.
Sean Eveson [Tue, 10 Nov 2015 11:48:55 +0000 (11:48 +0000)]
[Analyzer] Fix comments and formatting. NFC.

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

8 years ago[X86] Use setzero instead of set1(0) in a few places in intrinsic headers.
Craig Topper [Tue, 10 Nov 2015 05:08:08 +0000 (05:08 +0000)]
[X86] Use setzero instead of set1(0) in a few places in intrinsic headers.

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

8 years ago[X86] Remove temporary variables from macros in x86 intrinsic headers. Prevents dupli...
Craig Topper [Tue, 10 Nov 2015 05:08:05 +0000 (05:08 +0000)]
[X86] Remove temporary variables from macros in x86 intrinsic headers. Prevents duplicate names appearing from multiple macro expansions. NFC

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

8 years ago[X86] Fix bad intrinsic header comment. NFC.
Craig Topper [Tue, 10 Nov 2015 05:08:00 +0000 (05:08 +0000)]
[X86] Fix bad intrinsic header comment. NFC.

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