From: Chris Lattner Date: Wed, 19 Nov 2008 07:25:44 +0000 (+0000) Subject: convert some diags to use numbers instead of strings. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8365223e5498255a1285b6bb206f5894fe5b83c6;p=clang convert some diags to use numbers instead of strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59600 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index c9fbdc4cb2..6e8fb6dfd0 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -25,7 +25,6 @@ #include "clang/Lex/Preprocessor.h" #include "clang/Lex/HeaderSearch.h" #include "llvm/ADT/SmallSet.h" -#include "llvm/ADT/StringExtras.h" using namespace clang; Sema::TypeTy *Sema::isTypeName(IdentifierInfo &II, Scope *S, @@ -3150,7 +3149,7 @@ void Sema::ActOnPragmaPack(PragmaPackKind Kind, IdentifierInfo *Name, // FIXME: This should come from the target. if (AlignmentVal == 0) AlignmentVal = 8; - Diag(PragmaLoc, diag::warn_pragma_pack_show, llvm::utostr(AlignmentVal)); + Diag(PragmaLoc, diag::warn_pragma_pack_show) << AlignmentVal; break; case Action::PPK_Push: // pack(push [, id] [, [n]) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 7a94309f64..90d3730f1e 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -20,7 +20,6 @@ #include "clang/Lex/Preprocessor.h" #include "clang/Basic/Diagnostic.h" #include "clang/Parse/DeclSpec.h" -#include "llvm/ADT/StringExtras.h" #include "llvm/Support/Compiler.h" #include // for std::equal #include @@ -1876,10 +1875,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) { (NumParams == 2 && !CanBeBinaryOperator) || (NumParams < 1) || (NumParams > 2))) { // We have the wrong number of parameters. - std::string NumParamsStr = llvm::utostr(NumParams); - diag::kind DK; - if (CanBeUnaryOperator && CanBeBinaryOperator) { if (NumParams == 1) DK = diag::err_operator_overload_must_be_unary_or_binary; @@ -1899,8 +1895,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) { assert(false && "All non-call overloaded operators are unary or binary!"); } - return Diag(FnDecl->getLocation(), DK, - FnDecl->getName(), NumParamsStr); + return Diag(FnDecl->getLocation(), DK) << FnDecl->getName() << NumParams; } // Overloaded operators other than operator() cannot be variadic.