Heed ABIArgInfo::getInReg() for return values.

The 'inreg' attribute can also be applied to function return values in
LLVM IR. The SPARC v9 backend is using the flag when returning structs
containing 32-bit floats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183290 91177308-0d34-0410-b5e6-96231b3b80d8
Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.

Type coercion for argument passing is equivalent to storing the source
type and loading the destination type from the same pointer. On
big-endian targets, this means that the high bits of integers are
preserved.

This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian
targets by inserting the required shift instructions to preserve the
high bits instead of the low bits.

This is used by SparcABIInfo when passing small structs in the high bits
of registers.

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

This could actually be implemented with the LLVM IR va_arg instruction,
but it doesn't seem to offer any advantages over accessing the va_list
pointer directly.

Using the va_list pointer directly makes it possible to perform type
coercion directly from the argument array, and the va_list updates are
exposed to the optimizers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183292 91177308-0d34-0410-b5e6-96231b3b80d8
Default to PIE and using stack protection on OpenBSD.

Patch by Matthew Dempsky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183295 91177308-0d34-0410-b5e6-96231b3b80d8
PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types used via typedefs

In an effort to make -flimit-debug-info more consistent I over-shot the
mark & made types used via typedefs never produce definitions in the
debug info (even if the type was used in a way that would require a
definition).

The fix for this is to do exactly what I was hoping to do at some point
- plumb the declaration/definition choice through the various layers of
"CreateType" in CGDebugInfo. In this way we can produce declarations
whenever they are sufficient & definitions otherwise - including when
qualifiers are used, for example (discovered in PR14467). This may not
be complete (there may be other types/situations where we need to
propagate the "declaration/definition" choice) but it lays the basic
foundation which we can enhance in future iterations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183296 91177308-0d34-0410-b5e6-96231b3b80d8
Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers(); also add some tests for the VTable indices output to make sure we don't regress

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183298 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the DUMP_OVERRIDERS macro in the VTableBuilder.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183299 91177308-0d34-0410-b5e6-96231b3b80d8
Fix fallout from r183298, unused function (CollectPrimaryBases) causing the -Werror build to fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183300 91177308-0d34-0410-b5e6-96231b3b80d8
ASTTests/DeclTest.cpp: Tweak on msvc target to add "-fno-ms-extensions".

MS extensions don't prefer imaginary suffix even with -std=c++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183301 91177308-0d34-0410-b5e6-96231b3b80d8
Make clang tools ignore -fcolor-diagnostics and -fdiagnostics-color retrieved from the compilation database.

Summary:
Clang tools' diagnostic output could be force colored when a command
line from the compilation database contains -fcolor-diagnostics or
-fdiagnostics-color. This is not what we want e.g. for vim integration.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, revane, jordan_rose

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183304 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r183298 and r183300 as the former broke the virtual function lookup in libcxx __locale

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183305 91177308-0d34-0410-b5e6-96231b3b80d8
Unrevert the tests from r183298 as they pass with both old and new code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183306 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for the breakage from r183298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183308 91177308-0d34-0410-b5e6-96231b3b80d8
... and actually run it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183309 91177308-0d34-0410-b5e6-96231b3b80d8
Recommit r183298+r183300 'Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers()'

In r183298, I've used llvm::SmallPtrSet<..., 8> instead of llvm::SmallVector<..., 8> for NewVirtualFunctionsTy by mistake.
This only manifested when a class had more than 8 virtual functions, which wasn't covered by unit-tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183310 91177308-0d34-0410-b5e6-96231b3b80d8
UTF-8 support for clang-format.

Summary:
Detect if the file is valid UTF-8, and if this is the case, count code
points instead of just using number of bytes in all (hopefully) places, where
number of columns is needed. In particular, use the new
FormatToken.CodePointCount instead of TokenLength where appropriate.
Changed BreakableToken implementations to respect utf-8 character boundaries
when in utf-8 mode.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits, rsmith, gribozavr

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183312 91177308-0d34-0410-b5e6-96231b3b80d8
Added test with characters using four bytes in UTF-8 representation.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183317 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbase

Also addresses a review comment from John from on r180985 by removing
the "== -1" check, since it's now reusing the correct code which has the
comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183318 91177308-0d34-0410-b5e6-96231b3b80d8
clang-check: Enable specification of additional compiler arguments

Summary:
This adds two command-line parameters: -extra-arg and -extra-arg-before, which
enable the user to pass additional parameters to the compiler command.

Reviewers: klimek

CC: cfe-commits

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

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