Silence a signed/unsigned mismatch warning from MSVC; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218121 91177308-0d34-0410-b5e6-96231b3b80d8
Make DynTypedNode have the dynamic type of the object, instead of its static type.

Summary:
Make DynTypedNode have the dynamic type of the object, instead of its static type.
Some optimizations that are in the works require that the nodes have the right type.

Reviewers: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218127 91177308-0d34-0410-b5e6-96231b3b80d8
Silence MSVC warnings from r218127 about not returning a value

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218128 91177308-0d34-0410-b5e6-96231b3b80d8
In the Itanium ABI, move stuff to the comdat of variables with static init.

Clang can already handle

-------------------------------------------
struct S {
  static const int x;
};
template<typename T> struct U {
  static const int k;
};
template<typename T> const int U<T>::k = T::x;

const int S::x = 42;
extern const int *f();
const int *g() { return &U<S>::k; }
int main() {
  return *f() + U<S>::k;
}

const int *f() { return &U<S>::k; }
-------------------------------------------

since r217264 which puts the .inint_array section in the same COMDAT
as the variable.

This patch allows the linker to more easily delete some dead code and data by
putting the guard variable and init function in the same COMDAT.

This is a fixed version of r218089.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218141 91177308-0d34-0410-b5e6-96231b3b80d8
Fix ctor/dtor aliases losing 'dllexport' (for Itanium ABI)

This patch makes sure that the dllexport attribute is transferred to the alias when such alias is created. It only affects the Itanium ABI because for the MSVC ABI a workaround is in place to not generate aliases of dllexport ctors/dtors.
A new CodeGenModule function is provided, CodeGenModule::setAliasAttributes, to factor the code for transferring attributes to aliases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218159 91177308-0d34-0410-b5e6-96231b3b80d8
Follow-up to r214408: Warn on other callee-cleanup functions without prototype too.

According to lore, we used to verifier-fail on:

  void __thiscall f();
  int main() { f(1); }

So that's fixed now. System headers use prototype-less __stdcall functions,
so make that a warning that's DefaultError -- then it fires on regular code
but is suppressed in system headers.

Since it's used in system headers, we have codegen tests for this; massage
them slightly so that they still compile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218166 91177308-0d34-0410-b5e6-96231b3b80d8
Fix bugs in cpuid.h.

This commit makes two changes:

- Remove the push and pop instructions that were saving and restoring %ebx
  before and after cpuid in 32-bit pic mode. We were doing this to ensure we
  don't lose the GOT address in pic register %ebx, but this isn't necessary
  because the GOT address is kept in a virtual register.

- In 64-bit mode, preserve base register %rbx around cpuid.

This fixes PR20311 and rdar://problem/17686779.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218173 91177308-0d34-0410-b5e6-96231b3b80d8
Merge branch 'master', remote-tracking branch 'trunk/master'