aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/FormatString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/FormatString.cpp')
-rw-r--r--lib/Analysis/FormatString.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp
index 74f1e92794..5f3cd4c615 100644
--- a/lib/Analysis/FormatString.cpp
+++ b/lib/Analysis/FormatString.cpp
@@ -206,10 +206,6 @@ clang::analyze_format_string::ParseLengthModifier(FormatSpecifier &FS,
// Methods on ArgTypeResult.
//===----------------------------------------------------------------------===//
-static bool hasSameSize(ASTContext &astContext, QualType typeA, QualType typeB) {
- return astContext.getTypeSize(typeA) == astContext.getTypeSize(typeB);
-}
-
bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
switch (K) {
case InvalidTy:
@@ -230,21 +226,26 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
break;
case BuiltinType::Char_S:
case BuiltinType::SChar:
+ return T == C.UnsignedCharTy;
case BuiltinType::Char_U:
case BuiltinType::UChar:
- return hasSameSize(C, T, C.UnsignedCharTy);
+ return T == C.SignedCharTy;
case BuiltinType::Short:
+ return T == C.UnsignedShortTy;
case BuiltinType::UShort:
- return hasSameSize(C, T, C.ShortTy);
+ return T == C.ShortTy;
case BuiltinType::Int:
+ return T == C.UnsignedIntTy;
case BuiltinType::UInt:
- return hasSameSize(C, T, C.IntTy);
+ return T == C.IntTy;
case BuiltinType::Long:
+ return T == C.UnsignedLongTy;
case BuiltinType::ULong:
- return hasSameSize(C, T, C.LongTy);
+ return T == C.LongTy;
case BuiltinType::LongLong:
+ return T == C.UnsignedLongLongTy;
case BuiltinType::ULongLong:
- return hasSameSize(C, T, C.LongLongTy);
+ return T == C.LongLongTy;
}
return false;
}