[PATCH] D15075: No error for conflict between inputs\outputs and clobber list
Ziv Izhar via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 18 08:21:43 PDT 2016
zizhar added a comment.
Akira,
You've mentioned a good point, this X86 logic should indeed be moved to X86TargetInfo.
The current convertConstraint() implementation is not doing what I need – it doesn’t handle all the input/output constraints I need, and it returns the constraint in a different format than the one I need.
E.g. convertConstraint() does not handle “r” constraints or special characters like “=”, “+”, also, the function returns the registers as “{ax}”, when I need the “ax”.
I think it is better to add a new function for my logic instead of trying to adjust this function to handle both its old logic and my new logic.
My new solution is going to be to create another virtual function in TargetInfo that will do everything I need.
The code that is currently under GetConstraintRegister() and ExtractRegisterName() will now be part of the X86TargetInfo implementation of this virtual function.
For all the other architectures’ TargetInfos I’ll create a default implementation that will return an empty string and they can implement it if they want to (until they do, the existing behavior will be retained).
Can I have your opinion on this? Do you see a better way to implement this?
Thanks,
Ziv Izhar.
https://reviews.llvm.org/D15075
More information about the cfe-commits
mailing list