Don't mark decls with mismatching exception specs invalid in MS mode (PR18683)

We accept these with a warning in MS mode, but we would previously mark them
invalid, causing us not to emit code for them.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200815 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo in CastExpr::getCastKindName.

Patch by Mathieu Baudet!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200817 91177308-0d34-0410-b5e6-96231b3b80d8
Make the OptionCategory variable static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200839 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Don't indent relative to unary operators.

It seems like most people see unary operators more like part of the
subsequent identifier and find relative indentation odd.

Before:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                  aaaaa));
After:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                 aaaaa));

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200840 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the range for Malayam UCNs in C99.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200845 91177308-0d34-0410-b5e6-96231b3b80d8
Added the hasLoopVariable sub-matcher for forRangeStmt.

Summary:
This sub-matcher makes it possible to access directly the range-based for
loop variable: forRangeStmt(hasLoopVariable(anything()).bind(...)).
I've tried to re-generate the docs, but the diffs seem to include much more than
this change could cause, so I'd better leave docs update to someone who knows
the intended changes in the contents better.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200850 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C driver. Do not use legacy dispatch for
10.5 or less for x86_64 arch. // rdar://15852259



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200854 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Mangle member pointer template arguments

Member pointers are mangled as they would be represented at runtime.
They can be a single integer literal, single decl, or a tuple with some
more numbers tossed in.  With Clang today, most of those numbers will be
zero because we reject pointers to members of virtual bases.

This change required moving VTableContextBase ownership from
CodeGenVTables to ASTContext, because mangling now depends on vtable
layout.

I also hoisted the inheritance model helpers up to be inline static
methods of MSInheritanceAttr.  This makes the AST code that deals with
member pointers much more readable.

MSVC doesn't appear to have stable manglings of null member pointers:
- Null data memptrs in function templates have a mangling collision with
  the first field of a non-polymorphic single inheritance class.
- The mangling of null data memptrs changes if you add casts.
- Large null function memptrs in class templates crash MSVC.

Clang uses the class template mangling for null data memptrs and the
function template mangling for null function memptrs to deal with this.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200857 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused variable to fix -Werror build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200861 91177308-0d34-0410-b5e6-96231b3b80d8
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200863 91177308-0d34-0410-b5e6-96231b3b80d8
Don't consider records with a NULL identifier as a name for typo correction.

Because in C++, "anonymous" doesn't mean "nameless" for records. In
other words, RecordDecl::isAnonymousStructOrUnion only returns true if
the record lacks a name *and* is not used as the type in an object's
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200868 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Fix mangling of static methods and function references

Function references always use $1? like function pointers and never $E?
like var decl references.  Static methods are mangled like function
pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200869 91177308-0d34-0410-b5e6-96231b3b80d8
PGO: instrumentation based profiling sets function attributes.

We collect a maximal function count among all functions in the pgo data file.
For functions that are hot, we set its InlineHint attribute. For functions that
are cold, we set its Cold attribute.

We currently treat functions with >= 30% of the maximal function count as hot
and functions with <= 1% of the maximal function count are treated as cold.
These two numbers are from preliminary tuning on SPEC.

This commit should not affect non-PGO builds and should boost performance on
instrumentation based PGO.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200874 91177308-0d34-0410-b5e6-96231b3b80d8
Changed OptionCategory variables to be static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200876 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up some particularly ugly casting.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200877 91177308-0d34-0410-b5e6-96231b3b80d8
Try to fix ppc bot failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200880 91177308-0d34-0410-b5e6-96231b3b80d8
Add a CC1 option -verify-pch

This option will:
- load the given pch file
- verify it is not out of date by stat'ing dependencies, and
- return 0 on success and non-zero on error

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200884 91177308-0d34-0410-b5e6-96231b3b80d8
Fix -Wunused-variable 'FD' by using it instead of ND when they're equal but FD
has a more precise type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200889 91177308-0d34-0410-b5e6-96231b3b80d8
Fix Werror introduced at r200874.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200891 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify code by combining ifs.

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