Commit Graph

20558 Commits

Author SHA1 Message Date
Reid Kleckner a12cd28bb3 [ms-cxxabi] Fix linkage of dtor thunks for anonymous classes
We were mistakengly giving linkonce_odr linkage instead of internal
linkage to the deleting and complete destructor thunks for classes in
anonymous namespaces.

Fixes PR17273.

llvm-svn: 197060
2013-12-11 19:21:27 +00:00
Hans Wennborg 2545efe20c Better diagnostic for static override when methods are thiscall by default
Methods are thiscall by default in the MS ABI, and also in MinGW targetting GCC 4.7 or later.

This changes the diagnostic from the technically correct but hard to understand:

  virtual function 'foo' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((thiscall))')

to the more intuitive and also correct:

  'static' member function 'foo' overrides a virtual function

We already have a test for this. Let's just run it in both ABI modes.

Differential Revision: http://llvm-reviews.chandlerc.com/D2375

llvm-svn: 197055
2013-12-11 17:42:11 +00:00
Daniel Jasper f403efc3bd Add file missing from r197034.
llvm-svn: 197035
2013-12-11 12:33:22 +00:00
Daniel Jasper 4eaf0a6ca4 Modules: Let -fmodules-decluse ignore headers that aren't in a module
Includes might always pull in arbitrary header or data files outside of
modules. Among others, this includes builtin includes, which do not have
a module (story) yet.

Also cleanup implementation of ModuleMap::findModuleForHeader() to be
non-recursive.

llvm-svn: 197034
2013-12-11 12:13:00 +00:00
Renato Golin 1588cdaa4b Turning IAS on by default on ARM/Thumb
This is an experimental feature, where -integrated-as will be
on by default on ARM/Thumb. We aim to detect the missing features
so that the next release is stable.

Updating the ReleaseNotes, too.

Also moving the AArch64 into the same place.

llvm-svn: 197024
2013-12-11 09:35:10 +00:00
Daniel Jasper 7e468e0f68 Change layering warning tests to not actually build modules.
Specifically, we want to warn only for direct layering violations for
the modules we are calling clang on.

This temporarily unblocks
http://llvm-reviews.chandlerc.com/D2374

Once that is in, we'll also want to investigate whether to check the
layering in the build step of modules that we build transitively.

llvm-svn: 197021
2013-12-11 09:11:12 +00:00
Richard Smith 608da01cca When performing a delayed access check, use the surrounding lexical context for
any local extern declaration, not just a local extern function.

llvm-svn: 197000
2013-12-11 03:35:27 +00:00
Warren Hunt 1b5184321d [ms-abi] Makes Virtual Base Alignment Look at All Virtual Bases
Prior to this patch, the alignment imposed by virtual bases only 
included direct virtual bases.  This patch fixes it to look at all 
virtual bases.

llvm-svn: 196997
2013-12-11 02:21:03 +00:00
Richard Smith 1c96bc5d03 When performing an array new of a multidimensional array with an initializer
list, each element of the initializer list may provide more than one of the
base elements of the array. Be sure to initialize the right type and bump the
array pointer by the right amount.

llvm-svn: 196995
2013-12-11 01:40:16 +00:00
Fariborz Jahanian 54f87385c0 ObjectiveC. Fixes a bug where an 'unused property ivar'
warning is coming out incorrectly too early
becuase of unrelated scope pop. // rdar://15630719

llvm-svn: 196989
2013-12-11 00:53:48 +00:00
Fariborz Jahanian 88b6898085 ObjectiveC. Provide a property-dot syntax for fixit
when selector in objc_bridge_related attribute names
a property. // rdar://15517899

llvm-svn: 196984
2013-12-10 23:18:06 +00:00
David Fang 073a7c9139 darwin asm driver: suppress -Q for -no-integrated-as on darwin<11
llvm-svn: 196981
2013-12-10 22:51:25 +00:00
Fariborz Jahanian ddd28dc061 Objective-C. Minor change to a diagnostic.
// rdar://15499111

