Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214436 91177308-0d34-0410-b5e6-96231b3b80d8
Loop hint pragmas sometimes do not contain an identifier option (such as #pragma unroll(4)). Check explicitly that the token we stored was an identifier.

Amends r214432

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214446 91177308-0d34-0410-b5e6-96231b3b80d8
Factor out exception specification information from
FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care
about the other ExtProtoInfo bits and just want to talk about the exception
specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214450 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Maintain an AST invariant across module load/save: if any declaration
of a function has a resolved exception specification, then all declarations of
the function do.

We should probably improve the AST representation to make this implicit (perhaps
only store the exception specification on the canonical declaration), but this
fixes things for now.

The testcase for this (which used to assert) also exposes the actual bug I was
trying to reduce here: we sometimes fail to emit the body of an imported
special member function definition. Fix for that to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214458 91177308-0d34-0410-b5e6-96231b3b80d8
Fix buildbot: work around missing GCC C++11 feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214459 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format vs plugin: claim support for VS 14 CTP too

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214461 91177308-0d34-0410-b5e6-96231b3b80d8
Remove this pointer that is converted to bool.  In well-defined contexts, the
this pointer is always non-null.  If the this pointer is null, it is undefined
and the compiler may optimize it away by assuming it is non-null.  The null
checks are pushed into the callers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214471 91177308-0d34-0410-b5e6-96231b3b80d8
Add comments to debug info testing case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214472 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Remove IRGen special case for emitting implicit special members if
they're somehow missing a body. Looks like this was left behind when the loop
was generalized, and it's not been problematic before because without modules,
a used, implicit special member function declaration must be a definition.

This was resulting in us trying to emit a constructor declaration rather than
a definition, and producing a constructor missing its member initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214473 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Defer va_arg expansion to the backend.

Summary:
This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Reviewers: sstankovic, dsanders

Reviewed By: dsanders

Subscribers: rnk, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214497 91177308-0d34-0410-b5e6-96231b3b80d8
Initializing the loop hint option token.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214502 91177308-0d34-0410-b5e6-96231b3b80d8
Initializing the loop hint option token again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214504 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a memory leak - dispose of the CXString after printing it in mangling.

Thanks to kcc@ for noticing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214506 91177308-0d34-0410-b5e6-96231b3b80d8
Improving diagnostic source ranges for the nonnull attribute. Now it highlights the attribute and the faulty nonpointer type when possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214507 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Add a space in ObjC protocols.

Before:
  @interface Foo (HackStuff)<MyProtocol>

After:
  @interface Foo (HackStuff) <MyProtocol>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214508 91177308-0d34-0410-b5e6-96231b3b80d8
Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.

Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214510 91177308-0d34-0410-b5e6-96231b3b80d8
Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214511 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r214497: [mips] Defer va_arg expansion to the backend.

It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214512 91177308-0d34-0410-b5e6-96231b3b80d8
The GNU-style aligned attribute has an optional expression, but the generated pretty printing logic was unaware of this. Fixed the pretty printing logic, and added a test to ensure it no longer asserts.

Added a FIXME to the code about eliding the parenthesis when pretty printing such a construct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214513 91177308-0d34-0410-b5e6-96231b3b80d8
Merge branch 'master' of github.com:eliben/clang into cindex-mangle-ir