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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to