From fad86b003a839cef40ec8ce8408322f4913368ca Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 17 Aug 2008 07:19:36 +0000 Subject: Rework the routines that convert AP[S]Int into a string. Now, instead of returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerSwitch.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/Utils/LowerSwitch.cpp') diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index 630f97c..7409e77 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -144,11 +144,9 @@ BasicBlock* LowerSwitch::switchConvert(CaseItr Begin, CaseItr End, DOUT << "RHS: " << RHS << "\n"; CaseRange& Pivot = *(Begin + Mid); - DEBUG( DOUT << "Pivot ==> " - << cast(Pivot.Low)->getValue().toStringSigned(10) - << " -" - << cast(Pivot.High)->getValue().toStringSigned(10) - << "\n"); + DEBUG(cerr << "Pivot ==> " + << cast(Pivot.Low)->getValue() << " -" + << cast(Pivot.High)->getValue() << "\n"); BasicBlock* LBranch = switchConvert(LHS.begin(), LHS.end(), Val, OrigBlock, Default); -- cgit v1.1