Commit Graph

20757 Commits

Author SHA1 Message Date
Hans Wennborg 9b395ef284 Don't require -re suffix on -verify directives with regexes.
Differential Revision: http://llvm-reviews.chandlerc.com/D2392

llvm-svn: 197295
2013-12-14 00:46:53 +00:00
Faisal Vali 57ae056a5c Quick-Fix pointer arithmetic when performing multi-D new-array initialization.
clang still doesn't emit the right llvm code when initializing multi-D arrays it seems.

For e.g. the following code would still crash for me on Windows 7, 64 bit:

auto f4 = new int[100][200][300]{{{1,2,3}, {4, 5, 6}}, {{10, 20, 30}}};

It seems that the final new loop that iterates through each outermost array and memsets it to zero gets confused with its final ptr arithmetic.

This patch ensures that it converts the pointer to the allocated type (int [200][300]) before incrementing it (instead of using the base type: 'int').

Richard somewhat squeamishly approved the patch (as a quick fix to potentially make it into 3.4) - while exhorting for a more optimized fix in the future. http://llvm-reviews.chandlerc.com/D2398
 
Thanks Richard!

llvm-svn: 197294
2013-12-14 00:40:05 +00:00
Hans Wennborg 442e4f7f5f Prepare for using MS ABI by default for Win32: update CodeGenCXX tests
llvm-svn: 197281
2013-12-13 22:43:52 +00:00
Richard Smith 6cda8ee96f Add a testcase and a FIXME for an accepts-invalid.
llvm-svn: 197280
2013-12-13 22:28:48 +00:00
Richard Smith 3c9198fce3 Detabify and fix formatting.
llvm-svn: 197279
2013-12-13 22:26:20 +00:00
Rafael Espindola a8df53f4ad Consolidate DataLayout string testing in one file.
llvm-svn: 197276
2013-12-13 21:49:53 +00:00
Alp Toker cbb9034e2a Eliminate BinaryTypeTraitExpr
There's nothing special about type traits accepting two arguments.

This commit eliminates BinaryTypeTraitExpr and switches all related handling
over to TypeTraitExpr.

Also fixes a CodeGen failure with variadic type traits appearing in a
non-constant expression.

The BTT/TT prefix and evaluation code is retained as-is for now but will soon
be further cleaned up.

This is part of the ongoing work to unify type traits.

llvm-svn: 197273
2013-12-13 20:49:58 +00:00
Rafael Espindola 46ea763e7c Convert test to FileCheck.
llvm-svn: 197269
2013-12-13 20:11:02 +00:00
Rafael Espindola 4c50d46e0c Convert test to FileCheck
llvm-svn: 197267
2013-12-13 19:44:40 +00:00
Fariborz Jahanian 07e7e6cbc8 Objective-C. Remove obsolete option from test.
// rdar://15641300

llvm-svn: 197263
2013-12-13 19:06:55 +00:00
Rafael Espindola f62bcc0d9c Use a: and s: instead of a0: and s0: in the DataLayout strings.
They are equivalent and the size of 'a' and 's' is unused.

llvm-svn: 197256
2013-12-13 18:40:15 +00:00
Hans Wennborg 86be54cc80 Tighten test regexes checking for __attribute__((thiscall)) on function types.
The tests were perhaps made too relaxed in r197164 when we switched to the new
MinGW ABI. This makes sure we check explicitly for an optional thiscall
attribute and nothing else.

We should still look into whether we should print these attributes at all in
these cases.

llvm-svn: 197252
2013-12-13 18:34:23 +00:00
Fariborz Jahanian 059021a369 Objective-C. Do not issue warning when 'readonly'
property declaration has a memory management
attribute (retain, copy, etc.). Sich properties
are usually overridden to become 'readwrite'
via a class extension (which require the memory
management attribute specified). In the absence of class
extension override, memory management attribute is
needed to produce correct Code Gen. for the
property getter in any case and this warning becomes
confusing to user. // rdar://15641300

llvm-svn: 197251
2013-12-13 18:19:59 +00:00
Rafael Espindola 14c57ebed5 Convert test to FileCheck and make it more strict.
llvm-svn: 197248
2013-12-13 17:47:34 +00:00
Alp Toker 08c2500f9c Fix raw lex crash and -frewrite-includes noeol-at-eof failure
Raw lexers don't have a preprocessor so we need to null check.

llvm-svn: 197245
2013-12-13 17:04:55 +00:00
Joey Gouly 2cd9db1cef [OpenCL] Produce an error when the work group and vec type hint attributes
are used on non-kernel functions.

Reviewed by Aaron over IRC!

llvm-svn: 197243
2013-12-13 16:15:28 +00:00
Rafael Espindola 984c9d86cb Add a clang side test for pr18235 too.
llvm-svn: 197242
2013-12-13 16:11:31 +00:00
Tim Northover a5877505d7 ARM MachO embedded: fix test without FileCheck line
Well, that's one way to pass a test, I suppose. Unfortunately actually doing
the testing means I didn't pass all I thought (embedded v7a is not supported,
apparently). I'll deal with that with the move to -none-macho rather than
putting heinous hacks in right now.

llvm-svn: 197240
2013-12-13 16:05:12 +00:00
Artyom Skrobov 3a4fe36916 clang-check to ignore -no-integrated-as because certain drivers can't handle it
llvm-svn: 197229
2013-12-13 13:43:48 +00:00
Manuel Klimek 6b5460c75a Move the input files for the unnecessary-module-map-parsing test to Inputs.
Needed to change rename.m to set the right include path so we don't
import a broken module due to recursive module checking.

