diff options
Diffstat (limited to 'llvm/lib/Support/DataExtractor.cpp')
-rw-r--r-- | llvm/lib/Support/DataExtractor.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/llvm/lib/Support/DataExtractor.cpp b/llvm/lib/Support/DataExtractor.cpp index 73c215ea05a..1d88ec06151 100644 --- a/llvm/lib/Support/DataExtractor.cpp +++ b/llvm/lib/Support/DataExtractor.cpp @@ -171,88 +171,3 @@ int64_t DataExtractor::getSLEB128(uint64_t *offset_ptr) const { *offset_ptr += bytes_read; return result; } - -// The following is temporary code aimed to preserve compatibility with -// existing code which uses 32-bit offsets. -// It will be removed when migration to 64-bit offsets is finished. - -namespace { - -class WrapOffset { - uint64_t offset64; - uint32_t *offset32_ptr; - -public: - WrapOffset(uint32_t *offset_ptr) - : offset64(*offset_ptr), offset32_ptr(offset_ptr) {} - ~WrapOffset() { *offset32_ptr = offset64; } - operator uint64_t *() { return &offset64; } -}; - -} - -uint8_t DataExtractor::getU8(uint32_t *offset_ptr) const { - return getU8(WrapOffset(offset_ptr)); -} - -uint8_t * -DataExtractor::getU8(uint32_t *offset_ptr, uint8_t *dst, uint32_t count) const { - return getU8(WrapOffset(offset_ptr), dst, count); -} - -uint16_t DataExtractor::getU16(uint32_t *offset_ptr) const { - return getU16(WrapOffset(offset_ptr)); -} - -uint16_t *DataExtractor::getU16(uint32_t *offset_ptr, uint16_t *dst, - uint32_t count) const { - return getU16(WrapOffset(offset_ptr), dst, count); -} - -uint32_t DataExtractor::getU24(uint32_t *offset_ptr) const { - return getU24(WrapOffset(offset_ptr)); -} - -uint32_t DataExtractor::getU32(uint32_t *offset_ptr) const { - return getU32(WrapOffset(offset_ptr)); -} - -uint32_t *DataExtractor::getU32(uint32_t *offset_ptr, uint32_t *dst, - uint32_t count) const { - return getU32(WrapOffset(offset_ptr), dst, count); -} - -uint64_t DataExtractor::getU64(uint32_t *offset_ptr) const { - return getU64(WrapOffset(offset_ptr)); -} - -uint64_t *DataExtractor::getU64(uint32_t *offset_ptr, uint64_t *dst, - uint32_t count) const { - return getU64(WrapOffset(offset_ptr), dst, count); -} - -uint64_t -DataExtractor::getUnsigned(uint32_t *offset_ptr, uint32_t byte_size) const { - return getUnsigned(WrapOffset(offset_ptr), byte_size); -} - -int64_t -DataExtractor::getSigned(uint32_t *offset_ptr, uint32_t byte_size) const { - return getSigned(WrapOffset(offset_ptr), byte_size); -} - -const char *DataExtractor::getCStr(uint32_t *offset_ptr) const { - return getCStr(WrapOffset(offset_ptr)); -} - -StringRef DataExtractor::getCStrRef(uint32_t *offset_ptr) const { - return getCStrRef(WrapOffset(offset_ptr)); -} - -uint64_t DataExtractor::getULEB128(uint32_t *offset_ptr) const { - return getULEB128(WrapOffset(offset_ptr)); -} - -int64_t DataExtractor::getSLEB128(uint32_t *offset_ptr) const { - return getSLEB128(WrapOffset(offset_ptr)); -} |