Skip to content

Commit c8f05b1

Browse files
committed
Update MipsAsmParser.cpp
1 parent 43d59de commit c8f05b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- MipsAsmParser.cpp - Parse Mips assembly to MCInst instructions ----===//
1+
///===-- MipsAsmParser.cpp - Parse Mips assembly to MCInst instructions ----===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -2920,11 +2920,11 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
29202920
(Res.getSymA()->getSymbol().isELF() &&
29212921
cast<MCSymbolELF>(Res.getSymA()->getSymbol()).getBinding() ==
29222922
ELF::STB_LOCAL);
2923-
if (!IsLocalSym && ABI.IsO32()) {
2924-
// PrivateGlobalPrefix for O32 is '$', while we support '.L' anyway.
2925-
if (Res.getSymA()->getSymbol().getName().starts_with(".L"))
2926-
IsLocalSym = true;
2927-
}
2923+
// For O32, "$"-prefixed symbols are recognized as temporary while
2924+
// .L-prefixed symbols are not (PrivateGlobalPrefix is "$"). Recognize ".L"
2925+
// manually.
2926+
if (ABI.IsO32() && Res.getSymA()->getSymbol().getName().starts_with(".L"))
2927+
IsLocalSym = true;
29282928
bool UseXGOT = STI->hasFeature(Mips::FeatureXGOT) && !IsLocalSym;
29292929

29302930
// The case where the result register is $25 is somewhat special. If the

0 commit comments

Comments
 (0)