[Lldb-commits] [PATCH] D156086: [lldb][NFC] Use MCInstrAnalysis when available in the disassembler plugin
Venkata Ramanaiah Nalamothu via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 26 19:45:10 PDT 2023
RamNalamothu added a comment.
In D156086#4536992 <https://reviews.llvm.org/D156086#4536992>, @jasonmolenda wrote:
> In D156086#4530507 <https://reviews.llvm.org/D156086#4530507>, @RamNalamothu wrote:
>
>> In D156086#4529791 <https://reviews.llvm.org/D156086#4529791>, @jasonmolenda wrote:
>>
>>>
>
>
>
>>> Does `isBranch` include other variants like `isUnconditionalBranch`?
>>
>> No. They are implemented as separate methods. You can see that with a full context diff of MCInstrAnalysis.h changes in this revision or MCInstrAnalysis.h <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/MC/MCInstrAnalysis.h>
>
> `mayAffectControlFlow` doesn't test for `isUnconditionalBranch`. Is that a problem? I didn't look through the different property check methods like this, but I happened to notice this one and see it wasn't detected in `mayAffectControlFlow`. Maybe I misunderstood something.
The idea is MCInstrAnalysis's default implementation just replicates what MCInstrDesc does (MCInstrDesc::mayAffectControlFlow <https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCInstrDesc.cpp#L20>) and the individual targets can refine those methods as needed.
In D156086#4537284 <https://reviews.llvm.org/D156086#4537284>, @MaskRay wrote:
> It seems that a lldb specific test is needed. Adding a new method to `llvm/include/llvm/MC/MCInstrAnalysis.h` is fine with me, though I haven't checked the semantics.
I will try to add a lldb specific test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156086/new/
https://reviews.llvm.org/D156086
More information about the lldb-commits
mailing list