diff options
author | Igor Kudrin <ikudrin@accesssoftek.com> | 2019-08-07 11:44:47 +0000 |
---|---|---|
committer | Igor Kudrin <ikudrin@accesssoftek.com> | 2019-08-07 11:44:47 +0000 |
commit | 45ee93323ba69b3ad01e9a9a70c6e61d5f9d2df5 (patch) | |
tree | acc32745b6a6237409548f89967f43f4f4897238 /llvm/lib/Support/DataExtractor.cpp | |
parent | 0eafe011cab843adeecc3363bfc4acb37fcd2960 (diff) | |
download | bcm5719-llvm-45ee93323ba69b3ad01e9a9a70c6e61d5f9d2df5.tar.gz bcm5719-llvm-45ee93323ba69b3ad01e9a9a70c6e61d5f9d2df5.zip |
Remove support for 32-bit offsets in utility classes (5/5)
Differential Revision: https://reviews.llvm.org/D65641
llvm-svn: 368156
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)); -} |