[PATCH] D41774: [GlobalISel] Refactory CallLowering handleAssignments for custom <Target>CCState
Leslie Zhai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 07:10:02 PST 2018
xiangzhai updated this revision to Diff 129277.
xiangzhai added a comment.
Hi LLVM developers,
As Amara suggested, I revert `handleAssignments`, only add `virtual` to be a interface, so it is able to override `handleAssignments` in your <Target>CallLowering to initial your <Target>CCState.
Please review my patch again, thanks a lot!
Regards,
Leslie Zhai
Repository:
rL LLVM
https://reviews.llvm.org/D41774
Files:
include/llvm/CodeGen/GlobalISel/CallLowering.h
Index: include/llvm/CodeGen/GlobalISel/CallLowering.h
===================================================================
--- include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -102,7 +102,8 @@
virtual bool assignArg(unsigned ValNo, MVT ValVT, MVT LocVT,
CCValAssign::LocInfo LocInfo, const ArgInfo &Info,
CCState &State) {
- return AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State);
+ return AssignFn ?
+ AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State) : false;
}
MachineIRBuilder &MIRBuilder;
@@ -126,13 +127,6 @@
void setArgFlags(ArgInfo &Arg, unsigned OpNum, const DataLayout &DL,
const FuncInfoTy &FuncInfo) const;
- /// Invoke Handler::assignArg on each of the given \p Args and then use
- /// \p Callback to move them to the assigned locations.
- ///
- /// \return True if everything has succeeded, false otherwise.
- bool handleAssignments(MachineIRBuilder &MIRBuilder, ArrayRef<ArgInfo> Args,
- ValueHandler &Callback) const;
-
public:
CallLowering(const TargetLowering *TLI) : TLI(TLI) {}
virtual ~CallLowering() = default;
@@ -188,6 +182,14 @@
return false;
}
+ /// Invoke Handler::assignArg on each of the given \p Args and then use
+ /// \p Callback to move them to the assigned locations.
+ ///
+ /// \return True if everything has succeeded, false otherwise.
+ virtual bool handleAssignments(MachineIRBuilder &MIRBuilder,
+ ArrayRef<ArgInfo> Args,
+ ValueHandler &Handler) const;
+
/// Lower the given call instruction, including argument and return value
/// marshalling.
///
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41774.129277.patch
Type: text/x-patch
Size: 1801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180110/e01fb0aa/attachment.bin>
More information about the llvm-commits
mailing list