llvm-svn: 196977
2013-12-10 22:22:45 +00:00
Justin Bogner ab403f463a Parse: Avoid crashing on unterminated top-level asm strings
When parsing invalid top-level asm statements, we were ignoring the
return code of the SkipUntil we used for recovery. This led to crashes
when we hit the end of file and tried to continue parsing anyway.

This fixes the crash and adds a couple of tests for parsing related
problems.

llvm-svn: 196961
2013-12-10 21:29:48 +00:00
Ted Kremenek f41cf7f10f Rename attribute 'objc_suppress_protocol_methods' to 'objc_protocol_requires_explicit_implementation'.
That's a mouthful, and not necessarily the final name.  This also
reflects a semantic change where this attribute is now on the
protocol itself instead of a class.  This attribute will require
that a protocol, when adopted by a class, is explicitly implemented
by the class itself (instead of walking the super class chain).

Note that this attribute is not "done".  This should be considered
a WIP.

llvm-svn: 196955
2013-12-10 19:43:48 +00:00
Richard Smith 0b7f1187aa Add a triple to this IRgen test to unbreak the ARM bots.
llvm-svn: 196953
2013-12-10 19:37:58 +00:00
Fariborz Jahanian 7c04a55545 Improve on an objc_bridge_related diagnostic.
// rdar://15499111

llvm-svn: 196950
2013-12-10 19:22:41 +00:00
Argyrios Kyrtzidis 4f2ecc6177 [objcmt] Add a modernization option to infer and suggest designated initializers.
rdar://15509284

llvm-svn: 196943
2013-12-10 18:36:49 +00:00
Reid Kleckner 5dc20b13e7 Update clang MS inline asm tests for r196939
llvm-svn: 196940
2013-12-10 18:27:51 +00:00
Jordan Rose 60bd88d341 [analyzer] Extend IdenticalExprChecker to check ternary operator results.
Warn if both result expressions of a ternary operator (? :) are the same.
Because only one of them will be executed, this warning will fire even if
the expressions have side effects.

Patch by Anders Rönnholm and Per Viberg!

llvm-svn: 196937
2013-12-10 18:18:06 +00:00
Fariborz Jahanian db76577f43 Objective-C. Provide fixit's for objc_bride_related
attributed CF to ObjC type conversions.
// rdar://15499111

llvm-svn: 196935
2013-12-10 17:08:13 +00:00
Tim Northover 0d3caa7ff6 Darwin: update clang test to new iOS default version (5.0)
llvm-svn: 196913
2013-12-10 11:53:25 +00:00
Daniel Sanders c309be2f1f [mips][msa] Correct sld and sldi builtins.
Summary: The result register of these instructions is also the first operand.

Reviewers: jacksprat, dsanders

Reviewed By: dsanders

Differential Revision: http://llvm-reviews.chandlerc.com/D2362
Differential Revision: http://llvm-reviews.chandlerc.com/D2363

llvm-svn: 196910
2013-12-10 11:37:00 +00:00
Richard Smith ab44d5badf Implement DR1460: fix handling of default initializers in unions; don't allow
more than one such initializer in a union, make mem-initializers override
default initializers for other union members, handle anonymous unions with
anonymous struct members better. Fix a couple of semi-related bugs exposed by
the tests for same.

llvm-svn: 196892
2013-12-10 08:25:00 +00:00
Kevin Qin fb79d7f843 [AArch64 NEON] Support poly128_t and implement relevant intrinsic.
llvm-svn: 196888
2013-12-10 06:49:01 +00:00
Dmitri Gribenko d2589607e8 Try to fix the test for Windows paths after r196859
llvm-svn: 196862
2013-12-10 02:00:48 +00:00
Warren Hunt 1603e52700 [ms-abi] 64-bit fixes for r196549
In order to address latent bugs that were easier to expose in 64-bit 
mode, we move the application of __declspec(align) to before the layout 
of vbases rather than after.

