Skip to content

Commit

Permalink
Revert "[NVPTX] Disable parens for identifiers starting with '$'"
Browse files Browse the repository at this point in the history
This reverts commit 78d70a1.

Failed on Mips32:
https://lab.llvm.org/buildbot#builders/109/builds/36628

   # CHECK: # fixup A - offset: 0, value: ($tmp0), kind: fixup_Mips_26
   <stdin>:580:2: note: possible intended match here
   # fixup A - offset: 0, value: $tmp0, kind: fixup_Mips_26
  • Loading branch information
asavonic committed Apr 14, 2022
1 parent 664c111 commit 5193f2a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 28 deletions.
7 changes: 0 additions & 7 deletions llvm/include/llvm/MC/MCAsmInfo.h
Expand Up @@ -478,10 +478,6 @@ class MCAsmInfo {
/// For example, foo(plt) instead of foo@plt. Defaults to false.
bool UseParensForSymbolVariant = false;

/// True if the target uses parens for symbol names starting with
/// '$' character to distinguish them from absolute names.
bool UseParensForDollarSignNames = true;

/// True if the target supports flags in ".loc" directive, false if only
/// location is allowed.
bool SupportsExtendedDwarfLocDirective = true;
Expand Down Expand Up @@ -793,9 +789,6 @@ class MCAsmInfo {
bool doDwarfFDESymbolsUseAbsDiff() const { return DwarfFDESymbolsUseAbsDiff; }
bool useDwarfRegNumForCFI() const { return DwarfRegNumForCFI; }
bool useParensForSymbolVariant() const { return UseParensForSymbolVariant; }
bool useParensForDollarSignNames() const {
return UseParensForDollarSignNames;
}
bool supportsExtendedDwarfLocDirective() const {
return SupportsExtendedDwarfLocDirective;
}
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/MC/MCExpr.cpp
Expand Up @@ -75,9 +75,8 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens) const {
const MCSymbol &Sym = SRE.getSymbol();
// Parenthesize names that start with $ so that they don't look like
// absolute names.
bool UseParens = MAI && MAI->useParensForDollarSignNames() && !InParens &&
!Sym.getName().empty() && Sym.getName()[0] == '$';

bool UseParens =
!InParens && !Sym.getName().empty() && Sym.getName()[0] == '$';
if (UseParens) {
OS << '(';
Sym.print(OS, MAI);
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
Expand Up @@ -54,8 +54,4 @@ NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple,
GlobalDirective = "\t// .globl\t";

UseIntegratedAssembler = false;

// Avoid using parens for identifiers starting with $ - ptxas does
// not expect them.
UseParensForDollarSignNames = false;
}
14 changes: 0 additions & 14 deletions llvm/test/CodeGen/NVPTX/no-extra-parens.ll

This file was deleted.

0 comments on commit 5193f2a

Please sign in to comment.