llvm-svn: 197222
2013-12-13 10:08:24 +00:00
Ted Kremenek 33e430fc58 Refine 'objc_protocol_requires_explicit_implementation' attribute to better handle indirect protocols.
llvm-svn: 197209
2013-12-13 06:26:14 +00:00
Ted Kremenek 2ccf19e1ab Change 'method X in protocol not implemented' warning to include the name of the protocol.
This removes an extra "note:", which wasn't really all that more useful
and overall reduces the diagnostic spew for this case.

llvm-svn: 197207
2013-12-13 05:58:51 +00:00
Argyrios Kyrtzidis d664a34de8 [objc] If we don't know for sure what the designated initializers of the superclass are,
assume that a [super init..] inside a designated initializer also refers to a designated one
and do not warn.

llvm-svn: 197202
2013-12-13 03:48:17 +00:00
David Majnemer 210e6bfa19 Revert "[-cxx-abi microsoft] Mangle reference temporaries"
This reverts commit r197184.

Richard Smith brings up some good points, a proper implementation will
require us to mangle unnameable entities compatibly with MSVC.

llvm-svn: 197192
2013-12-13 00:39:38 +00:00
Ted Kremenek 6d69ac8b8a Enhance "auto synthesis will not synthesize property in protocol" to include property and protocol name.
Implements <rdar://problem/15617839>.

llvm-svn: 197187
2013-12-12 23:40:14 +00:00
David Majnemer 0834f13c95 [-cxx-abi microsoft] Mangle reference temporaries
They are mangled the same as normal references, nothing special is going
on here.

llvm-svn: 197184
2013-12-12 23:12:01 +00:00
Warren Hunt 4431fe6bec [ms-abi] Refactoring Non-virtual base layout in record layout
This refactor addresses bugzilla bug 18167 and simplifies the code at 
the same time.  Also I add a test case for the bug.  Also I make a 
non-functional change to the basic layout lit tests to make them more 
reliable (using CHECK-NEXT instead of CHECK).

llvm-svn: 197183
2013-12-12 22:33:37 +00:00
Rafael Espindola 7abb2f9ea6 Make this test pass on Release builds.
On Assert builds the "call" was matching the variable name in
%call = call ...

llvm-svn: 197167
2013-12-12 16:15:25 +00:00
Argyrios Kyrtzidis 9955dbca2f [Modules] Don't parse any module map if modules are disabled.
Fixes rdar://15644663.

llvm-svn: 197165
2013-12-12 16:08:33 +00:00
Rafael Espindola 3497069784 Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.

llvm-svn: 197164
2013-12-12 16:07:11 +00:00
Bernard Ogden 3156176c8c Refactor duplicate functions
getARMCPU and getLLVMArchSuffixForARM existed as very similar functions
in both ToolChain.cpp and Tools.cpp. Create a single implementation of
each in Tools.cpp, eliminate the duplicate and share via Tools.h.

Creates an 'arm' namespace in Tools.h to be used by any ARM-targetting tools.

llvm-svn: 197153
2013-12-12 13:27:11 +00:00
Bernard Ogden 8af41b5a21 Make thumb the default instruction set for v7m and v7em
llvm-svn: 197152
2013-12-12 13:27:04 +00:00
Bernard Ogden 178d0dc95b Fix -mthumb resetting of target cpu
Passing -mthumb with no explicit CPU on the command line
resulted in target CPU changing from the architecture
default to arm7tdmi. Now it does not.

llvm-svn: 197151
2013-12-12 13:26:59 +00:00
Alp Toker 15ab37321c Suppress -Wshadow / -Wold-style-cast expanded from system header macros
Thanks to Jonathan Sauer for providing initial test cases.

Fixes PR16093 and PR18147.

llvm-svn: 197150
2013-12-12 12:47:48 +00:00
Tim Northover 9c7e035656 Darwin-embedded: find correct libclang_rt for embedded targets.
This refactors some of the Darwin toolchain classification to give a more solid
distinction between the three primary Darwin platforms (OS X, IOS and IOS
simulator) so that a 4th choice can be added temporarily: embedded MachO
targets.

Longer term, this support will be factored out into a separate class and no
longer classified as "darwin-eabi", but the refactoring should still be useful.

llvm-svn: 197148
2013-12-12 11:55:52 +00:00
Timur Iskhodzhanov fae1eda671 Add a test case for the PR17748 crash
llvm-svn: 197143
2013-12-12 11:07:03 +00:00
Ted Kremenek c152c528b0 Add more test cases for 'objc_protocol_requires_explicit_implementation'.
llvm-svn: 197128
2013-12-12 06:20:42 +00:00
Richard Smith db05cd37a1 PR17602: check accessibility when performing an implicit derived-to-base
conversion on the LHS of a .* or ->*. Slightly improve diagnostics in case
of an ambiguous base class.

llvm-svn: 197125
2013-12-12 03:40:18 +00:00
Hans Wennborg bf6dda5116 Re-apply r197076 and r197086; the build was fixed by chapuni in r197114.
llvm-svn: 197116
2013-12-12 02:24:20 +00:00
Kevin Qin daaae418d8 Fix Incorrect CHECK message [0-31]+ in test case.
In regular expression, [0-31]+ equals to [0-3]+, not the number from
0 to 31. So change it to [0-9]+.

llvm-svn: 197112
2013-12-12 02:17:35 +00:00
Hans Wennborg 69a458f690 Revert r197076: "[objcmt] When emitting a remap file, use a json format
with the edit entries, instead of applying the changes"

(And also revert the follow-up r197086.)

This seems to have broken Linux builds, which were failing with the following:

/build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so:
error: undefined reference to
'clang::ento::objc_retain::CallEffects::getEffect(clang::ObjCMethodDecl const*)'
/build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so:
error: undefined reference to
'clang::ento::objc_retain::CallEffects::getEffect(clang::FunctionDecl const*)'
collect2: error: ld returned 1 exit status