llvm-svn: 196861
2013-12-10 01:44:39 +00:00
Rafael Espindola 66747221e8 Take into consideration calling convention when processing specializations.
This fixes pr18141.

llvm-svn: 196855
2013-12-10 00:59:31 +00:00
David Peixotto 1a74b6e118 Fix via-file-asm test failure on windows
The windows target does not support using an external assembler so
the test case was failing with this error:

error: there is no external assembler that can be used on this platform

The test was updated to always explicitly pass a target that has
both an interal and external assembler.

llvm-svn: 196854
2013-12-10 00:54:30 +00:00
David Majnemer cd053cd5ed Sema: Enforce C++11 pointer-to-member template arguments should rules
The standard is pretty clear on what it allows inside of template
arguments for non-type template parameters of pointer-to-member.

They must be of the form &qualified-id and cannot come from sources like
constexpr VarDecls or things of that nature.

This fixes PR18192.

llvm-svn: 196852
2013-12-10 00:40:58 +00:00
Fariborz Jahanian 67379e25c6 Objective-C: Improve on various diagnostics related to
use of objc_bridge_related attribute. // rdar://15499111

llvm-svn: 196828
2013-12-09 22:04:26 +00:00
NAKAMURA Takumi d0bf77dacd clang/test/lit.cfg: Remove get_llc_props. check-clang itself no longer invokes llc.
Only a few tests depend on llc yet.

llvm-svn: 196797
2013-12-09 19:04:14 +00:00
Rafael Espindola c3cde36ead Output destructors and constructors in a more natural order.
With this patch we output the in the order
C2
C1

D2
D1
D0

Which means that a destructor or constructor that call another is output after
the callee. This is a bit easier to read IHMO and a tiny bit more efficient
as we don't put a decl in DeferredDeclsToEmit.

llvm-svn: 196784
2013-12-09 14:51:17 +00:00
Alp Toker cfea74944a Make the -Wkeyword-compat diag message more accurate
Changed from:

  keyword '__is_empty' will be treated as an identifier for the remainder of the translation unit

To:

  keyword '__is_empty' will be made available as an identifier for the remainder of the translation unit

This is a more accurate description of clang's keyword compatibility feature,
given that some of the keywords are turned into context-sensitive keywords
(e.g. REVERTIBLE_TYPE_TRAIT) rather than being fully disabled.

llvm-svn: 196776
2013-12-09 12:41:02 +00:00
David Majnemer 2a81645de5 [-cxx-abi microsoft] Mangle large integral constants correctly
Testing has revealed that large integral constants (i.e. > INT64_MAX)
are always mangled as-if they are negative, even in places where it
would not make sense for them to be negative (like non-type template
parameters of type unsigned long long).

To address this, we change the way we model number mangling: always
mangle as-if our number is an int64_t.  This should result in correct
results when we have large unsigned numbers.

N.B.  Bizarrely, things that are 32-bit displacements like vbptr offsets
are mangled as-if they are unsigned 32-bit numbers.  This is a pretty
egregious waste of space, it would be a 4x savings if we could mangle it
like a signed 32-bit number.  Instead, we explicitly cast these
displacements to uint32_t and let the mangler proceed.

llvm-svn: 196771
2013-12-09 10:44:32 +00:00
Serge Pavlov 1de515100b Avoid extra error messages if method definition is inside function.
llvm-svn: 196757
2013-12-09 05:25:47 +00:00
David Majnemer 048f90cc04 [-cxx-abi microsoft] Properly mangle enums
While testing our ability to mangle large constants (PR18175), I
incidentally discovered that we did not properly mangle enums correctly.

Previously, we would append the width of the enum in bytes after the
type-tag differentiator.

This would mean "enum : short" would be mangled as 'W2' while "enum :
char" would be mangled as 'W1'.  Upon testing this with several versions
of MSVC, I found that this did not match their behavior: they always use
'W4'.

N.B.  Quick testing uncovered that undname allows different numbers to
follow the 'W' in the following way:

