Format string analysis: give 'q' its own enumerator.

This is in preparation for being able to warn about 'q' and other
non-standard format string features.

It also allows us to print its name correctly.

llvm-svn: 150697
This commit is contained in:
Hans Wennborg
2012-02-16 16:34:54 +00:00
parent 96de9933fb
commit 9bc9bcc247
6 changed files with 25 additions and 8 deletions

View File

@@ -210,7 +210,9 @@ ScanfArgTypeResult ScanfSpecifier::getArgType(ASTContext &Ctx) const {
return ArgTypeResult(ArgTypeResult::AnyCharTy);
case LengthModifier::AsShort: return ArgTypeResult(Ctx.ShortTy);
case LengthModifier::AsLong: return ArgTypeResult(Ctx.LongTy);
case LengthModifier::AsLongLong: return ArgTypeResult(Ctx.LongLongTy);
case LengthModifier::AsLongLong:
case LengthModifier::AsQuad:
return ArgTypeResult(Ctx.LongLongTy);
case LengthModifier::AsIntMax:
return ScanfArgTypeResult(Ctx.getIntMaxType(), "intmax_t *");
case LengthModifier::AsSizeT:
@@ -236,6 +238,7 @@ ScanfArgTypeResult ScanfSpecifier::getArgType(ASTContext &Ctx) const {
case LengthModifier::AsShort: return ArgTypeResult(Ctx.UnsignedShortTy);
case LengthModifier::AsLong: return ArgTypeResult(Ctx.UnsignedLongTy);
case LengthModifier::AsLongLong:
case LengthModifier::AsQuad:
return ArgTypeResult(Ctx.UnsignedLongLongTy);
case LengthModifier::AsIntMax:
return ScanfArgTypeResult(Ctx.getUIntMaxType(), "uintmax_t *");