[PATCH] D54846: [CodeGen][NFC] Make `TII::getMemOpBaseImmOfs` return a base operand

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 10:21:00 PST 2018


thegameg marked 2 inline comments as done.
thegameg added inline comments.


================
Comment at: lib/Target/Hexagon/HexagonInstrInfo.cpp:3143
+    return nullptr;
+  return &const_cast<MachineOperand&>(BaseOp);
 }
----------------
sdesmalen wrote:
> Maybe I missed something in the uses of this function, but I think you can just return a `const MachineOperand *` here? (thus not needing the const_cast)
Since this is used to return the base in `getMemOperandWithOffset`, we would need to make `BaseOp` const there too. Which brings us to the previous comment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54846/new/

https://reviews.llvm.org/D54846





More information about the llvm-commits mailing list