llvm-svn: 197111
2013-12-12 02:12:17 +00:00
Aaron Ballman 75a1729c4b Added a Subjects clause to the section attribute and made its diagnostics more consistent with other attributes.
llvm-svn: 197104
2013-12-12 01:34:39 +00:00
Richard Smith c934e4fd2c PR18217: Rewrite JumpDiagnostics' handling of temporaries, to correctly handle
declarations that might lifetime-extend multiple temporaries. In passing, fix a
crasher (PR18217) if an initializer was dependent and exactly the wrong shape,
and remove a bogus function (Expr::findMaterializedTemporary) now its last use
is gone.

llvm-svn: 197103
2013-12-12 01:27:02 +00:00
Fariborz Jahanian 49e69ee557 Objective-C migrator: when inferring 'readonly' property of an
Objective-C object conforming to 'NSCopying' protocol, infer
a 'copy' property, instead of 'strong'. // rdar://15525937

llvm-svn: 197102
2013-12-12 01:02:00 +00:00
Ted Kremenek 5d0fb1ea1c Add CFG tests for switch's involving "extended" enum.
llvm-svn: 197094
2013-12-11 23:44:05 +00:00
Hans Wennborg cda4b6dd00 Change semantics of regex expectations in the diagnostic verifier
Previously, a line like

  // expected-error-re {{foo}}

treats the entirety of foo as a regex. This is inconvenient when matching type
names containing regex characters. For example, to match
"void *(class test8::A::*)(void)" inside such a regex, one would have to type
"void \*\(class test8::A::\*\)\(void\)".

This patch changes the semantics of expected-error-re to only treat the parts
of the directive wrapped in double curly braces as regexes. This avoids the
escaping problem and leads to nicer patterns for those cases; see e.g. the
change to test/Sema/format-strings-scanf.c.

(The balanced search for closing }} of a directive also makes us handle the
full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.)

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

llvm-svn: 197092
2013-12-11 23:40:50 +00:00
Aaron Ballman c698809955 No longer accepting attribute spellings with prefix and suffix underscores except for GNU attributes, or C++11-style attributes in the GNU namespace. This prevents attributes such as __declspec(__dllexport__) or [[__noreturn__]] from being treated as known attributes.
llvm-svn: 197082
2013-12-11 22:27:44 +00:00
Argyrios Kyrtzidis 712e18a0c1 [objcmt] When emitting a remap file, use a json format with the edit entries, instead of applying the changes
to a temp file directly.

This allows to combine the edits when they can be different based on whether you saw
the implementation or not, e.g. with the designated initializer migration.

llvm-svn: 197076
2013-12-11 21:39:06 +00:00
Argyrios Kyrtzidis 3f72934bba [objcmt] When whitelisting the headers we want to modify, allow changing the
the ObjC implementation declarations, just don't change implementations for
classes that are not in the whitelisted headers.

For example, if we change a method to return 'instancetype' we should also
update the method definition in the implementation.

llvm-svn: 197075
2013-12-11 21:39:00 +00:00
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
Faisal Vali 0a2de2f052 Delete the now unnecessary test/generic-lambda-unimplemented-1y.cpp
llvm-svn: 196664
2013-12-07 20:57:51 +00:00
Benjamin Kramer 065c61b646 CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg.
This can happen when we're trying to emit a thunk with available_externally
linkage with optimization enabled but bail because it doesn't make sense
for vararg functions.

PR18098.

llvm-svn: 196658
2013-12-07 16:12:52 +00:00
Argyrios Kyrtzidis e818681c88 Add a SubsetSubject in Attr.td to automate checking of where the objc_designated_initializer
attribute is acceptable.

llvm-svn: 196644
2013-12-07 06:08:04 +00:00
Richard Smith a98f8fc8d8 Give a more appropriate diagnostic when a template specialization or
instantiation appears in a non-enclosing namespace (the previous diagnostic
talked about the C++98 rule even in C++11 mode).

llvm-svn: 196642
2013-12-07 05:09:50 +00:00
Joerg Sonnenberger ee3b2da880 Pass correct flags to assembler and linker for OpenBSD on AMD64, PowerPC
and MIPS64. From Brad Smith.

llvm-svn: 196630
2013-12-07 00:57:46 +00:00
Fariborz Jahanian 1f0b3bfd75 ObjectiveC. Continuing implementation of objc_bridge_related
attribute in sema and issuing a variety of diagnostics lazily 
for misuse of this attribute (and what to do) when converting 
from CF types to ObjectiveC types (and vice versa).
// rdar://15499111

llvm-svn: 196629
2013-12-07 00:34:23 +00:00
Justin Bogner 9ca8df1e3f test/Driver: Check that @ arguments that aren't files are handled
This tests the bug fix in llvm r196620.

llvm-svn: 196621
2013-12-06 22:57:13 +00:00
Ana Pazos dd6068d400 Added support for mcpu krait
- krait processor currently modeled with the same features as A9.
- Krait processor additionally has VFP4 (fused multiply add/sub)
and hardware division features enabled.
- krait has currently the same Schedule model as A9
- krait cpu flag is not recognized by the GNU assembler yet,
it is replaced with march=armv7-a to avoid a lower march
from being used.

llvm-svn: 196618
2013-12-06 22:43:17 +00:00
David Peixotto fc004bdd49 Fix test case inefficiency
Was accidently passing the file to clang twice. No functionaly change.

llvm-svn: 196608
2013-12-06 20:42:24 +00:00
David Peixotto 3e325d7490 Add option to use temporary file for assembling with clang
This commit adds the flag '-via-file-asm' to the clang driver. The
purpose of this flag is to have a way to test that clang can consume
the assembly code that it outputs. When passed this flag, clang will
generate a temporary file that contains the assembly output from the
compile step. This assembly file will then be consumed by either the
integrated assembler or the external assembler. To test that the
integrated assembler can consume its own output compile with:

  $ clang -integrated-assembler -via-file-asm

