summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2011-10-27 08:29:09 +0000
committerHans Wennborg <hans@hanshq.net>2011-10-27 08:29:09 +0000
commit27541dbe1a4a54dde6112095695e2d57a68236fb (patch)
tree86bb73fadb95806f144500c5a80e953126b3e55b /clang/lib/AST/ASTContext.cpp
parentb25abd1a5435b460deb35bc0a04c5aad1df24bd6 (diff)
downloadbcm5719-llvm-27541dbe1a4a54dde6112095695e2d57a68236fb.tar.gz
bcm5719-llvm-27541dbe1a4a54dde6112095695e2d57a68236fb.zip
Teach format string analysis that "%zu" means size_t.
The code had it backwards, thinking size_t was signed, and using that for "%zd". Also let the analysis get the types for (u)intmax_t while we are at it. llvm-svn: 143099
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index cb4e09bfc9e..b695a5b7095 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3001,6 +3001,16 @@ CanQualType ASTContext::getSizeType() const {
return getFromTargetType(Target->getSizeType());
}
+/// getIntMaxType - Return the unique type for "intmax_t" (C99 7.18.1.5).
+CanQualType ASTContext::getIntMaxType() const {
+ return getFromTargetType(Target->getIntMaxType());
+}
+
+/// getUIntMaxType - Return the unique type for "uintmax_t" (C99 7.18.1.5).
+CanQualType ASTContext::getUIntMaxType() const {
+ return getFromTargetType(Target->getUIntMaxType());
+}
+
/// getSignedWCharType - Return the type of "signed wchar_t".
/// Used when in C++, as a GCC extension.
QualType ASTContext::getSignedWCharType() const {
@@ -3015,7 +3025,7 @@ QualType ASTContext::getUnsignedWCharType() const {
return UnsignedIntTy;
}
-/// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
+/// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17)
/// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
QualType ASTContext::getPointerDiffType() const {
return getFromTargetType(Target->getPtrDiffType(0));
OpenPOWER on IntegriCloud