Attach metadata to generated IR with pointers to original AST Stmts.

This is done in two parts: a MetadataInserter object is added to CodeGenFunction, and keeps a stack of Stmt pointers. If a Stmt is being traversed by CodeGen it is pushed onto the stack, and removed when traversal is finished. Secondly, we make IRBuilder use a custom Inserter, which has knowledge of the MetadataInserter being used, and attaches Metadata appropriately to any Instruction that it inserts. Because certain IRBuilderBase functions do not use the Inserter (CreateMemSet, CreateMemCpy, CreateMemMove), we use a custom IRBuilder which extends llvm::IRBuilder and implements custom versions of these functions to catch the inserted Instruction and attach Metadata to it.
Don't emit Metadata for Instructions with no known source Stmt.
Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157583 91177308-0d34-0410-b5e6-96231b3b80d8
Address minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.

Use actual factory functions rather than derived classes acting as named constructors/factories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157588 91177308-0d34-0410-b5e6-96231b3b80d8
Fix suspicous isIntegerType() check, found by PVS Studio (PR12357).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157593 91177308-0d34-0410-b5e6-96231b3b80d8
OpenCL: Fix vector conditional operator CodeGen for the case where
the operands are vectors of doubles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157596 91177308-0d34-0410-b5e6-96231b3b80d8
Use fewer temporaries mangling APSInt objects. The performance difference
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157601 91177308-0d34-0410-b5e6-96231b3b80d8
Make Clang driver pass the last option from -g group to the compiler.
Leave a better fixme for different debug info flags

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157626 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r155737, restoring the MaxDepth in the BalancedDelimiterTracker to 256.
r155737 turned out to be a temporary work around.  The correct fix was in r155823.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157628 91177308-0d34-0410-b5e6-96231b3b80d8
Define __SSE4A__ when targeting new AMD CPUs.

This doesn't really fit the existing SSELevel so it gets an extra flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157630 91177308-0d34-0410-b5e6-96231b3b80d8
Factor out the code retrieves the last PIC related argument from
the Clang::ConstructJob() to the new ArgList::getLastArg() routine
with eight argument. That simplifies reusing of this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157633 91177308-0d34-0410-b5e6-96231b3b80d8
MIPS: Pass -KPIC argument to MIPS assembler if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157635 91177308-0d34-0410-b5e6-96231b3b80d8
Add an ammintrin.h header for SSE4a intrinsics.

This is a clean-room implementation based on public documentation and
I tried to validate it as much as possible against gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157638 91177308-0d34-0410-b5e6-96231b3b80d8
Install ammintrin.h in the cmake build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157639 91177308-0d34-0410-b5e6-96231b3b80d8
objective-c: fix a sema and IRGen crash when property
getter result type is safe but does not match with property 
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157641 91177308-0d34-0410-b5e6-96231b3b80d8
fixes radar no. in this test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157642 91177308-0d34-0410-b5e6-96231b3b80d8
objc: position of 'fixit' was off by one.
This patch fixes it. // rdar://11488351


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157646 91177308-0d34-0410-b5e6-96231b3b80d8
Add fixits for memory access warnings.
Also, do not display the builtin name and macro expansion when the
function is a builtin.

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