]> granicus.if.org Git - clang/log
clang
8 years agoRevert "Make FP_CONTRACT ON the default."
Manuel Klimek [Tue, 17 Nov 2015 15:40:10 +0000 (15:40 +0000)]
Revert "Make FP_CONTRACT ON the default."

This reverts commit r253269.

This leads to assert / segfault triggering on the following reduced example:
float foo(float U, float base, float cell) { return (U = 2 * base) - cell; }

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

8 years ago[Sema] Remove unnecessary typecast of bool to int when passing arguments to diagnosti...
Craig Topper [Tue, 17 Nov 2015 05:40:12 +0000 (05:40 +0000)]
[Sema] Remove unnecessary typecast of bool to int when passing arguments to diagnostics. NFC

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

8 years ago[Sema] Combine similar diagnostics using %select. NFC
Craig Topper [Tue, 17 Nov 2015 05:40:09 +0000 (05:40 +0000)]
[Sema] Combine similar diagnostics using %select. NFC

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

8 years ago[Sema] Minor formatting fixes. NFC
Craig Topper [Tue, 17 Nov 2015 05:40:05 +0000 (05:40 +0000)]
[Sema] Minor formatting fixes. NFC

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

8 years ago[modules] Fix some more cases where we used to reject a conflict between two
Richard Smith [Tue, 17 Nov 2015 03:02:41 +0000 (03:02 +0000)]
[modules] Fix some more cases where we used to reject a conflict between two
declarations that are not simultaneously visible, and where at least one of
them has internal/no linkage.

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

8 years agoMake FP_CONTRACT ON the default.
Stephen Canon [Mon, 16 Nov 2015 23:09:11 +0000 (23:09 +0000)]
Make FP_CONTRACT ON the default.

Differential Revision: D14200

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

8 years agoDerive nacltools::Linker from GnuTool to get response file support
Derek Schuff [Mon, 16 Nov 2015 22:21:25 +0000 (22:21 +0000)]
Derive nacltools::Linker from GnuTool to get response file support

It could be derived from gnutools::Linker directly but this way makes it
consistent with all the other toolchains around it.

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

8 years agoCorrectly handle type mismatches in the __weak copy/move-initialization
John McCall [Mon, 16 Nov 2015 22:11:41 +0000 (22:11 +0000)]
Correctly handle type mismatches in the __weak copy/move-initialization
peephole I added in r250916.

rdar://23559789

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

8 years agoWhen producing error messages for always_inline functions with the
Eric Christopher [Mon, 16 Nov 2015 18:29:59 +0000 (18:29 +0000)]
When producing error messages for always_inline functions with the
target attribute, don't include "negative" subtarget features in the
list of required features. Builtins are positive by default so don't
need this change, but we pull the default list of features from the
command line and so need to make sure that we only include features
that are turned on for code generation in our error.

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

8 years ago[mips] Do not add arch name in the compiler-rt's components.
Vasileios Kalintiris [Mon, 16 Nov 2015 15:41:30 +0000 (15:41 +0000)]
[mips] Do not add arch name in the compiler-rt's components.

Instead, use the constant "mips" since the libraries are already
placed under the multilib's OS suffix.

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

8 years ago[Myriad]: pass the 'std=' option to moviCompile
Douglas Katzman [Mon, 16 Nov 2015 15:38:40 +0000 (15:38 +0000)]
[Myriad]: pass the 'std=' option to moviCompile

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

8 years ago[ARM,AArch64] Fix __rev16l and __rev16ll intrinsics
Oliver Stannard [Mon, 16 Nov 2015 14:58:50 +0000 (14:58 +0000)]
[ARM,AArch64] Fix __rev16l and __rev16ll intrinsics

These two intrinsics are defined in arm_acle.h.

__rev16l needs to rotate by 16 bits, bit it was actually rotating by 2 bits.
For AArch64, where long is 64 bits, this would still be wrong.

