diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 20:07:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 20:07:03 +0000 |
commit | dddfd34e32ff081409e5a1c95b991a898d63dff2 (patch) | |
tree | 99d6f0c6d2175cc7283589471be5ea11840cbbea /lib/Support | |
parent | 9472a9d6502f943548981955ff36ae6b3c05638b (diff) |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/APInt.cpp | 7 | ||||
-rw-r--r-- | lib/Support/PrettyStackTrace.cpp | 4 |
2 files changed, 6 insertions, 5 deletions
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<char> &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) { diff --git a/lib/Support/PrettyStackTrace.cpp b/lib/Support/PrettyStackTrace.cpp index 536d9b023f..68b41a7f09 100644 --- a/lib/Support/PrettyStackTrace.cpp +++ b/lib/Support/PrettyStackTrace.cpp @@ -71,8 +71,8 @@ static void CrashHandler(void *Cookie) { } if (!TmpStr.empty()) { - __crashreporter_info__ = strdup(TmpStr.c_str()); - errs() << __crashreporter_info__; + __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str()); + errs() << TmpStr.str(); } #endif |