From ffe31d7bf1e070650b0ff9ebfac815ea172a82bb Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sat, 16 Aug 2008 12:57:46 +0000 Subject: Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54843 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'lib/CodeGen/AsmPrinter.cpp') diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index b01ae7d6b5..16f26c4299 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -493,23 +493,12 @@ void AsmPrinter::PrintULEB128(unsigned Value) const { } while (Value); } -/// SizeULEB128 - Compute the number of bytes required for an unsigned leb128 -/// value. -unsigned AsmPrinter::SizeULEB128(unsigned Value) { - unsigned Size = 0; - do { - Value >>= 7; - Size += sizeof(int8_t); - } while (Value); - return Size; -} - /// PrintSLEB128 - Print a series of hexidecimal values (separated by commas) /// representing a signed leb128 value. void AsmPrinter::PrintSLEB128(int Value) const { int Sign = Value >> (8 * sizeof(Value) - 1); bool IsMore; - + do { unsigned Byte = Value & 0x7f; Value >>= 7; @@ -520,22 +509,6 @@ void AsmPrinter::PrintSLEB128(int Value) const { } while (IsMore); } -/// SizeSLEB128 - Compute the number of bytes required for a signed leb128 -/// value. -unsigned AsmPrinter::SizeSLEB128(int Value) { - unsigned Size = 0; - int Sign = Value >> (8 * sizeof(Value) - 1); - bool IsMore; - - do { - unsigned Byte = Value & 0x7f; - Value >>= 7; - IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; - Size += sizeof(int8_t); - } while (IsMore); - return Size; -} - //===--------------------------------------------------------------------===// // Emission and print routines // -- cgit v1.2.3-70-g09d2