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: http://llvm.org/svn/llvm-project/cfe/trunk@200874 91177308-0d34-0410-b5e6-96231b3b80d8
Changed OptionCategory variables to be static.


git-svn-id: http://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: http://llvm.org/svn/llvm-project/cfe/trunk@200877 91177308-0d34-0410-b5e6-96231b3b80d8
Try to fix ppc bot failure.

git-svn-id: http://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: http://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: http://llvm.org/svn/llvm-project/cfe/trunk@200889 91177308-0d34-0410-b5e6-96231b3b80d8
Fix Werror introduced at r200874.

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

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200893 91177308-0d34-0410-b5e6-96231b3b80d8
DR101, PR12770: If a function is declared in the same context as a
using-declaration, and they declare the same function (either because
the using-declaration is in the same namespace as the declaration it
imports, or because they're both extern "C"), they do not conflict.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200897 91177308-0d34-0410-b5e6-96231b3b80d8
Allow transformation of VariableArray to ConstantArray.

In the following code:

    struct A { static const int sz; };
    template<class T> void f() { T arr[A::sz]; }

the array 'arr' is represented as a variable size array in the template.
If 'A::sz' gets value below in the translation unit, the array in
instantiation can turn into constant size array.

This change fixes PR18633.

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


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200899 91177308-0d34-0410-b5e6-96231b3b80d8
check-clang: Introduce the feature "utf8-capable-terminal".

clang/test/FixIt/fixit-unicode-with-utf8-output.c has begun complained since LLVM r200885.
Although it is changes for StringRef, it brought LLVM_ON_WIN32 to Support/Locale.cpp.

Before r200885, LLVM_ON_WIN32 was undefined in Locale.cpp!

FIXME: We should consider i18n on win32.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200909 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Tweak pointer-to-member mangling/inheritance model selection

Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
  pointer-to-member parameter, nail down an inheritance model.
  N.B. We will chose an inheritance model even if we won't ultimately
  choose the template to instantiate!  Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
  not zero. Previously, we chose an offset of 0.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200920 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Handle indirect field decls in template args

Properly support fields that come from anonymous unions and structs
when used as template arguments for pointer to data member params.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200921 91177308-0d34-0410-b5e6-96231b3b80d8
Wired-up the new LLVM diagnostic system into clang diagnostic system.
The approach is similar to the existing inline-asm reporting, just more
general.

<rdar://problem/15886278>


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200931 91177308-0d34-0410-b5e6-96231b3b80d8
Move -verify-pch to use VerifyJobAction

Use the verify hook rather than the compile hook to represent the
-verify-pch action, and move the exising --verify-debug-info action
into its own subclass of VerifyJobAction.  Incidentally change the name
printed by -ccc-print-phases for --verify-debug-info.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200938 91177308-0d34-0410-b5e6-96231b3b80d8
Silence build-bots from the fallout of r200921


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200940 91177308-0d34-0410-b5e6-96231b3b80d8
Fix indentation of a code example in LibTooling's documentation.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200944 91177308-0d34-0410-b5e6-96231b3b80d8
Use correct ld emulation for EABI hardware float triple on NetBSD.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200946 91177308-0d34-0410-b5e6-96231b3b80d8
PR18128: a lambda capture-default is not permitted for a non-local lambda
expression.


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@200948 91177308-0d34-0410-b5e6-96231b3b80d8
Add isListInitialization matcher.

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

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