diff options
Diffstat (limited to 'include/llvm/Support/AlignOf.h')
-rw-r--r-- | include/llvm/Support/AlignOf.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/llvm/Support/AlignOf.h b/include/llvm/Support/AlignOf.h index 061d5acf2322b..574b514aef39b 100644 --- a/include/llvm/Support/AlignOf.h +++ b/include/llvm/Support/AlignOf.h @@ -22,6 +22,14 @@ namespace llvm { template <typename T> struct AlignmentCalcImpl { char x; +#if defined(_MSC_VER) +// Disables "structure was padded due to __declspec(align())" warnings that are +// generated by any class using AlignOf<T> with a manually specified alignment. +// Although the warning is disabled in the LLVM project we need this pragma +// as AlignOf.h is a published support header that's available for use +// out-of-tree, and we would like that to compile cleanly at /W4. +#pragma warning(suppress : 4324) +#endif T t; private: AlignmentCalcImpl() {} // Never instantiate. @@ -190,12 +198,12 @@ union SizerImpl { } // end namespace detail /// \brief This union template exposes a suitably aligned and sized character -/// array member which can hold elements of any of up to four types. +/// array member which can hold elements of any of up to ten types. /// /// These types may be arrays, structs, or any other types. The goal is to /// expose a char array buffer member which can be used as suitable storage for -/// a placement new of any of these types. Support for more than seven types can -/// be added at the cost of more boiler plate. +/// a placement new of any of these types. Support for more than ten types can +/// be added at the cost of more boilerplate. template <typename T1, typename T2 = char, typename T3 = char, typename T4 = char, typename T5 = char, typename T6 = char, typename T7 = char, |