mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
parenthesize symbol names that start with $, fixing X86/dollar-name.ll with
the new asmprinter. llvm-svn: 81269
This commit is contained in:
parent
840fbf6897
commit
77fdd07c93
@ -20,9 +20,20 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
|
||||
OS << cast<MCConstantExpr>(*this).getValue();
|
||||
return;
|
||||
|
||||
case MCExpr::SymbolRef:
|
||||
cast<MCSymbolRefExpr>(*this).getSymbol().print(OS, MAI);
|
||||
case MCExpr::SymbolRef: {
|
||||
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;
|
||||
}
|
||||
|
||||
case MCExpr::Unary: {
|
||||
const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
|
||||
|
Loading…
Reference in New Issue
Block a user