aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/FormatString.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2011-12-09 12:22:12 +0000
committerHans Wennborg <hans@hanshq.net>2011-12-09 12:22:12 +0000
commitf4f0c6095d1f481b94c6821c65e3bf1c9df42af7 (patch)
treed2caaa2155d6ae3b1162d71d3d66b3c622babbc6 /lib/Analysis/FormatString.cpp
parentb8ec3e35d2d7a56b21cb449d4a7bde8d9d12c2a5 (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/FormatString.cpp')
-rw-r--r--lib/Analysis/FormatString.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp
index fe308471bd..2d56c233b6 100644
--- a/lib/Analysis/FormatString.cpp
+++ b/lib/Analysis/FormatString.cpp
@@ -228,7 +228,6 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
return false;
}
- case TypedefTy:
case SpecificTy: {
argTy = C.getCanonicalType(argTy).getUnqualifiedType();
if (T == argTy)
@@ -332,7 +331,6 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const {
case AnyCharTy:
return C.CharTy;
case SpecificTy:
- case TypedefTy:
return T;
case CStrTy:
return C.getPointerType(C.CharTy);
@@ -354,9 +352,10 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const {
}
std::string ArgTypeResult::getRepresentativeTypeName(ASTContext &C) const {
- if (K != TypedefTy)
- return std::string("'") + getRepresentativeType(C).getAsString() + "'";
- return std::string("'") + Name + "' (aka '" + T.getAsString() + "')";
+ std::string S = getRepresentativeType(C).getAsString();
+ if (Name)
+ return std::string("'") + Name + "' (aka '" + S + "')";
+ return std::string("'") + S + "'";
}