[Lldb-commits] [lldb] [lldb] Add a single bit constructor for RegisterFlags::Field (PR #69315)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 18 03:30:28 PDT 2023


================
@@ -17,11 +17,17 @@ class RegisterFlags {
 public:
   class Field {
   public:
+    /// Where start is the least significant bit and end is the most
+    /// significant bit. The start bit must be <= the end bit.
     Field(std::string name, unsigned start, unsigned end)
         : m_name(std::move(name)), m_start(start), m_end(end) {
       assert(m_start <= m_end && "Start bit must be <= end bit.");
     }
 
+    /// Construct a single bit field.
+    Field(std::string name, unsigned bit)
+        : m_name(std::move(name)), m_start(bit), m_end(bit) {}
----------------
DavidSpickett wrote:

Also it does read like "a single bitfield" instead of "a single bit field" doesn't it, I'll make it more obvious.

https://github.com/llvm/llvm-project/pull/69315


More information about the lldb-commits mailing list