__rev16ll was incorrect, it reversed the bytes in each 32-bit word, rather than
each 16-bit halfword. The correct implementation is to apply __rev16 to the top
and bottom words of the 64-bit value.

For AArch32 targets, these get compiled down to the hardware rev16 instruction
at -O1 and above. For AArch64 targets, the 64-bit ones get compiled to two
32-bit rev16 instructions, because there is not currently a pattern for the
64-bit rev16 instruction.

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

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

8 years agoHandle ARMv6KZ naming
Artyom Skrobov [Mon, 16 Nov 2015 14:05:48 +0000 (14:05 +0000)]
Handle ARMv6KZ naming

Summary: Update for clang tests for D14568

Reviewers: rengolin, joerg, bogden

Subscribers: aemerson, rengolin, cfe-commits

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

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

8 years agoclang-format: Enable #include sorting by default.
Daniel Jasper [Mon, 16 Nov 2015 12:38:56 +0000 (12:38 +0000)]
clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command line flag can from now on be used to override whatever is set
in the style.

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

8 years ago[ARM] Pass in the architecture to TargetParser to cope with API change
Bradley Smith [Mon, 16 Nov 2015 11:16:36 +0000 (11:16 +0000)]
[ARM] Pass in the architecture to TargetParser to cope with API change

The TargetParser API to get the default FPU and default extensions has
changed so that it can fall back to the architecture in case of a
generic CPU.

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

8 years agoUpdate for the gnu flavor being renamed to old-gnu.
Rafael Espindola [Mon, 16 Nov 2015 09:12:12 +0000 (09:12 +0000)]
Update for the gnu flavor being renamed to old-gnu.

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

8 years ago[CGDebugInfo] Set the size and align for reference types
Keno Fischer [Mon, 16 Nov 2015 09:04:13 +0000 (09:04 +0000)]
[CGDebugInfo] Set the size and align for reference types

In r253186, I changed the DIBuilder API to now take size and align
for reference types as well. This was done in preparation for upcoming
changes to the Verifier that will validate that sizes match between
DI types and IR values that are declared as having those types.
This updates clang to actually pass the information through.

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

8 years ago[Sema] Implement several unary type traits more accurately
David Majnemer [Mon, 16 Nov 2015 06:58:51 +0000 (06:58 +0000)]
[Sema] Implement several unary type traits more accurately

is_empty, is_polymorphic, and is_abstract didn't handle incomplete types
correctly.  Only non-union class types must be complete for these
traits.

is_final and is_sealed don't care about the particular spelling of the
FinalAttr.

is_interface_class should always return false regardless of its input.
The type trait can only be satisfied in a mode we do not support (/CLR).

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

8 years ago[Basic] Replace vector<bool> with BitVector in SourceManager. NFC.
Vedant Kumar [Mon, 16 Nov 2015 04:39:22 +0000 (04:39 +0000)]
[Basic] Replace vector<bool> with BitVector in SourceManager. NFC.

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

8 years ago[Frontend] Rangify for loop. NFC.
Vedant Kumar [Mon, 16 Nov 2015 00:59:34 +0000 (00:59 +0000)]
[Frontend] Rangify for loop. NFC.

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

8 years ago[Basic] Use a bitfield in SLocEntry for clarity. NFC.
Vedant Kumar [Mon, 16 Nov 2015 00:11:58 +0000 (00:11 +0000)]
[Basic] Use a bitfield in SLocEntry for clarity. NFC.

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

8 years ago[analyzer] Handle calling ObjC super method from inside C++ lambda.
Devin Coughlin [Sun, 15 Nov 2015 17:48:22 +0000 (17:48 +0000)]
[analyzer] Handle calling ObjC super method from inside C++ lambda.

When calling a ObjC method on super from inside a C++ lambda, look at the
captures to find "self". This mirrors how the analyzer handles calling super in
an ObjC block and fixes an assertion failure.

