aboutsummaryrefslogtreecommitdiff
path: root/Basic/TargetInfo.cpp
diff options
context:
space:
mode:
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);
+ }
}