diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-02-04 23:02:47 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-02-04 23:02:47 +0000 |
commit | ea745e86c86df6ac2fbb6776adbc4ff5af06bf96 (patch) | |
tree | a2a8b2a159847dba97c823d0a069b1d5dcca1e27 /lldb/source/Plugins/Process | |
parent | 79042b3e93c5eabbaccfec4af3c3bbbe3667ea1e (diff) | |
download | bcm5719-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')
-rw-r--r-- | lldb/source/Plugins/Process/Utility/InstructionUtils.h | 9 |
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) |