From c316e0fc25140917e73713b338db912ac080c532 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 28 May 2014 22:49:12 +0000 Subject: [PATCH] Add a simple helper function to create a 64-bit integer. Add a function to combine two 32-bit integers into a 64-bit integer. There are no calls to this function yet, although a subsequent change will add some in LLDB. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D3941 llvm-svn: 209777 --- llvm/include/llvm/Support/MathExtras.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index f1f7b4feb580..6965faf8df8b 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -258,6 +258,12 @@ inline uint32_t Lo_32(uint64_t Value) { return static_cast(Value); } +/// Make_64 - This functions makes a 64-bit integer from a high / low pair of +/// 32-bit integers. +inline uint64_t Make_64(uint32_t High, uint32_t Low) { + return ((uint64_t)High << 32) | (uint64_t)Low; +} + /// isInt - Checks if an integer fits into the given bit width. template inline bool isInt(int64_t x) {