[cfe-commits] r59600 - in /cfe/trunk/lib/Sema: SemaDecl.cpp SemaDeclCXX.cpp
Chris Lattner
sabre at nondot.org
Tue Nov 18 23:25:44 PST 2008
Author: lattner
Date: Wed Nov 19 01:25:44 2008
New Revision: 59600
URL: http://llvm.org/viewvc/llvm-project?rev=59600&view=rev
Log:
convert some diags to use numbers instead of strings.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=59600&r1=59599&r2=59600&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Nov 19 01:25:44 2008
@@ -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 @@
// 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])
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=59600&r1=59599&r2=59600&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Nov 19 01:25:44 2008
@@ -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 <algorithm> // for std::equal
#include <map>
@@ -1876,10 +1875,7 @@
(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 @@
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.
More information about the cfe-commits
mailing list