summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-08-16 12:57:46 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-08-16 12:57:46 +0000
commitbd890b1fafa6cacab188c9d72af6f55a0147dd49 (patch)
treef167fd7000c17242f00b1c2eb681947360c4bcf2 /llvm/lib/CodeGen/AsmPrinter.cpp
parent44b4a9a05d601cd6d91041d6f5a284293b43e43e (diff)
downloadbcm5719-llvm-bd890b1fafa6cacab188c9d72af6f55a0147dd49.tar.gz
bcm5719-llvm-bd890b1fafa6cacab188c9d72af6f55a0147dd49.zip
Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free.
llvm-svn: 54843
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index b01ae7d6b58..16f26c42992 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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
//
OpenPOWER on IntegriCloud