This is an archive of the discontinued LLVM Phabricator instance.

Change TII isCopyInstr way of returning arguments(NFC)
ClosedPublic

Authored by NikolaPrica on May 25 2018, 2:57 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

NikolaPrica created this revision.May 25 2018, 2:57 AM
arsenm added a subscriber: arsenm.Jun 5 2018, 2:27 AM

Why? This looks worse to me

Yes. I agree. It would look prettier with reference. But we can't construct default MachineOperand like "MachineOperand MO;" and pass it to this isCopyInstr. We could construct it like "MachineOperand MO = MachineInstr::CreateReg();" but that is unnecessary object construction. Better way would be without need for object construction. Is my reasoning correct or am I missing something?

arsenm added a comment.Jun 5 2018, 6:44 AM

Yes. I agree. It would look prettier with reference. But we can't construct default MachineOperand like "MachineOperand MO;" and pass it to this isCopyInstr. We could construct it like "MachineOperand MO = MachineInstr::CreateReg();" but that is unnecessary object construction. Better way would be without need for object construction. Is my reasoning correct or am I missing something?

I would expect this to be a reference to pointer, not a pointer to pointer

Updated isCopyInstr to take pointer to reference of MachineOperand.

arsenm accepted this revision.Jun 5 2018, 10:42 AM

LGTM

This revision is now accepted and ready to land.Jun 5 2018, 10:42 AM
This revision was automatically updated to reflect the committed changes.