[PowerPC] Avoid using '$' in generated assembler code
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 May 2013 19:53:04 +0000 (19:53 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 3 May 2013 19:53:04 +0000 (19:53 +0000)
PowerPC assemblers are supposed to support a stand-alone '$' symbol
as an alternative of '.' to refer to the current PC.  This does not
work in the LLVM assembler parser yet.

To avoid bootstrap failures when using the LLVM assembler as system
assembler, this patch modifies the assembler source code generated
by LLVM to avoid using '$' (and simply use '.' instead).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181054 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp

index bacc108c62b4260923f8fd64473d1c36d93d3546..93fca00cca495af118a9a0fb4421c531d2b0c950 100644 (file)
@@ -151,8 +151,8 @@ void PPCInstPrinter::printBranchOperand(const MCInst *MI, unsigned OpNo,
     return printOperand(MI, OpNo, O);
 
   // Branches can take an immediate operand.  This is used by the branch
-  // selection pass to print $+8, an eight byte displacement from the PC.
-  O << "$+";
+  // selection pass to print .+8, an eight byte displacement from the PC.
+  O << ".+";
   printAbsAddrOperand(MI, OpNo, O);
 }