[PATCH] D39016: Add Percent Symbol In PPC Registers for Linux

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 14:36:14 PDT 2017


joerg added inline comments.


================
Comment at: lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp:534
+    if (!TripleInfo.isOSDarwin()) {
+        if (showRegistersWithPercentPrefix(RegName)) {
+            // Print register with percent symbol and prefix.
----------------
alexandreyy wrote:
> joerg wrote:
> > I said make it a member function because the knowledge that Darwin doesn't get the percent should be part of it, not external...
> If the OS is Darwin, the register name can't be stripped too.
> So, We need to check the OS in the external function printOperand.
> 
> Or I can not strip the register prefix in stripRegisterPrefix if the OS is Darwin.
> 
> What do you think it is better?
That's why I suggested to keep things separate and simple. First just decide if the '%' prefix is desired; afterwards, decide whether the register name should be stripped. Keeping the decisions separate makes the flow easier. They will become less entangled in the future too.

I haven't really made up my mind on whether supporting the AIX flavor long term is desirable, I let others shim in on that. But that's a separate follow-up. 


https://reviews.llvm.org/D39016





More information about the llvm-commits mailing list