Without the '-via-file-asm' flag, clang would directly create the
object file when using the integrated assembler. With the flag it
will first create the temporary assembly file and then read that
file and assemble it with the integrated assembler.

The flow is similar to -save-temps, except that it only effects
the assembly input and the temporary file is not saved.

llvm-svn: 196606
2013-12-06 20:27:33 +00:00
Warren Hunt 71140d68f8 [MS-ABI] adds padding before all vbases after a bitfield
MS-ABI adds padding before *every* vbase if the last field in a record 
is a bit-field. This changes clangs behavior to match. I also fix some 
windows-style line endings in the test file.

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

llvm-svn: 196605
2013-12-06 20:16:49 +00:00
Warren Hunt 049f673dae [MS-ABI] Fix alias-avoidance padding between bases
Adds padding between bases or virtual bases in an attempt to avoid 
aliasing of zero-sized sub-objects.  The approach used by the ABI adds 
two more bits of state.  Detailed comments are in the code.  Test cases 
included.

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

llvm-svn: 196602
2013-12-06 19:54:25 +00:00
Anna Zaks f5308fac1e Fixup to r196593.
This is another regression fixed by reverting r189090.

In this case, the problem is not live variables but the approach that was taken in r189090. This regression was caused by explicitly binding "true" to the condition when we take the true branch. Normally that's okay, but in this case we're planning to reuse that condition as the value of the expression.

llvm-svn: 196599
2013-12-06 19:28:16 +00:00
Anna Zaks cf8d2165ff Revert "[analyzer] Refactor conditional expression evaluating code"
This reverts commit r189090.

The original patch introduced regressions (see the added live-variables.* tests). The patch depends on the correctness of live variable analyses, which are not computed correctly. I've opened PR18159 to track the proper resolution to this problem.

The patch was a stepping block to r189746. This is why part of the patch reverts temporary destructor tests that started crashing. The temporary destructors feature is disabled by default.

llvm-svn: 196593
2013-12-06 18:56:29 +00:00
Diego Novillo 67fe87fc5e Add flag -fauto-profile as alias to -fprofile-sample-use.
Summary:
GCC uses -fauto-profile to enable sample-based PGO. This patch
adds it to Clang as an alias for -fprofile-sample-use.

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

llvm-svn: 196589
2013-12-06 17:58:19 +00:00
Daniel Jasper 3cd34c7637 Allow string literals as module names.
In order to make the migration to modules easier, it seems to be helpful
to allow a 1:1 mapping between target names of a current build system
and the corresponding C++ modules. As  such targets commonly contain
characters like "-". ":" and "/", allowing arbitrary quote-escaped
strings seems to be a straightforward option.

