diff options
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index f9c993beb1..e699f00479 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2271,7 +2271,7 @@ public: 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 @@ bool CheckPrintfHandler::HandleAmount( 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 @@ CXXRecordMembersNamed(StringRef Name, Sema &S, QualType Ty) { } // 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 @@ bool CheckPrintfHandler::checkForCStrMembers( 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 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, 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 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, 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 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, 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 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, << 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 @@ bool CheckScanfHandler::HandleScanfSpecifier( 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(), |