diff options
author | John McCall <rjmccall@apple.com> | 2011-10-18 22:28:37 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-10-18 22:28:37 +0000 |
commit | 59207978e63ca0077b7a850407910e8b44c29277 (patch) | |
tree | 763a502fd50ccad97182891e49f6567bf4e6fede /clang/lib/Analysis/PrintfFormatString.cpp | |
parent | 7d2f7b5a331dc47a33b5bce91a1f4c9a176360fa (diff) | |
download | llvm-59207978e63ca0077b7a850407910e8b44c29277.zip llvm-59207978e63ca0077b7a850407910e8b44c29277.tar.gz llvm-59207978e63ca0077b7a850407910e8b44c29277.tar.bz2 |
More metaprogramming with builtin types.
llvm-svn: 142433
Diffstat (limited to 'clang/lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | clang/lib/Analysis/PrintfFormatString.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp index 4e3e391..affc83e 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/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; |