mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 02:31:09 +00:00
parenthesize symbol names that start with $, fixing X86/dollar-name.ll with
the new asmprinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8429837a94
commit
d50c2b9064
@ -20,9 +20,20 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
|
|||||||
OS << cast<MCConstantExpr>(*this).getValue();
|
OS << cast<MCConstantExpr>(*this).getValue();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MCExpr::SymbolRef:
|
case MCExpr::SymbolRef: {
|
||||||
cast<MCSymbolRefExpr>(*this).getSymbol().print(OS, MAI);
|
const MCSymbol &Sym = cast<MCSymbolRefExpr>(*this).getSymbol();
|
||||||
|
|
||||||
|
// Parenthesize names that start with $ so that they don't look like
|
||||||
|
// absolute names.
|
||||||
|
if (Sym.getName()[0] == '$') {
|
||||||
|
OS << '(';
|
||||||
|
Sym.print(OS, MAI);
|
||||||
|
OS << ')';
|
||||||
|
} else {
|
||||||
|
Sym.print(OS, MAI);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
case MCExpr::Unary: {
|
case MCExpr::Unary: {
|
||||||
const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
|
const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user