diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-12-16 22:34:14 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-12-16 22:34:14 +0000 |
commit | 7ec59c78f1e19157767648cbe3f0e3630ca1afe7 (patch) | |
tree | f858717b5bb0cfc489951af9f4f7ecfe606ff95e /include/clang/Basic/TargetInfo.h | |
parent | 9952070fa22695845c45869a501bc8651ca36e78 (diff) |
Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/TargetInfo.h')
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 39d4fe9c02..e9b9d14daf 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -76,6 +76,7 @@ protected: unsigned char LargeArrayMinWidth, LargeArrayAlign; unsigned char LongWidth, LongAlign; unsigned char LongLongWidth, LongLongAlign; + unsigned char SuitableAlign; unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth; const char *DescriptionString; const char *UserLabelPrefix; @@ -212,6 +213,10 @@ public: unsigned getLongLongWidth() const { return LongLongWidth; } unsigned getLongLongAlign() const { return LongLongAlign; } + /// getSuitableAlign - Return the alignment that is suitable for storing any + /// object with a fundamental alignment requirement. + unsigned getSuitableAlign() const { return SuitableAlign; } + /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in /// bits. unsigned getWCharWidth() const { return getTypeWidth(WCharType); } |