Skip to content

Commit b3873e8

Browse files
committed
MCSymbol: Remove the default argument of getVariableValue
It has been made ineffective by e015626. This change migrates the users.
1 parent 54ef0e0 commit b3873e8

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

llvm/include/llvm/MC/MCSymbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class MCSymbol {
301301
}
302302

303303
/// Get the expression of the variable symbol.
304-
const MCExpr *getVariableValue(bool SetUsed = true) const {
304+
const MCExpr *getVariableValue() const {
305305
assert(isVariable() && "Invalid accessor!");
306306
return Value;
307307
}

llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ void MCResourceInfo::assignResourceInfoExpr(
127127
// Avoid constructing recursive definitions by detecting whether `Sym` is
128128
// found transitively within any of its `CalleeValSym`.
129129
if (!CalleeValSym->isVariable() ||
130-
!CalleeValSym->getVariableValue(/*isUsed=*/false)
131-
->isSymbolUsedInExpression(Sym)) {
130+
!CalleeValSym->getVariableValue()->isSymbolUsedInExpression(Sym)) {
132131
LLVM_DEBUG(dbgs() << "MCResUse: " << Sym->getName() << ": Adding "
133132
<< CalleeValSym->getName() << " as callee\n");
134133
ArgExprs.push_back(MCSymbolRefExpr::create(CalleeValSym, OutContext));
@@ -244,8 +243,7 @@ void MCResourceInfo::gatherResourceInfo(
244243
// Avoid constructing recursive definitions by detecting whether `Sym`
245244
// is found transitively within any of its `CalleeValSym`.
246245
if (!CalleeValSym->isVariable() ||
247-
!CalleeValSym->getVariableValue(/*isUsed=*/false)
248-
->isSymbolUsedInExpression(Sym)) {
246+
!CalleeValSym->getVariableValue()->isSymbolUsedInExpression(Sym)) {
249247
LLVM_DEBUG(dbgs() << "MCResUse: " << Sym->getName() << ": Adding "
250248
<< CalleeValSym->getName() << " as callee\n");
251249
ArgExprs.push_back(MCSymbolRefExpr::create(CalleeValSym, OutContext));

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3101,7 +3101,7 @@ bool AMDGPUAsmParser::updateGprCountSymbols(RegisterKind RegKind,
31013101
if (!Sym->isVariable())
31023102
return !Error(getLoc(),
31033103
".amdgcn.next_free_{v,s}gpr symbols must be variable");
3104-
if (!Sym->getVariableValue(false)->evaluateAsAbsolute(OldCount))
3104+
if (!Sym->getVariableValue()->evaluateAsAbsolute(OldCount))
31053105
return !Error(
31063106
getLoc(),
31073107
".amdgcn.next_free_{v,s}gpr symbols must be absolute expressions");

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static void knownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
542542

543543
// Variable value retrieval is not for actual use but only for knownbits
544544
// analysis.
545-
const MCExpr *SymVal = Sym.getVariableValue(/*setUsed=*/false);
545+
const MCExpr *SymVal = Sym.getVariableValue();
546546
knownBitsMapHelper(SymVal, KBM, Depth + 1);
547547

548548
// Explicitly copy-construct so that there exists a local KnownBits in case

llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
11981198
Sym = getContext().getOrCreateSymbol(Identifier);
11991199

12001200
if (Sym->isVariable()) {
1201-
const MCExpr *V = Sym->getVariableValue(/*SetUsed=*/false);
1201+
const MCExpr *V = Sym->getVariableValue();
12021202
if (!isa<MCSymbolRefExpr>(V)) {
12031203
getLexer().UnLex(Tok); // Put back if it's not a bare symbol.
12041204
return Error(getLoc(), "unknown symbol");
@@ -1270,7 +1270,7 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
12701270
Sym = getContext().getOrCreateSymbol(Identifier);
12711271

12721272
if (Sym->isVariable()) {
1273-
const MCExpr *V = Sym->getVariableValue(/*SetUsed=*/false);
1273+
const MCExpr *V = Sym->getVariableValue();
12741274
if (!isa<MCSymbolRefExpr>(V)) {
12751275
getLexer().UnLex(Tok); // Put back if it's not a bare symbol.
12761276
return Error(getLoc(), "unknown symbol");
@@ -1345,7 +1345,7 @@ ParseStatus CSKYAsmParser::parseConstpoolSymbol(OperandVector &Operands) {
13451345
Sym = getContext().getOrCreateSymbol(Identifier);
13461346

13471347
if (Sym->isVariable()) {
1348-
const MCExpr *V = Sym->getVariableValue(/*SetUsed=*/false);
1348+
const MCExpr *V = Sym->getVariableValue();
13491349
if (!isa<MCSymbolRefExpr>(V)) {
13501350
getLexer().UnLex(Tok); // Put back if it's not a bare symbol.
13511351
return Error(getLoc(), "unknown symbol");

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,8 +1972,7 @@ ParseStatus RISCVAsmParser::parseCSRSystemRegister(OperandVector &Operands) {
19721972
if (Sym && Sym->isVariable()) {
19731973
// Pass false for SetUsed, since redefining the value later does not
19741974
// affect this instruction.
1975-
if (auto SysOpnd = SysRegFromConstantInt(
1976-
Sym->getVariableValue(/*SetUsed=*/false), S)) {
1975+
if (auto SysOpnd = SysRegFromConstantInt(Sym->getVariableValue(), S)) {
19771976
Operands.push_back(std::move(SysOpnd));
19781977
return ParseStatus::Success;
19791978
}
@@ -2130,7 +2129,7 @@ ParseStatus RISCVAsmParser::parseBareSymbol(OperandVector &Operands) {
21302129
MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
21312130

21322131
if (Sym->isVariable()) {
2133-
const MCExpr *V = Sym->getVariableValue(/*SetUsed=*/false);
2132+
const MCExpr *V = Sym->getVariableValue();
21342133
if (!isa<MCSymbolRefExpr>(V)) {
21352134
getLexer().UnLex(Tok); // Put back if it's not a bare symbol.
21362135
return ParseStatus::NoMatch;

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,7 @@ bool X86AsmParser::ParseMemOperand(MCRegister SegReg, const MCExpr *Disp,
30053005
if (!Id.empty()) {
30063006
MCSymbol *Sym = this->getContext().getOrCreateSymbol(Id);
30073007
if (Sym->isVariable()) {
3008-
auto V = Sym->getVariableValue(/*SetUsed*/ false);
3008+
auto V = Sym->getVariableValue();
30093009
return isa<X86MCExpr>(V);
30103010
}
30113011
}

0 commit comments

Comments
 (0)