Commit Graph

20558 Commits

Author SHA1 Message Date
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