aboutsummaryrefslogtreecommitdiff
path: root/Basic/TargetInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-14 01:29:45 +0000
committerChris Lattner <sabre@nondot.org>2007-07-14 01:29:45 +0000
commitd2d2a11a91d7ddf468bfb70f66362d24806ed601 (patch)
tree1920f1ccb6fc00b05bbd9d884dd821601d906626 /Basic/TargetInfo.cpp
parent8f32f7189b12f67aa4a19bc7c3855b599980eca0 (diff)
A significant refactoring of the type size stuff to also
compute type alignment. This info is needed for struct layout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic/TargetInfo.cpp')
-rw-r--r--Basic/TargetInfo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Basic/TargetInfo.cpp b/Basic/TargetInfo.cpp
index 008e99b914..c94038508e 100644
--- a/Basic/TargetInfo.cpp
+++ b/Basic/TargetInfo.cpp
@@ -157,14 +157,17 @@ void TargetInfo::getTargetDefines(std::vector<char> &Buffer) {
/// ComputeWCharWidth - Determine the width of the wchar_t type for the primary
/// target, diagnosing whether this is non-portable across the secondary
/// targets.
-void TargetInfo::ComputeWCharWidth(SourceLocation Loc) {
- WCharWidth = PrimaryTarget->getWCharWidth();
+void TargetInfo::ComputeWCharInfo(SourceLocation Loc) {
+ PrimaryTarget->getWCharInfo(WCharWidth, WCharAlign);
// Check whether this is portable across the secondary targets if the T-U is
// portable so far.
- for (unsigned i = 0, e = SecondaryTargets.size(); i != e; ++i)
- if (SecondaryTargets[i]->getWCharWidth() != WCharWidth)
+ for (unsigned i = 0, e = SecondaryTargets.size(); i != e; ++i) {
+ unsigned Width, Align;
+ SecondaryTargets[i]->getWCharInfo(Width, Align);
+ if (Width != WCharWidth || Align != WCharAlign)
return DiagnoseNonPortability(Loc, diag::port_wchar_t);
+ }
}