summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-05-28 22:49:12 +0000
committerReid Kleckner <reid@kleckner.net>2014-05-28 22:49:12 +0000
commit1d4e8baa9c7f9dfc14156a762d2cd0016ceca034 (patch)
treef4629876d3555555c3f6c56e2c0f3779347d39dc
parentc81cf72ef34bfc846bc9f271f590e8e02e38061b (diff)
downloadllvm-1d4e8baa9c7f9dfc14156a762d2cd0016ceca034.tar.gz
llvm-1d4e8baa9c7f9dfc14156a762d2cd0016ceca034.tar.bz2
llvm-1d4e8baa9c7f9dfc14156a762d2cd0016ceca034.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209777 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/MathExtras.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index f1f7b4feb5..6965faf8df 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -258,6 +258,12 @@ inline uint32_t Lo_32(uint64_t Value) {
return static_cast<uint32_t>(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<unsigned N>
inline bool isInt(int64_t x) {