diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-12-09 12:22:12 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-12-09 12:22:12 +0000 |
commit | f4f0c6095d1f481b94c6821c65e3bf1c9df42af7 (patch) | |
tree | d2caaa2155d6ae3b1162d71d3d66b3c622babbc6 /lib/Analysis/PrintfFormatString.cpp | |
parent | b8ec3e35d2d7a56b21cb449d4a7bde8d9d12c2a5 (diff) |
Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 3b8c45b7e2..2dd9bf7b2e 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -247,7 +247,8 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { if (CS.getKind() == ConversionSpecifier::cArg) switch (LM.getKind()) { case LengthModifier::None: return Ctx.IntTy; - case LengthModifier::AsLong: return ArgTypeResult::WIntTy; + case LengthModifier::AsLong: + return ArgTypeResult(ArgTypeResult::WIntTy, "wint_t"); default: return ArgTypeResult::Invalid(); } @@ -296,14 +297,16 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { } switch (CS.getKind()) { - case ConversionSpecifier::sArg: - return ArgTypeResult(LM.getKind() == LengthModifier::AsWideChar ? - ArgTypeResult::WCStrTy : ArgTypeResult::CStrTy); + case ConversionSpecifier::sArg: { + if (LM.getKind() == LengthModifier::AsWideChar) + return ArgTypeResult(ArgTypeResult::WCStrTy, "wchar_t *"); + return ArgTypeResult::CStrTy; + } case ConversionSpecifier::SArg: // FIXME: This appears to be Mac OS X specific. - return ArgTypeResult::WCStrTy; + return ArgTypeResult(ArgTypeResult::WCStrTy, "wchar_t *"); case ConversionSpecifier::CArg: - return Ctx.WCharTy; + return ArgTypeResult(Ctx.WCharTy, "wchar_t"); case ConversionSpecifier::pArg: return ArgTypeResult::CPointerTy; default: |