Rename analyze_format_string::ArgTypeResult to ArgType
Also remove redundant constructors and unused member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161403 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index f9c993b..e699f00 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -2271,7 +2271,7 @@
const analyze_printf::OptionalFlag &ignoredFlag,
const analyze_printf::OptionalFlag &flag,
const char *startSpecifier, unsigned specifierLen);
- bool checkForCStrMembers(const analyze_printf::ArgTypeResult &ATR,
+ bool checkForCStrMembers(const analyze_printf::ArgType &AT,
const Expr *E, const CharSourceRange &CSR);
};
@@ -2320,12 +2320,12 @@
QualType T = Arg->getType();
- const analyze_printf::ArgTypeResult &ATR = Amt.getArgType(S.Context);
- assert(ATR.isValid());
+ const analyze_printf::ArgType &AT = Amt.getArgType(S.Context);
+ assert(AT.isValid());
- if (!ATR.matchesType(S.Context, T)) {
+ if (!AT.matchesType(S.Context, T)) {
EmitFormatDiagnostic(S.PDiag(diag::warn_printf_asterisk_wrong_type)
- << k << ATR.getRepresentativeTypeName(S.Context)
+ << k << AT.getRepresentativeTypeName(S.Context)
<< T << Arg->getSourceRange(),
getLocationOfByte(Amt.getStart()),
/*IsStringLocation*/true,
@@ -2424,10 +2424,10 @@
}
// Check if a (w)string was passed when a (w)char* was needed, and offer a
-// better diagnostic if so. ATR is assumed to be valid.
+// better diagnostic if so. AT is assumed to be valid.
// Returns true when a c_str() conversion method is found.
bool CheckPrintfHandler::checkForCStrMembers(
- const analyze_printf::ArgTypeResult &ATR, const Expr *E,
+ const analyze_printf::ArgType &AT, const Expr *E,
const CharSourceRange &CSR) {
typedef llvm::SmallPtrSet<CXXMethodDecl*, 1> MethodSet;
@@ -2438,7 +2438,7 @@
MI != ME; ++MI) {
const CXXMethodDecl *Method = *MI;
if (Method->getNumParams() == 0 &&
- ATR.matchesType(S.Context, Method->getResultType())) {
+ AT.matchesType(S.Context, Method->getResultType())) {
// FIXME: Suggest parens if the expression needs them.
SourceLocation EndLoc =
S.getPreprocessor().getLocForEndOfToken(E->getLocEnd());
@@ -2584,9 +2584,9 @@
using namespace analyze_printf;
// Now type check the data expression that matches the
// format specifier.
- const analyze_printf::ArgTypeResult &ATR = FS.getArgType(S.Context,
- ObjCContext);
- if (ATR.isValid() && !ATR.matchesType(S.Context, E->getType())) {
+ const analyze_printf::ArgType &AT = FS.getArgType(S.Context,
+ ObjCContext);
+ if (AT.isValid() && !AT.matchesType(S.Context, E->getType())) {
// Look through argument promotions for our error message's reported type.
// This includes the integral and floating promotions, but excludes array
// and function pointer decay; seeing that an argument intended to be a
@@ -2602,7 +2602,7 @@
if (ICE->getType() == S.Context.IntTy ||
ICE->getType() == S.Context.UnsignedIntTy) {
// All further checking is done on the subexpression.
- if (ATR.matchesType(S.Context, E->getType()))
+ if (AT.matchesType(S.Context, E->getType()))
return true;
}
}
@@ -2621,7 +2621,7 @@
EmitFormatDiagnostic(
S.PDiag(diag::warn_printf_conversion_argument_type_mismatch)
- << ATR.getRepresentativeTypeName(S.Context) << E->getType()
+ << AT.getRepresentativeTypeName(S.Context) << E->getType()
<< E->getSourceRange(),
E->getLocStart(),
/*IsStringLocation*/false,
@@ -2647,16 +2647,16 @@
<< S.getLangOpts().CPlusPlus0x
<< E->getType()
<< CallType
- << ATR.getRepresentativeTypeName(S.Context)
+ << AT.getRepresentativeTypeName(S.Context)
<< CSR
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/false, CSR);
- checkForCStrMembers(ATR, E, CSR);
+ checkForCStrMembers(AT, E, CSR);
} else
EmitFormatDiagnostic(
S.PDiag(diag::warn_printf_conversion_argument_type_mismatch)
- << ATR.getRepresentativeTypeName(S.Context) << E->getType()
+ << AT.getRepresentativeTypeName(S.Context) << E->getType()
<< CSR
<< E->getSourceRange(),
E->getLocStart(), /*IsStringLocation*/false, CSR);
@@ -2800,7 +2800,7 @@
if (!Ex)
return true;
- const analyze_scanf::ScanfArgTypeResult &ATR = FS.getArgType(S.Context);
+ const analyze_scanf::ScanfArgType &ATR = FS.getArgType(S.Context);
if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) {
ScanfSpecifier fixedFS = FS;
bool success = fixedFS.fixType(Ex->getType(), S.getLangOpts(),