Don't copy objects with trivial, deleted copy ctors

This affects both the Itanium and Microsoft C++ ABIs.

This is in anticipation of a change to the Itanium C++ ABI, and should
match GCC's current behavior.  The new text will likely be:

"""
Pass an object of class type by value if every copy constructor and
move constructor is deleted or trivial and at least one of them is not
deleted, and the destructor is trivial.
"""
http://sourcerytools.com/pipermail/cxx-abi-dev/2014-May/002728.html

On x86 Windows, we can mostly use the same logic, where we use inalloca
instead of passing by address.  However, on Win64, there are register
parameters, and we have to do what MSVC does.  MSVC ignores the presence
of non-trivial move constructors and only considers the presence of
non-trivial or deleted copy constructors.  If a non-trivial or deleted
copy ctor is present, it passes the argument indirectly.

This change fixes bugs and makes us more ABI compatible with both GCC
and MSVC.

Fixes PR19668.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208786 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Fall back immediately if /GR and /fallback were both passed

None of our tests use /fallback, so this lets us gradually add RTTI
support without breaking projects using /fallback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208787 91177308-0d34-0410-b5e6-96231b3b80d8
When we generate a redeclaration for an
elaborated-type-specifier, place it in the correct
context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208799 91177308-0d34-0410-b5e6-96231b3b80d8
Amending r208783 based on a suggestion by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208800 91177308-0d34-0410-b5e6-96231b3b80d8
Rename CodeGenModule::getLLVMLinkageforDeclarator -> getLLVMLinkageForDeclarator

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208808 91177308-0d34-0410-b5e6-96231b3b80d8
Converting some for loops to use range-based for loops. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208810 91177308-0d34-0410-b5e6-96231b3b80d8
Make verbose clang builds also build compiler_rt verbosely

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208821 91177308-0d34-0410-b5e6-96231b3b80d8
[liblang] Introduce clang_getModuleForFile, which given a CXFile header file, returns the module that contains it, if one exists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208822 91177308-0d34-0410-b5e6-96231b3b80d8
When an overloaded comparison operator returns a reference, do not consider
it for -Wunused-comparion warnings.  This fixes PR19724.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208824 91177308-0d34-0410-b5e6-96231b3b80d8
PR19742: cv-qualifiers and ref-qualifiers aren't allowed on functions within
pointer and reference types, even if those types are produced by template
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208825 91177308-0d34-0410-b5e6-96231b3b80d8
Thread Safety Analysis: add new node types to thread safety TIL.
This fills in a few missing gaps in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208830 91177308-0d34-0410-b5e6-96231b3b80d8
Fill in the options in the MCOptions struct directly like the other
options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208834 91177308-0d34-0410-b5e6-96231b3b80d8
Revert Itanium parts of "Don't copy objects with trivial, deleted copy ctors"

This undoes half of r208786.

It had problems with lazily declared special members in cases like this:
  struct A {
    A();
    A &operator=(A &&o);
    void *p;
  };
  void foo(A);
  void bar() {
    foo({});
  }

In this case, the copy and move constructors are implicitly deleted.
However, Clang doesn't eagerly declare the copy ctor in the AST, so we
pass the struct in registers.  Furthermore, GCC passes this in registers
even though this class should be uncopyable.

Revert this for now until the dust settles.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208838 91177308-0d34-0410-b5e6-96231b3b80d8
PR19748: Make sure we don't lose colon protection after the parenthesized type-id in a cast-expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208843 91177308-0d34-0410-b5e6-96231b3b80d8
Replace completely bogus ambiguous-compound-literal-in-C++ code with something
that isn't always wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208844 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Introduce clang_Module_isSystem(), which returns non-zero if the given CXModule is a system one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208846 91177308-0d34-0410-b5e6-96231b3b80d8
AST: Remove dead-code/update reference to standard

GetGVALinkageForFunction handles TSK_ExplicitInstantiationDeclaration
twice, remove the redundant code trying to handle it again.

While we are here, update the reference we make to the standard.  It
seems like another paragraph was added causing this text to get
renumbered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208850 91177308-0d34-0410-b5e6-96231b3b80d8
AArch64: update test after LLVM CodeGen change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208868 91177308-0d34-0410-b5e6-96231b3b80d8
ARM64: update tests now that we print "mov" & "mvn".

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