[Lldb-commits] [lldb] [LLDB] Add bit extraction to DIL (PR #141422)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu May 29 00:56:37 PDT 2025
https://github.com/labath approved this pull request.
A straight-forward patch. I have one comment, but that's really a problem with the previous PR, so it'd be better to handle that separately.
The interesting (and very tricky) question is what to do about this feature in the long run, as it conflicts with the usage of `-` for subtraction (which, I assume, you're still interested in implementing).
Options I see are:
- treat `-` inside `[]` specially. I'm not particularly fond of that as one may legitimately want to use subtraction in an indexing expression. We could work around that by forcing you to write `foo[(a-b)]`, but I think people would forget that most of the time.
- replace `-` with another character -- probably `:` which is the "standard" syntax for array slicing and should not conflict with other language features
- drop it altogether as this could be implemented via bitwise operations (`(foo>>a)&((1<<b)-1)`) -- once they're implemented
For the last two, we would probably need some sort of a transitionary period where we accept the existing syntax, depending how much use does this feature get (personally, this is the first time I've seen it).
I'm sure @jimingham will have something to say about this. :)
https://github.com/llvm/llvm-project/pull/141422
More information about the lldb-commits
mailing list