rdar://problem/23550077

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

8 years ago[Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo on the...
Craig Topper [Sun, 15 Nov 2015 17:27:57 +0000 (17:27 +0000)]
[Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo on the AST context instead of Preprocessor. NFC

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

8 years ago[Sema] Fix filename in header. NFC
Craig Topper [Sun, 15 Nov 2015 17:27:55 +0000 (17:27 +0000)]
[Sema] Fix filename in header. NFC

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

8 years ago[Sema] Remove unnecessary includes and forward declarations. NFC
Craig Topper [Sun, 15 Nov 2015 17:27:52 +0000 (17:27 +0000)]
[Sema] Remove unnecessary includes and forward declarations. NFC

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

8 years ago[X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing cvt intrinsics
Simon Pilgrim [Sun, 15 Nov 2015 14:40:31 +0000 (14:40 +0000)]
[X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing cvt intrinsics

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

8 years ago[libclang] Visit TypeAliasTemplateDecl
Sergey Kalinichev [Sun, 15 Nov 2015 13:48:32 +0000 (13:48 +0000)]
[libclang] Visit TypeAliasTemplateDecl

This makes TypeAliasTemplateDecl accessible via LibClang and python bindings

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

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

8 years ago[libclang] Expose AutoType
Sergey Kalinichev [Sun, 15 Nov 2015 13:10:10 +0000 (13:10 +0000)]
[libclang] Expose AutoType

Expose the AutoType via LibClang and python bindings

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

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

8 years agoRemove some trailing whitespace
Sergey Kalinichev [Sun, 15 Nov 2015 12:37:01 +0000 (12:37 +0000)]
Remove some trailing whitespace

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

8 years agoMake the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Yaron Keren [Sun, 15 Nov 2015 08:06:27 +0000 (08:06 +0000)]
Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Post-commit suggestion by Filipe Cabecinhas.

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

8 years agoFix a layering oddity by passing Sema to DeclSpec::Finish instead of DiagnosticsEngin...
Craig Topper [Sun, 15 Nov 2015 03:32:11 +0000 (03:32 +0000)]
Fix a layering oddity by passing Sema to DeclSpec::Finish instead of DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema.

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

8 years ago[analyzer] Refer to capture field to determine if capture is reference.
Devin Coughlin [Sun, 15 Nov 2015 03:07:17 +0000 (03:07 +0000)]
[analyzer] Refer to capture field to determine if capture is reference.

The analyzer incorrectly treats captures as references if either the original
captured variable is a reference or the variable is captured by reference.
This causes the analyzer to crash when capturing a reference type by copy
(PR24914). Fix this by refering solely to the capture field to determine when a
DeclRefExpr for a lambda capture should be treated as a reference type.

https://llvm.org/bugs/show_bug.cgi?id=24914
rdar://problem/23524412

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

8 years ago[Sema] Don't crash trying to diagnose abs called on a pointer type
David Majnemer [Sun, 15 Nov 2015 03:04:34 +0000 (03:04 +0000)]
[Sema] Don't crash trying to diagnose abs called on a pointer type

Clang tries to figure out if a call to abs is suspicious by looking
through implicit casts to look at the underlying, implicitly converted
type.
Interestingly, C has implicit conversions from pointer-ish types like
function to less exciting types like int.  This trips up our 'abs'
checker because it doesn't know which variant of 'abs' is appropriate.

Instead, diagnose 'abs' called on function types upfront.  This sort of
thing is highly suspicious and is likely indicative of a missing
pointer dereference/function call/array index operation.

This fixes PR25532.

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

8 years agoUse Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC
Craig Topper [Sun, 15 Nov 2015 02:31:46 +0000 (02:31 +0000)]
Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC

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

8 years ago[WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.
Dan Gohman [Sat, 14 Nov 2015 22:57:34 +0000 (22:57 +0000)]
[WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.

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

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