summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/InstructionUtils.h
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-02-04 23:02:47 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-02-04 23:02:47 +0000
commitea745e86c86df6ac2fbb6776adbc4ff5af06bf96 (patch)
treea2a8b2a159847dba97c823d0a069b1d5dcca1e27 /lldb/source/Plugins/Process/Utility/InstructionUtils.h
parent79042b3e93c5eabbaccfec4af3c3bbbe3667ea1e (diff)
downloadbcm5719-llvm-ea745e86c86df6ac2fbb6776adbc4ff5af06bf96.tar.gz
bcm5719-llvm-ea745e86c86df6ac2fbb6776adbc4ff5af06bf96.zip
Add a utility class ITSession to maintain the ITState for the Thumb ISA.
llvm-svn: 124906
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/InstructionUtils.h')
-rw-r--r--lldb/source/Plugins/Process/Utility/InstructionUtils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Utility/InstructionUtils.h b/lldb/source/Plugins/Process/Utility/InstructionUtils.h
index 1dc3febb866..8ed2a71e36c 100644
--- a/lldb/source/Plugins/Process/Utility/InstructionUtils.h
+++ b/lldb/source/Plugins/Process/Utility/InstructionUtils.h
@@ -21,6 +21,15 @@ Bits32 (const uint32_t value, const uint32_t msbit, const uint32_t lsbit)
return (value >> lsbit) & ((1u << (msbit - lsbit + 1)) - 1);
}
+static inline void
+SetBits32(uint32_t &bits, unsigned msbit, unsigned lsbit, unsigned val)
+{
+ assert(msbit < 32 && lsbit < 32 && msbit >= lsbit);
+ uint32_t mask = ((1 << (msbit - lsbit + 1)) - 1);
+ bits &= ~(mask << lsbit);
+ bits |= (val & mask) << lsbit;
+}
+
// Create a mask that starts at bit zero and includes "bit"
static inline uint64_t
MaskUpToBit (const uint64_t bit)
OpenPOWER on IntegriCloud