[PATCH] D41774: [GlobalISel] Refactory CallLowering handleAssignments for custom <Target>CCState

Leslie Zhai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 17:26:27 PST 2018


xiangzhai added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/CallLowering.h:105
                            CCState &State) {
-      return AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State);
+      return AssignFn ?
+          AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State) : false;
----------------
> Pass a dummy AssignFn to the ValueHandler constructor and override
ValueHandler::assignArg

As [Alex suggested](http://lists.llvm.org/pipermail/llvm-dev/2017-December/120002.html), I pass a `nullptr` AssignFn for making immediate progress firstly in D41653, but we will change approach prior in D41700.

Please give me some suggestion about  this change, thanks for your teaching!


================
Comment at: include/llvm/CodeGen/GlobalISel/CallLowering.h:189
+  /// \return True if everything has succeeded, false otherwise.
+  virtual bool handleAssignments(MachineIRBuilder &MIRBuilder,
+                                 ArrayRef<ArgInfo> Args,
----------------
aemerson wrote:
> Why move the implementation to the header?
Hi Amara,

Thanks for your review!

I just want to keep coding style, so I move the implementation of a Interface, defined as virtual function, to the header file. I also put the implementation of Graph Coloring all in header files https://github.com/xiangzhai/llvm/tree/riscv/include/llvm/CodeGen/GCol

I will revert the implementation back to source file, if not LGTU :)

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D41774





More information about the llvm-commits mailing list