summaryrefslogtreecommitdiff
path: root/lib/Analysis/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-08-22 07:53:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-08-22 07:53:21 +0000
commitdf72071db0ddfd7264485105c19230c315e8ce2c (patch)
tree5059e0c04e858ed43286310e91fc069d8404b2f0 /lib/Analysis/PrintfFormatString.cpp
parent32b5a1e82f535d43e94332183cd330f4a39b2dbd (diff)
downloadclang-df72071db0ddfd7264485105c19230c315e8ce2c.tar.gz
clang-df72071db0ddfd7264485105c19230c315e8ce2c.tar.bz2
clang-df72071db0ddfd7264485105c19230c315e8ce2c.tar.xz
Analysis: Make %I in printf more reasonable, add more tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--lib/Analysis/PrintfFormatString.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp
index cdf6122363..f21b407bcb 100644
--- a/lib/Analysis/PrintfFormatString.cpp
+++ b/lib/Analysis/PrintfFormatString.cpp
@@ -296,8 +296,9 @@ ArgType PrintfSpecifier::getArgType(ASTContext &Ctx,
// FIXME: How to get the corresponding signed version of size_t?
return ArgType();
case LengthModifier::AsInt3264:
- return Ctx.getTargetInfo().getTriple().isArch64Bit() ? Ctx.LongLongTy
- : Ctx.IntTy;
+ return Ctx.getTargetInfo().getTriple().isArch64Bit()
+ ? ArgType(Ctx.LongLongTy, "__int64")
+ : ArgType(Ctx.IntTy, "__int32");
case LengthModifier::AsPtrDiff:
return ArgType(Ctx.getPointerDiffType(), "ptrdiff_t");
case LengthModifier::AsAllocate:
@@ -328,8 +329,8 @@ ArgType PrintfSpecifier::getArgType(ASTContext &Ctx,
return ArgType(Ctx.getSizeType(), "size_t");
case LengthModifier::AsInt3264:
return Ctx.getTargetInfo().getTriple().isArch64Bit()
- ? Ctx.UnsignedLongLongTy
- : Ctx.UnsignedIntTy;
+ ? ArgType(Ctx.UnsignedLongLongTy, "unsigned __int64")
+ : ArgType(Ctx.UnsignedIntTy, "unsigned __int32");
case LengthModifier::AsPtrDiff:
// FIXME: How to get the corresponding unsigned
// version of ptrdiff_t?