aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-10-18 22:28:37 +0000
committerJohn McCall <rjmccall@apple.com>2011-10-18 22:28:37 +0000
commit2dde35bc626153492f5f58202506c88a27fbff5b (patch)
tree339ef89cb3aef4f0e23a575811a379b37aed4793 /lib/Analysis/PrintfFormatString.cpp
parentc705d2520a51de1dc38d36efada8e9bc2d8b0d1f (diff)
More metaprogramming with builtin types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--lib/Analysis/PrintfFormatString.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp
index 4e3e391fd0..affc83e7ef 100644
--- a/lib/Analysis/PrintfFormatString.cpp
+++ b/lib/Analysis/PrintfFormatString.cpp
@@ -372,11 +372,9 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt) {
}
// We can only work with builtin types.
- if (!QT->isBuiltinType())
- return false;
-
- // Everything else should be a base type
const BuiltinType *BT = QT->getAs<BuiltinType>();
+ if (!BT)
+ return false;
// Set length modifier
switch (BT->getKind()) {
@@ -388,19 +386,15 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt) {
case BuiltinType::UInt128:
case BuiltinType::Int128:
case BuiltinType::Half:
- // Integral types which are non-trivial to correct.
+ // Various types which are non-trivial to correct.
return false;
- case BuiltinType::Void:
- case BuiltinType::NullPtr:
- case BuiltinType::ObjCId:
- case BuiltinType::ObjCClass:
- case BuiltinType::ObjCSel:
- case BuiltinType::Dependent:
- case BuiltinType::Overload:
- case BuiltinType::BoundMember:
- case BuiltinType::UnknownAny:
- case BuiltinType::ARCUnbridgedCast:
+#define SIGNED_TYPE(Id, SingletonId)
+#define UNSIGNED_TYPE(Id, SingletonId)
+#define FLOATING_TYPE(Id, SingletonId)
+#define BUILTIN_TYPE(Id, SingletonId) \
+ case BuiltinType::Id:
+#include "clang/AST/BuiltinTypes.def"
// Misc other stuff which doesn't make sense here.
return false;