Go to file
David Majnemer cd3ebfe293 [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)
The layout_version attribute is pretty straightforward: use the layout
rules from version XYZ of MSVC when used like
struct __declspec(layout_version(XYZ)) S {};

The empty_bases attribute is more interesting.  It tries to get the C++
empty base optimization to fire more often by tweaking the MSVC ABI
rules in subtle ways:
1. Disable the leading and trailing zero-sized object flags if a class
   is marked __declspec(empty_bases) and is empty.

   This means that given:
   struct __declspec(empty_bases) A {};
   struct __declspec(empty_bases) B {};
   struct C : A, B {};

   'C' will have size 1 and nvsize 0 despite not being annotated
   __declspec(empty_bases).

2. When laying out virtual or non-virtual bases, disable the injection
   of padding between classes if the most derived class is marked
   __declspec(empty_bases).

   This means that given:
   struct A {};
   struct B {};
   struct __declspec(empty_bases) C : A, B {};

   'C' will have size 1 and nvsize 0.

3. When calculating the offset of a non-virtual base, choose offset zero
   if the most derived class is marked __declspec(empty_bases) and the
   base is empty _and_ has an nvsize of 0.

   Because of the ABI rules, this does not mean that empty bases
   reliably get placed at offset 0!

   For example:
   struct A {};
   struct B {};
   struct __declspec(empty_bases) C : A, B { virtual ~C(); };

   'C' will be pointer sized to account for the vfptr at offset 0.
   'A' and 'B' will _not_ be at offset 0 despite being empty!
   Instead, they will be located right after the vfptr.

   This occurs due to the interaction betweeen non-virtual base layout
   and virtual function pointer injection: injection occurs after the
   nv-bases and shifts them down by the size of a pointer.

llvm-svn: 270457
2016-05-23 17:16:12 +00:00
clang [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version) 2016-05-23 17:16:12 +00:00
clang-tools-extra Fix docs 2016-05-20 22:42:03 +00:00
compiler-rt [sanitizer] Don't use -fomit-frame-pointer in COMPILER_RT_DEBUG=On builds 2016-05-22 19:59:06 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Use single precision fmax in sp path 2016-05-17 19:44:01 +00:00
libcxx Reorganize locale extension fallbacks. NFCI 2016-05-20 12:58:41 +00:00
libcxxabi libc++abi: make __cxa_call_unexpected visible 2016-05-11 23:56:37 +00:00
libunwind unwind: remove last instance of -Wexpansion-to-defined 2016-04-26 01:11:29 +00:00
lld Do not split mergeable sections if they are gc'ed. 2016-05-23 16:55:43 +00:00
lldb SBValue::CreateValueFromData didn’t check whether the SBType passed into it is in fact a valid type - this can lead to LLDB crashing upon access 2016-05-23 17:11:14 +00:00
llgo [llgo] llgoi: separate evaluation from printing 2016-04-25 01:18:20 +00:00
llvm SDAG: Remove the transitional default Select() implementation 2016-05-23 16:52:53 +00:00
openmp Changed parameter names in Fortran modules to correspond with OpenMP 4.5 specification 2016-05-23 16:24:39 +00:00
polly [ScopInfo] Remove unused typedef OutgoingValueMapTy. NFC. 2016-05-23 14:51:52 +00:00