summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-19 20:07:03 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-19 20:07:03 +0000
commit8b0b11582d1b6f8ec886aa752832625f77703e70 (patch)
treecf6746dc22fe74dfdd635c2c6c8d35a5ea010777 /llvm/lib/Support/APInt.cpp
parent58bc48c14ec63fae254d6bb0986e5802fdf94513 (diff)
downloadbcm5719-llvm-8b0b11582d1b6f8ec886aa752832625f77703e70.tar.gz
bcm5719-llvm-8b0b11582d1b6f8ec886aa752832625f77703e70.zip
Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str. llvm-svn: 79456
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index e352b630ce4..4e9ee3402b3 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud