diff options
author | James Molloy <james.molloy@arm.com> | 2012-05-04 10:55:22 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2012-05-04 10:55:22 +0000 |
commit | 392da48160bd92ceb486792780467cbfdb2d0e8c (patch) | |
tree | 17b215252bcc1cfd72072422d0ebb1677fa94da3 /lib/AST/ASTContext.cpp | |
parent | 2e4fd6d9a1c8ba9c400324d230cfc49050550dea (diff) |
Fix handling of wint_t - we can't assume wint_t is purely an integer promotion of wchar_t - they may differ in signedness.
Teach ASTContext about WIntType, and have it taken from TargetInfo like WCharType. Should fix test/Sema/format-strings.c for ARM, with the exception of one subtest which will fail if wint_t and wchar_t are the same size and wint_t is signed, wchar_t is unsigned.
There'll be a followup commit to fix that.
Reviewed by Chandler and Hans at http://llvm.org/reviews/r/8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e4308df653..d80f5b828f 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -436,6 +436,8 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target) { } else // C99 WCharTy = getFromTargetType(Target.getWCharType()); + WIntTy = getFromTargetType(Target.getWIntType()); + if (LangOpts.CPlusPlus) // C++0x 3.9.1p5, extension for C++ InitBuiltinType(Char16Ty, BuiltinType::Char16); else // C99 |