[llvm] [feature][riscv] handle target address calculation in llvm-objdump disassembly for riscv (PR #109914)
Arjun Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 13:23:57 PDT 2025
================
@@ -327,8 +414,12 @@ class RISCVMCInstrAnalysis : public MCInstrAnalysis {
} // end anonymous namespace
-static MCInstrAnalysis *createRISCVInstrAnalysis(const MCInstrInfo *Info) {
- return new RISCVMCInstrAnalysis(Info);
+static MCInstrAnalysis *createRISCV32InstrAnalysis(const MCInstrInfo *Info) {
----------------
arjunUpatel wrote:
I think the best way to do this is to make the subtarget info a member of the parent class `MCInstrAnalysis`. The subtarget info is also used by other member functions, notably `findPltEntries`. All the uses of subtarget info seem to be static across all the member functions that need this information, that is, it does not change in subsequent calls to these functions in a given invocation. As such, it makes sense to tie it to the parent class so it is set once and referenced when needed versus continuously being passed as an argument even if it never changes. For the sake of keeping this PR relevant perhaps we can pass the subtarget info as an argument to `evaluateInstruction` for now so that it matches the implementation of `findPltEntries` and how the subtarget info is threaded in can be updated in a follow up PR?
https://github.com/llvm/llvm-project/pull/109914
More information about the llvm-commits
mailing list