From 17f7165f849c17004b37b6db02b91d80cecb1855 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. llvm-svn: 54873 --- llvm/lib/Support/ConstantRange.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Support/ConstantRange.cpp') diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index 0d22b323502..9c83b7c59de 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/lib/Support/ConstantRange.cpp @@ -463,8 +463,7 @@ ConstantRange ConstantRange::truncate(uint32_t DstTySize) const { /// print - Print out the bounds to a stream... /// void ConstantRange::print(std::ostream &OS) const { - OS << "[" << Lower.toStringSigned(10) << "," - << Upper.toStringSigned(10) << ")"; + OS << "[" << Lower << "," << Upper << ")"; } /// dump - Allow printing from a debugger easily... -- cgit v1.2.3