From dddfd34e32ff081409e5a1c95b991a898d63dff2 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 19 Aug 2009 20:07:03 +0000 Subject: Switch to SmallString::str from SmallString::c_str, and remove SmallString::c_str. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79456 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APInt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Support/APInt.cpp') diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index e352b630ce..4e9ee3402b 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -2168,7 +2168,7 @@ void APInt::toString(SmallVectorImpl &Str, unsigned Radix, std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { SmallString<40> S; toString(S, Radix, Signed); - return S.c_str(); + return S.str(); } @@ -2176,13 +2176,14 @@ void APInt::dump() const { SmallString<40> S, U; this->toStringUnsigned(U); this->toStringSigned(S); - fprintf(stderr, "APInt(%db, %su %ss)", BitWidth, U.c_str(), S.c_str()); + errs() << "APInt(" << BitWidth << "b, " + << U.str() << "u " << S.str() << "s)"; } void APInt::print(raw_ostream &OS, bool isSigned) const { SmallString<40> S; this->toString(S, 10, isSigned); - OS << S.c_str(); + OS << S.str(); } std::ostream &llvm::operator<<(std::ostream &o, const APInt &I) { -- cgit v1.2.3-18-g5258