Make FunctionDecl::getReturnTypeSourceRange() support non-builtin types

Also document that the function is a "best-effort" facility to extract source
ranges from limited AST type location info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212174 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: add support for v8 ldaex/stlex builtins.

ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing
variants of the exclusive operations, in line with the C++11 memory
model.

This adds support for two new intrinsics to expose them to C & C++
developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in
direct analogy with the versions with no implicit barrier.

rdar://problem/15885451

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212175 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver][Mips] If ABI name is not provided deduce it from the target triple
not from the CPU name. This approach is closer to the method used by gcc driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212176 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Make FileCheck prefixes match the CPU they check

Summary:
For example: s/MIPS32-EB-AS/MIPS32R2-EB-AS/ since it is for MIPS32r2 not MIPS32.

This reduces the noise in my next Clang patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212177 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Added additional test cases for passing -mabi to the assembler.

Summary:
This patch adds minimal coverage for each -mcpu value to ensure that none of them can pass an empty string in -mabi. 

Prior to r212176, many -mcpu values would trigger this.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212182 91177308-0d34-0410-b5e6-96231b3b80d8
Added standard macro guard. In case __GNUC_VA_LIST was not
defined or defined identically before there will not be any
change in functionality.

MinGW-w64 defines __GNUC_VA_LIST as

  #define __GNUC_VA_LIST
  
which is different than the definition here, causing
a warning without the guard.
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212183 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Print exact source location of global variables in error reports.

See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.

Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
  1) source location (file/line/column info);
  2) whether it is dynamically initialized;
  3) whether it is blacklisted (shouldn't be instrumented).

Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:

  0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40

These source locations are printed even if the binary doesn't have any
debug info.

This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212188 91177308-0d34-0410-b5e6-96231b3b80d8
ARCMigrate: simplify diagnostic handling

Recent enhancements in the diagnostics engine mean that
TransformActions::report() no longer needs to duplicate this suppression logic.

That's great because the old code was flawed and would have attached notes to
the wrong primary diagnostic in non-trivial use.

With these changes it becomes safe to use reportNote() freely in the migration
tool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212191 91177308-0d34-0410-b5e6-96231b3b80d8
Update the MSVC Compatibility document

It hasn't been updated to reflect the progress we've made.  We've fuzz
tested VFTables, VBTables, layout, and RTTI data.  We support lambdas
that are compatible with their scheme.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212193 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: make target builtins support languages

This extends the target builtin support to allow language specific annotations
(i.e. LANGBUILTIN).  This is to allow MSVC compatibility whilst retaining the
ability to have EABI targets use a __builtin_ prefix.  This is merely to allow
uniformity in the EABI case where the unprefixed name is provided as an alias in
the header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212196 91177308-0d34-0410-b5e6-96231b3b80d8
Fixup typo in MSVCCompatibility.rst

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212219 91177308-0d34-0410-b5e6-96231b3b80d8
Fix Typo in MSVCCompatibility.rst
Also removed a sentance that was no longer relevant.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212227 91177308-0d34-0410-b5e6-96231b3b80d8
More editorial issues in MSVCCompatibility.rst

Make the status text for lambdas green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212229 91177308-0d34-0410-b5e6-96231b3b80d8
Fix linkage bug that miscompiled variable templates instantiated from similarly named local types. In essence, this bug ensures that the x<Foo> specialization in function foo() defined as follows differs between two distinct translation units.
    static int &foo() {
       struct Foo { };
       return x<Foo>;
    }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212233 91177308-0d34-0410-b5e6-96231b3b80d8
Update the MSVC compatibilty document for class template parsing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212237 91177308-0d34-0410-b5e6-96231b3b80d8
Enable clang to continue to parse libstdc++4.6 and stlport after r210091.

r210091 made initialization checking more strict in c++11 mode. LWG2193 is
about changing standard libraries to still be valid under these new rules,
but older libstdc++ (e.g. libstdc++4.6 in -D_GLIBCXX_DEBUG=1 mode, or stlport)
do not implement that yet.  So fall back to the C++03 semantics for container
classes in system headers below the std namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212238 91177308-0d34-0410-b5e6-96231b3b80d8
Address review feedback for r212238.

Also, forgot to say in the commit message of r212238: Library authors will
see a warning about this issue if they build with -Wsystem-headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212243 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: rename ARM builtins to use __builtin_arm prefix

This corrects SVN r212196's naming change to use the proper prefix of
`__builtin_arm_` instead of `__builtin_`.

Thanks to Yi Kong for pointing out the incorrect naming!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212253 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Get linkage of RTTI data correct

The Itanium rules are not appropriate for the MS ABI.  RTTI data is
_never_ imported and thus is never available_externally.  It is either
internal (if the type's linkage is internal) or linkonce_odr.

This also means that classes which inherit from dllimport'd bases force
their translation unit to duplicate the entirety of the RTTI data of
that base.

Interestingly, the complete object locator can never be referenced by
translation units which import the class.

This fixes PR20106.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212256 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver][Mips] Check MIPS CPU name provided to the Clang driver.

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