'W0' -> "enum char"
'W1' -> "enum unsigned char"
'W2' -> "enum short"
'W3' -> "enum unsigned short"
'W4' -> "enum"
'W5' -> "enum unsigned int"
'W6' -> "enum long"
'W7' -> "enum unsigned long"

However this scheme appears abandoned, I cannot get MSVC to trigger it.
Furthermore, it's incomplete: it doesn't handle "bool" or "long long".

llvm-svn: 196752
2013-12-09 04:28:34 +00:00
Hao Liu 844a7da243 [AArch64]Add missing pair intrinsics such as:
int32_t vminv_s32(int32x2_t a) 
which should be compiled into SMINP Vd.2S,Vn.2S,Vm.2S

llvm-svn: 196750
2013-12-09 03:52:22 +00:00
Alp Toker 7c265cf46a Remove an old stdio.h include from the invalid-array test
This should get it up and running on win and other builders without system
headers.

llvm-svn: 196738
2013-12-08 22:37:30 +00:00
Alp Toker 3cde27785b Fix three tests that weren't checking anything
Add -verify and update the test directives to match current expectations.

Also add a FIXME to an ObjC test that has expected-* directives but no -verify.

llvm-svn: 196737
2013-12-08 22:22:31 +00:00
Alp Toker 2e41264869 Re-enable verification of test and update outdated diag checks
Going by PR6913 it looks like this one can no longer reach CodeGen so remove
the redundant -emit-llvm case and treat it as an ordinary Sema test.

llvm-svn: 196736
2013-12-08 22:22:26 +00:00
Alp Toker 75e225318f Re-enable ms inline asm parser test.
LLVM r196044 should make it pass.

llvm-svn: 196734
2013-12-08 21:12:27 +00:00
Alp Toker 5a60686cf9 Remove all DISABLE lines from tests
There's no evidence that a 'DISABLE' directive ever existed.

Let's see if anything breaks..

llvm-svn: 196733
2013-12-08 21:12:19 +00:00
Alp Toker ffe34a805d There's no such thing as %clang_cc1_only
These were being substituted into approximately the following:

  clang -cc1 -internal-isystem ../lib/clang/3.5/include_only

llvm-svn: 196730
2013-12-08 18:49:11 +00:00
Alp Toker a644314b68 Fix a test that hasn't worked since 2007
Due to a missing -verify, 2007-10-01-BuildArrayRef.c was a no-op.

The message was changed 5 years ago so also update the test to reflect the new wording.

llvm-svn: 196729
2013-12-08 18:49:05 +00:00
Alp Toker 544bd43624 Remove duplicated -cc1 in tests
llvm-svn: 196728
2013-12-08 18:06:52 +00:00
Tim Northover 8f24b178f3 ARM: teach Sema that "r" can match 64-bit values
We already support using "r" on 64-bit values (a GPRPair is
allocated), but Sema doesn't know this yet so issues a warning. This
should fix it.

llvm-svn: 196724
2013-12-08 15:24:55 +00:00
Faisal Vali c9c5d1604f Move a generic lambda test into the more logical test file.
llvm-svn: 196723
2013-12-08 15:11:48 +00:00
Faisal Vali 5ab61b09be Fix an assertion introduced by my previous refactoring.
Add back the test that was triggering the assertion (which I removed mistakenly thinking it was triggering just a warning and not an assertion).  My error was brought to my attention by Rafael (Thanks!).

llvm-svn: 196721
2013-12-08 15:00:29 +00:00
Rafael Espindola 7ab1ce04bb Fix pr18174.
Clang outputs LLVM one top level decl at a time. This combined with the
visibility computation code looking for the newest NamespaceDecl would cause
it to produce different results for nested namespaces.

The two options for producing consistent results are
* Delay codegen of anything inside a namespace until the end of the file.
* Don't look for the newest NamespaceDecl.

This patch implements the second option.
This matches the gcc behavior too.

llvm-svn: 196712
2013-12-08 01:13:22 +00:00