After several offline discussions, the precise mechanisms for C++
module names especially regarding submodules and import statements has
yet to be determined. Thus, this patch only enables string literals as
names inside the module map files which can be used by automatic module
import (through #include).

Also improve the error message on missing use-declarations.

llvm-svn: 196573
2013-12-06 09:25:54 +00:00
Richard Smith c275da6a14 PR18152: When computing the semantic form for an initializer list, keep track
of whether the initializer list is dependent.

llvm-svn: 196558
2013-12-06 01:27:24 +00:00
Warren Hunt 7b252d24ad Support MS-ABI's concept of "Required Alignment" imposed by
__declspec(align())

This patch implements required alignment in a way that makes 
__declspec(align()) and #pragma pack play correctly together. In the 
MS-ABI, __declspec(align()) is a hard rule and cannot be overridden by 
#pragma pack. This cases each record to have two interesting alignments 
"preferred alignment" (which matches Itanium's concept of alignment) and 
"required alignment" which is an alignment that must never be violated, 
even in the case of #pragma pack. This patch introduces the concept of 
Required Alignment to the record builder and tracks/uses it 
appropriately. Test cases are included.

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

llvm-svn: 196549
2013-12-06 00:01:17 +00:00
Dmitri Gribenko e6ac50ad71 -Wassign-enum: compare unqualified types
This commit changes -Wassign-enum to compare unqualified types.  One could
think that this does not matter much, because who wants a value of enum type
that is const-qualified?  But this breaks the intended pattern to silence this
warning with an explicit cast:

    static const enum Foo z = (enum Foo) 42;

In this case, source type is 'enum Foo', and destination type is 'const enum
Foo', and if we compare qualified types, they don't match, so we used warn.

llvm-svn: 196548
2013-12-05 23:06:53 +00:00
Dmitri Gribenko 58683755ed Allow the warning 'case value not in enumerated type' to be silenced with
the following pattern.

If 'case' expression refers to a static const variable of the correct enum
type, then we count this as a sufficient declaration of intent by the user,
so we silence the warning.

llvm-svn: 196546
2013-12-05 22:52:07 +00:00
Reid Kleckner ae9451218f [ms-cxxabi] bitcast to i8* to deref a data member pointer
This was causing us to miscompile
llvm::SymbolTableListTraits::getListOwner(), which uses data member
pointers.

llvm-svn: 196545
2013-12-05 22:44:07 +00:00
Ana Pazos 6a8b8b5f0d Implemented vget/vset_lane_f16 intrinsics
llvm-svn: 196535
2013-12-05 21:13:24 +00:00
Fariborz Jahanian f3077a29ce ObjectiveC: Don't warn when method implemented in
category is declared in category's primary
class's super class. Because the super class is
expected to implemented the method. // rdar://15580969

llvm-svn: 196531
2013-12-05 20:52:31 +00:00
Argyrios Kyrtzidis 5899e8916b [c-index-test] For the '-remap-file' option use a comma for separator which is more
Windows friendly than the colon.

llvm-svn: 196529
2013-12-05 20:13:27 +00:00
Bob Wilson 83e723a9c9 Fix assertion failure left over from changes to move away from "darwin" triples.
I happened to notice this while trying to write a test for an iOS simulator
target. I suspect we just missed this when we added separate "macosx" and "ios"
triples instead of the generic "darwin" OS.

llvm-svn: 196527
2013-12-05 19:38:42 +00:00
Alp Toker f6a24ce40f Fix a tranche of comment, test and doc typos
llvm-svn: 196510
2013-12-05 16:25:25 +00:00
Richard Smith f03bd30854 PR17983: Fix crasher bug in C++1y mode when performing a non-global array
delete on a class which has no array cookie and has no class-specific operator
new.

llvm-svn: 196488
2013-12-05 08:30:59 +00:00
Argyrios Kyrtzidis 9ef5775a94 [libclang] Record ranges skipped by the preprocessor and expose them with libclang.
Patch by Erik Verbruggen!

llvm-svn: 196487
2013-12-05 08:19:32 +00:00
Argyrios Kyrtzidis a60d8ae09d [c-index-test] For the '-remap-file=' option use ':' instead of ';' for separator.
lldb does not like semicolon as part of an option.

llvm-svn: 196485
2013-12-05 08:19:18 +00:00
Richard Smith a230224be4 Implement DR482: namespace members can be redeclared with a qualified name
within their namespace, and such a redeclaration isn't required to be a
definition any more.

Update DR status page to say Clang 3.4 instead of SVN and add new Clang 3.5
category (but keep Clang 3.4 yellow for now).

llvm-svn: 196481
2013-12-05 07:51:02 +00:00
Argyrios Kyrtzidis b9a405b33e [objc] If an interface has no initializer marked as designated and introduces at least one new initializer,
don't assume that it inherits the designated initializers from the super class.

If the assumption was wrong because a new initializer was a designated one that was not marked as such,
we will emit misleading warnings for subclasses of the interface.

llvm-svn: 196476
2013-12-05 07:07:03 +00:00
Alp Toker d473363876 Correct hyphenations in comments and assert messages
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.

llvm-svn: 196466
2013-12-05 04:47:09 +00:00
Richard Smith 72bcaeca1d Per [dcl.meaning]p1, a name in an inline namespace can be redeclared using a
name from the enclosing namespace set if the name is specified as a
qualified-id.

llvm-svn: 196464
2013-12-05 04:30:04 +00:00
Faisal Vali 5fb7c3c4ed Fix init-captures for generic lambdas.
For an init capture, process the initialization expression
right away.  For lambda init-captures such as the following:
const int x = 10;
 auto L = [i = x+1](int a) {
   return [j = x+2,
          &k = x](char b) { };
 };
keep in mind that each lambda init-capture has to have:
 - its initialization expression executed in the context
   of the enclosing/parent decl-context.
 - but the variable itself has to be 'injected' into the
   decl-context of its lambda's call-operator (which has
   not yet been created).
Each init-expression is a full-expression that has to get
Sema-analyzed (for capturing etc.) before its lambda's
call-operator's decl-context, scope & scopeinfo are pushed on their
respective stacks.  Thus if any variable is odr-used in the init-capture
it will correctly get captured in the enclosing lambda, if one exists.
The init-variables above are created later once the lambdascope and
call-operators decl-context is pushed onto its respective stack.

Since the lambda init-capture's initializer expression occurs in the
context of the enclosing function or lambda, therefore we can not wait
till a lambda scope has been pushed on before deciding whether the
variable needs to be captured.  We also need to process all
lvalue-to-rvalue conversions and discarded-value conversions,
so that we can avoid capturing certain constant variables.
For e.g.,
 void test() {
  const int x = 10;
  auto L = [&z = x](char a) { <-- don't capture by the current lambda
    return [y = x](int i) { <-- don't capture by enclosing lambda
         return y;
    }
  };
If x was not const, the second use would require 'L' to capture, and
that would be an error.
Make sure TranformLambdaExpr is also aware of this.

Patch approved by Richard (Thanks!!) 
http://llvm-reviews.chandlerc.com/D2092

llvm-svn: 196454
2013-12-05 01:40:41 +00:00
David Majnemer 3252fd0d5b Parse: Recover better from bad definitions with base specifiers
We would skip until the next comma, hoping good things whould lie there,
however this would fail when we have such things as this:

struct A {};
template <typename>
struct D;
template <>
struct D<C> : B, A::D;

Once this happens, we would believe that D with a nested namespace
specifier of A was a variable that was being declared. We would go on
to complain that there was an extraneous 'template <>' on their variable
declaration.

Crashes would happen when 'A' gets defined as 'enum class A {}' as
various asserts would fire.

Instead, we should skip up until the semicolon if we see that we are in
the middle of a definition and the current token is a ':'

This fixes PR17084.

llvm-svn: 196453
2013-12-05 01:36:53 +00:00
Reid Kleckner 0503a870a9 Add an AdjustedType sugar node for adjusting calling conventions
Summary:
In general, this type node can be used to represent any type adjustment
that occurs implicitly without losing type sugar.  The immediate use of
this is to adjust the calling conventions of member function pointer
types without breaking template instantiation.

Fixes PR17996.

Reviewers: rsmith

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

llvm-svn: 196451
2013-12-05 01:23:43 +00:00
Richard Smith d091dc179d Reject template-ids containing literal-operator-ids that have a dependent
nested-name-specifier, rather than crashing. (In fact, reject all
literal-operator-ids that have a non-namespace nested-name-specifier). The
grammar doesn't allow these in some cases, and in other cases does allow them
but instantiation will always fail.

llvm-svn: 196443
2013-12-05 00:58:33 +00:00
Faisal Vali bb9071ea80 Fix for PR18052 - Lambdas within NSDMI's and default arguments in Nested classes.
Clang currently croaks on the following:
  struct X1 {
    struct X2 {
      int L = ([] (int i) { return i; })(2);
    };
  };

asserting that the containing lexical context of the lambda is not Sema's cur context, when pushing the lambda's decl context on.

This occurs because (prior to this patch) getContainingDC always returns the non-nested class for functions at class scope (even for inline member functions of nested classes (to account for delayed parsing of their bodies)).  The patch addresses this by having getContainingDC always return the lexical DC for a lambda's call operator.

Link to the bug: http://llvm.org/bugs/show_bug.cgi?id=18052
Link to Richard Smith's feedback on phabricator: http://llvm-reviews.chandlerc.com/D2331

Thanks!

llvm-svn: 196423
2013-12-04 22:43:08 +00:00
Aaron Ballman d9c5c5cb3f Getting rid of some hard-coded strings. No functional changes intended, though some test cases needed to be updated for attribute names becoming quoted.
llvm-svn: 196417
2013-12-04 22:02:33 +00:00
Fariborz Jahanian 1a2519a7e9 ObjectiveC - Introducing objc_bridge_related attribute
which specifies couple of (optional) method selectors
for bridging a CFobject to or from an ObjectiveC 
object. This is wip. // rdsr://15499111

llvm-svn: 196408
2013-12-04 20:32:50 +00:00
Reid Kleckner 739756c0f9 [ms-cxxabi] Construct and destroy call arguments in the correct order
Summary:
MSVC destroys arguments in the callee from left to right.  Because C++
objects have to be destroyed in the reverse order of construction, Clang
has to construct arguments from right to left and destroy arguments from
left to right.

This patch fixes the ordering by reversing the order of evaluation of
all call arguments under the MS C++ ABI.

Fixes PR18035.

Reviewers: rsmith

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

llvm-svn: 196402
2013-12-04 19:23:12 +00:00
David Blaikie 2183e70ce2 Fix test case due to r196394 and improve it to not rely on LLVM code generation either.
llvm-svn: 196399
2013-12-04 19:09:19 +00:00
Aaron Ballman 66037479af When parsing ignored attribute arguments, presuming the first argument is an unresolved identifier the same way that we do for unknown arguments. This resolves PR18075, where we regressed the handling of OpenBSD's bounded attribute.
llvm-svn: 196387
2013-12-04 15:32:26 +00:00
Richard Sandiford cdd86884a4 [SystemZ] Fix handling of pass-by-pointer arguments
I'd misunderstood getIndirect() to mean that the argument should be passed
as a pointer at the ABI level, with the ByVal argument choosing caller-copy
semantics over no-caller-copy (callee-copy-on-write) semantics.  But
getIndirect(x) actually means that x is passed by pointer at the IR
level but (at least on all other targets I looked at) directly at the
ABI level.  getIndirect(x, false) selects a pointer to a caller-made
copy, which is what SystemZ was aiming for.

This fixes a miscompilation of c-index-test.  Structure arguments were being
passed by pointer, but no copy was being made, so a write in the callee
stomped over a caller's local variable.

llvm-svn: 196370
2013-12-04 09:59:57 +00:00
David Majnemer dbc0c8f941 Sema: Propagate the mangling number into instantiations
We would lose track of the mangling number assigned to the original
declaration which would cause us to create manglings that didn't match
the Itanium C++ specification.

e.g. Two static fields with the same name inside of a function template
would receive the same mangling with LLVM fixing up the second field so
they wouldn't collide.  This would create an incompatibility with other
compilers following the Itanium ABI.

I've confirmed that the new mangling is identical to the ones generated
by icc and gcc.

N.B. This was uncovered while working on Microsoft mangler.

llvm-svn: 196368
2013-12-04 09:01:55 +00:00
Kevin Qin ad53b87c70 [AArch64 NEON] Add ACLE intrinsic vceqz_f64.
llvm-svn: 196361
2013-12-04 08:02:11 +00:00
Kevin Qin 8903f8df4b [AArch64 NEON] Add missing compare intrinsics.
llvm-svn: 196359
2013-12-04 07:53:09 +00:00
Serge Pavlov f79bd5cb9d Fix error recovery in return statement.
This patch fixes PR16989.

llvm-svn: 196352
2013-12-04 03:51:59 +00:00
Faisal Vali cb7e5df97e Fix PR17637: incorrect calculation of template parameter depth
In delayed template parsing mode, adjust the template depth counter for each template parameter list associated with an out of line member template specialization.

llvm-svn: 196351
2013-12-04 03:51:14 +00:00
NAKAMURA Takumi 0acd8a7561 clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/
llvm-svn: 196350
2013-12-04 03:41:33 +00:00
NAKAMURA Takumi 7cbe30fc43 clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/
llvm-svn: 196349
2013-12-04 03:41:15 +00:00
NAKAMURA Takumi a1d1388a2b clang/test/CodeGen/builtins-nvptx.c: Prune "REQUIRES: nvptx64-registered-target". "nvptx" should imply it.
llvm-svn: 196348
2013-12-04 03:41:02 +00:00
NAKAMURA Takumi 67eade63fd check-clang: Introduce get_llvm_config_props in clang/test/lit.cfg.
In trunk, we can use features as below:

  aarch64-registered-target
  hexagon-registered-target
  msp430-registered-target
  r600-registered-target
  systemz-registered-target
  xcore-registered-target

Each of them, as below, implies corresponding subtargets:

  arm-registered-target   -- arm, thumb
  mips-registered-target  -- mips, mips64, mips64el, mipsel
  nvptx-registered-target -- nvptx, nvptx64
  sparc-registered-target -- sparc, sparcv9
  x86-registered-target   -- x86, x86-64

They will be renamed:

  cppbackend-registered-target -- was "cpp". Unused in trunk.
  powerpc-registered-target -- was "ppc32", "ppc64" and "ppc64le".

The feature "asserts" is also taken from llvm-config.

llvm-svn: 196347
2013-12-04 03:40:56 +00:00
Richard Smith 8f65806b35 Fix crash if a dependent template-id was assumed to be a type but instantiates
to a variable template specialization.

llvm-svn: 196337
2013-12-04 00:56:29 +00:00
Richard Smith f95fe9b870 Fix crash if a variable template specialization is used in a nested-name-specifier.
llvm-svn: 196335
2013-12-04 00:47:45 +00:00
Richard Smith 72bfbd8615 Fix several crash-on-invalids when using template-ids that aren't
simple-template-ids (eg, 'operator+<int>') in weird places.

llvm-svn: 196333
2013-12-04 00:28:23 +00:00
Argyrios Kyrtzidis db5ce0f71e [objc] Add a warning when a class that provides a designated initializer, does not
override all of the designated initializers of its superclass.

llvm-svn: 196319
2013-12-03 21:11:54 +00:00
Argyrios Kyrtzidis b66d3cf5cf [objc] Emit warning when the implementation of a secondary initializer calls on
super another initializer and when the implementation does not delegate to
another initializer via a call on 'self'.

A secondary initializer is an initializer method not marked as a designated
initializer within a class that has at least one initializer marked as a
designated initializer.

llvm-svn: 196318
2013-12-03 21:11:49 +00:00
Argyrios Kyrtzidis fcded9b93a [objc] Emit warnings when the implementation of a designated initializer calls on
super an initializer that is not a designated one or any initializer on self.

llvm-svn: 196317
2013-12-03 21:11:43 +00:00
Argyrios Kyrtzidis 22bfa2c28b [objc] Emit a warning when the implementation of a designated initializer does not chain to
an init method that is a designated initializer for the superclass.

llvm-svn: 196316
2013-12-03 21:11:36 +00:00
Argyrios Kyrtzidis d1438b446e [objc] Introduce attribute 'objc_designated_initializer'.
It only applies to methods of init family in an interface declaration.

llvm-svn: 196314
2013-12-03 21:11:25 +00:00
Daniel Jasper 88d8695ab4 Fix corner case in module-based layering warning.
Before, there SourceManager would not return a FileEntry for a
SourceLocation of a macro expansion (if the header name itself is
defined in a macro). We'd then fallback to assume that the module
currently being built is the including module. However, in this case we
are actually interested in the spelling location of the filename loc in
order to derive the including module.

llvm-svn: 196311
2013-12-03 20:30:36 +00:00
Fariborz Jahanian a759848126 Issue diagnostic when constructor or destructor
return void expression. // rdar://15366494
pr17759.

llvm-svn: 196296
2013-12-03 17:10:08 +00:00
Rafael Espindola a6d47ae71c Check IR on this test.
llvm-svn: 196287
2013-12-03 14:46:31 +00:00
Rafael Espindola 623a911672 Check IR on this test.
llvm-svn: 196286
2013-12-03 14:43:17 +00:00
Rafael Espindola 218935d1ec Check IR on this test.
llvm-svn: 196285
2013-12-03 14:37:33 +00:00
Rafael Espindola 6ffd88d664 Check IR on this test.
llvm-svn: 196284
2013-12-03 14:35:42 +00:00
Rafael Espindola 8dcdca67e3 Check IR on this test.
llvm-svn: 196282
2013-12-03 14:33:08 +00:00
Rafael Espindola aec96b866b check IR in this test
llvm-svn: 196281
2013-12-03 14:23:52 +00:00
Rafael Espindola f6b5c16ecc check IR in this test.
llvm-svn: 196280
2013-12-03 14:21:57 +00:00
Rafael Espindola d22e26860d check IR in this test.
llvm-svn: 196279
2013-12-03 14:19:02 +00:00
Rafael Espindola bc81c07238 Check IR in this test.
llvm-svn: 196278
2013-12-03 14:16:22 +00:00
Rafael Espindola a1226fc722 Check IR in this test.
llvm-svn: 196277
2013-12-03 14:09:19 +00:00
Rafael Espindola 1612b810f4 Check IR in this test.
llvm-svn: 196276
2013-12-03 14:06:23 +00:00
Rafael Espindola b6faecafb3 Check IR instead of assembly in this test.
llvm-svn: 196275
2013-12-03 13:57:25 +00:00
Daniel Jasper e1d9141433 clang-format: Explicitly set fallback style that is tested.
llvm-svn: 196213
2013-12-03 06:48:41 +00:00
Alp Toker 47642d2b7e Emit an extension warning when changing system header tokens
clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.

Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.

This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.

Implementation returns bool for symmetry with token annotation functions.

Some examples:

warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod

warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;

llvm-svn: 196212
2013-12-03 06:13:01 +00:00
Hao Liu a5246fde90 [AArch64]Add missing floating point convert, round and misc intrinsics.
E.g. int64x1_t vcvt_s64_f64(float64x1_t a) -> FCVTZS Dd, Dn

llvm-svn: 196211
2013-12-03 06:07:13 +00:00
Hao Liu 38658a8186 AArch64: add missing ACLE intrinsics mapping to general arithmetic operation from VFP instructions.
E.g. float64x1_t vadd_f64(float64x1_t a, float64x1_t b) -> FADD Dd, Dn, Dm.

llvm-svn: 196209
2013-12-03 05:58:49 +00:00
Jiangning Liu e82327ddd3 Patch by Ana Pazos.
Fixed vcopy_laneq_f64 intrinsic implementation.

llvm-svn: 196206
2013-12-03 05:36:55 +00:00
Hao Liu 4b850c5e0d revert r196152.
This is a duplicate implementation.
E.g. this patch defines:
     float64_t vabd_f64(float64_t a, float64_t b)
But there is already a similar intrinsic "vabdd_f64" with the same types.
Also, this intrinsic will be conflicted to the vector type intrinsic as following(Which is implemented by me and will be committed to trunk):
     float64x1_t vabd_f64(float64x1_t a, float64x1_t b).
Two functions shouldn't have a same name in arm_neon.h.
According to ARM ACLE document, such vabd_f64 with float64_t is not existing.
So I revert this commit.

llvm-svn: 196205
2013-12-03 05:35:17 +00:00
Alp Toker bbbf50541b Test to ensure no old-style-cast warning is emitted for objc-arc __bridge casts
llvm-svn: 196204
2013-12-03 05:31:51 +00:00
Hao Liu ce258820ca AArch64: Add missing scalar pair intrinsics.
E.g. "float32_t vaddv_f32(float32x2_t a)" to be matched into "faddp s0, v1.2s".

llvm-svn: 196199
2013-12-03 03:40:08 +00:00
Jiangning Liu 2d31f6f610 Add some missing AArch64 Neon intrinsics like vuqadd_s64 and friends.
llvm-svn: 196191
2013-12-03 01:33:16 +00:00
Jiangning Liu cc1da2c938 Add some missing AArch64 Neon intrinsics like vmull_high_n_s16 and friends.
llvm-svn: 196189
2013-12-03 01:28:55 +00:00
Dmitri Gribenko fc13b8baf1 MS inline asm: When LLVM called back to Clang to parse a name and do name
lookup, if parsing failed, we did not restore the lexer state properly, and
eventually crashed.  This change ensures that we always consume all the tokens
from the new token stream we started to parse the name from inline asm.

llvm-svn: 196182
2013-12-03 00:48:09 +00:00
Chad Rosier 25052adf21 [AArch64] Implemented vcopy_lane patterns using scalar DUP instruction.
Patch by Ana Pazos!

llvm-svn: 196153
2013-12-02 21:07:27 +00:00
Chad Rosier b0574f3bf7 [AArch64] Add missing NEON scalar floating-point to integer convert ACLEs.
llvm-svn: 196152
2013-12-02 21:07:24 +00:00
Aaron Ballman 604dfec8dc Re-enabled support for the Subjects for the weak attribute. This changes the diagnostic involved to be more accurate -- for C++ code, it will now report that weak applies to variables, functions or classes. Added additional test case for this.
llvm-svn: 196120
2013-12-02 17:07:07 +00:00
Alexander Kornienko bc4ae44928 Added an option to specify fallback style.
Summary:
Added -fallback-style option. Changed clang-format to stop searching
for .clang-format when an invalid file is found.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 196108
2013-12-02 15:21:38 +00:00
Alp Toker 99416d3ef2 Correct test to target 'unknown'
llvm-svn: 196060
2013-12-02 03:50:16 +00:00
Rafael Espindola 6edca7d9bd Handle CC and NoReturn when instantiating members of class templates.
Before we were considering them only when instantiating templates.

This fixes pr18033.

llvm-svn: 196050
2013-12-01 16:54:29 +00:00
Benjamin Kramer 2dece5747a CommentLexer: When proceeding with a typo corrected name don't clobber the token.
This would crash if the token is used in another diagnostic. PR18051.

llvm-svn: 196048
2013-12-01 15:09:32 +00:00
Benjamin Kramer 6b7247263f Reenable ms inline asm test.
LLVM r196044 should make it pass.

llvm-svn: 196045
2013-12-01 11:48:10 +00:00
Saleem Abdulrasool 73196baef4 add an additional test case for generic attributes
gcc treats [[gnu:const]], [[gnu::__const]], and [[gnu:__const__]] as all being
equivalent.  Add an additional test case to ensure that we do not miss the last
case.

llvm-svn: 195982
2013-11-30 21:17:12 +00:00
Alexander Kornienko cabdd738fc Added LanguageStandard::LS_JavaScript to gate all JS-specific parsing.
Summary:
Use LS_JavaScript for files ending with ".js". Added support for ">>>="
operator.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 195961
2013-11-29 15:19:43 +00:00
Aaron Ballman 80469038c0 Enables support for custom subject lists for attributes. As a testbed, uses the custom subject for the ibaction attribute.
llvm-svn: 195960
2013-11-29 14:57:58 +00:00
Hao Liu 8a0099e02c Fix the problem that the range check for scalar narrow shift is too wide.
E.g. the immediate value of vshrns_n_s16 is [1,16], which should be [1,8].

llvm-svn: 195942
2013-11-29 02:13:17 +00:00
Jiangning Liu 24173dd4b1 Add missing intrinsic function vbsl_f64 for AArch64 NEON.
llvm-svn: 195940
2013-11-29 01:38:49 +00:00
Jiangning Liu c8a9d762d3 Add missing intrinsic function vcombine_f64 for AArch64 NEON.
llvm-svn: 195937
2013-11-29 01:29:57 +00:00
Alp Toker 6a7f41f0ec Fix test on Windows
'not' on Windows tries and fails to convert the argument to UTF-16 and back for
some reason:

  Error: Unable to convert command-line to UTF-16

Let's try replacing it with !.

(There was no obvious way to do these with FileCheck)

llvm-svn: 195907
2013-11-28 05:55:40 +00:00