aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/LEB128.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/LEB128.h')
-rw-r--r--include/llvm/Support/LEB128.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/Support/LEB128.h b/include/llvm/Support/LEB128.h
index 3d7379250af4..ea76c9b58922 100644
--- a/include/llvm/Support/LEB128.h
+++ b/include/llvm/Support/LEB128.h
@@ -77,7 +77,7 @@ inline unsigned encodeULEB128(uint64_t Value, uint8_t *p,
/// Utility function to decode a ULEB128 value.
-inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = 0) {
+inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = nullptr) {
const uint8_t *orig_p = p;
uint64_t Value = 0;
unsigned Shift = 0;
@@ -90,6 +90,12 @@ inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = 0) {
return Value;
}
+/// Utility function to get the size of the ULEB128-encoded value.
+extern unsigned getULEB128Size(uint64_t Value);
+
+/// Utility function to get the size of the SLEB128-encoded value.
+extern unsigned getSLEB128Size(int64_t Value);
+
} // namespace llvm
#endif // LLVM_SYSTEM_LEB128_H