From 9aa77f137b9b368f5bf46e2ab7bc7bd1d5755a5b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 17 Aug 2008 07:19:51 +0000 Subject: [PATCH] various updates to match r54873 on mainline. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54874 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/BugReporter.cpp | 2 +- lib/Analysis/GRState.cpp | 4 ++-- lib/Analysis/RValues.cpp | 7 +++---- lib/Lex/PPExpressions.cpp | 6 ++++-- lib/Sema/SemaDecl.cpp | 2 +- lib/Sema/SemaStmt.cpp | 10 +++++----- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index 5002ed6f74..a51f9fb335 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -537,7 +537,7 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, continue; } - os << V.toString(); + os << V; } os << ":' at line " diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp index f8725470c0..cd81c57f90 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Analysis/GRState.cpp @@ -299,7 +299,7 @@ void GRState::print(std::ostream& Out, Printer** Beg, Printer** End, for (ConstEqTy::iterator I = CE.begin(), E = CE.end(); I!=E; ++I) Out << nl << " $" << I.getKey() - << " : " << I.getData()->toString(); + << " : " << *I.getData(); } // Print != constraints. @@ -320,7 +320,7 @@ void GRState::print(std::ostream& Out, Printer** Beg, Printer** End, if (isFirst) isFirst = false; else Out << ", "; - Out << (*J)->toString(); + Out << *J; } } } diff --git a/lib/Analysis/RValues.cpp b/lib/Analysis/RValues.cpp index a396622123..b372ab3831 100644 --- a/lib/Analysis/RValues.cpp +++ b/lib/Analysis/RValues.cpp @@ -352,7 +352,7 @@ void NonLVal::print(std::ostream& Out) const { switch (getSubKind()) { case nonlval::ConcreteIntKind: - Out << cast(this)->getValue().toString(); + Out << cast(this)->getValue(); if (cast(this)->getValue().isUnsigned()) Out << 'U'; @@ -369,7 +369,7 @@ void NonLVal::print(std::ostream& Out) const { Out << '$' << C.getConstraint().getSymbol() << ' '; printOpcode(Out, C.getConstraint().getOpcode()); - Out << ' ' << C.getConstraint().getInt().toString(); + Out << ' ' << C.getConstraint().getInt(); if (C.getConstraint().getInt().isUnsigned()) Out << 'U'; @@ -395,8 +395,7 @@ void LVal::print(std::ostream& Out) const { switch (getSubKind()) { case lval::ConcreteIntKind: - Out << cast(this)->getValue().toString() - << " (LVal)"; + Out << cast(this)->getValue() << " (LVal)"; break; case lval::SymbolValKind: diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index c0499fac14..4042604391 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -470,11 +470,13 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, if (ValueLive && Res.isUnsigned()) { if (!LHS.isUnsigned() && LHS.Val.isNegative()) PP.Diag(OpLoc, diag::warn_pp_convert_lhs_to_positive, - LHS.Val.toStringSigned() + " to "+LHS.Val.toStringUnsigned(), + LHS.Val.toString(10, true) + " to " + + LHS.Val.toString(10, false), LHS.getRange(), RHS.getRange()); if (!RHS.isUnsigned() && RHS.Val.isNegative()) PP.Diag(OpLoc, diag::warn_pp_convert_rhs_to_positive, - RHS.Val.toStringSigned() + " to "+RHS.Val.toStringUnsigned(), + RHS.Val.toString(10, true) + " to " + + RHS.Val.toString(10, false), LHS.getRange(), RHS.getRange()); } LHS.Val.setIsUnsigned(Res.isUnsigned()); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a069460919..906255e87f 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2252,7 +2252,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX, V.extend(InitVal.getBitWidth()); if (V != InitVal) Diag(ECD->getLocation(), diag::ext_enum_value_not_int, - InitVal.toString()); + InitVal.toString(10)); } // Keep track of the size of positive and negative values. diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index abc7f8865a..6bc6f3fb0c 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -229,7 +229,7 @@ void Sema::ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &Val, // If the input was signed and negative and the output is unsigned, // warn. if (!NewSign && OldVal.isSigned() && OldVal.isNegative()) - Diag(Loc, DiagID, OldVal.toString(), Val.toString()); + Diag(Loc, DiagID, OldVal.toString(10), Val.toString(10)); Val.setIsSigned(NewSign); } else if (NewWidth < Val.getBitWidth()) { @@ -240,7 +240,7 @@ void Sema::ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &Val, ConvVal.extend(Val.getBitWidth()); ConvVal.setIsSigned(Val.isSigned()); if (ConvVal != Val) - Diag(Loc, DiagID, Val.toString(), ConvVal.toString()); + Diag(Loc, DiagID, Val.toString(10), ConvVal.toString(10)); // Regardless of whether a diagnostic was emitted, really do the // truncation. @@ -253,7 +253,7 @@ void Sema::ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &Val, Val.setIsSigned(NewSign); if (Val.isNegative()) // Sign bit changes meaning. - Diag(Loc, DiagID, OldVal.toString(), Val.toString()); + Diag(Loc, DiagID, OldVal.toString(10), Val.toString(10)); } } @@ -376,7 +376,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch, if (CaseVals[i].first == CaseVals[i+1].first) { // If we have a duplicate, report it. Diag(CaseVals[i+1].second->getLHS()->getLocStart(), - diag::err_duplicate_case, CaseVals[i].first.toString()); + diag::err_duplicate_case, CaseVals[i].first.toString(10)); Diag(CaseVals[i].second->getLHS()->getLocStart(), diag::err_duplicate_case_prev); // FIXME: We really want to remove the bogus case stmt from the substmt, @@ -460,7 +460,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch, if (OverlapStmt) { // If we have a duplicate, report it. Diag(CR->getLHS()->getLocStart(), - diag::err_duplicate_case, OverlapVal.toString()); + diag::err_duplicate_case, OverlapVal.toString(10)); Diag(OverlapStmt->getLHS()->getLocStart(), diag::err_duplicate_case_prev); // FIXME: We really want to remove the bogus case stmt from the substmt, -- 2.40.0