Skip to content

Commit 449ce18

Browse files
committed
pass variable stringref by reference
1 parent c5120fd commit 449ce18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void PolynomialAttr::print(AsmPrinter &p) const {
2727
/// `monomial` with the results, and the `variable` outparam with the parsed
2828
/// variable name.
2929
ParseResult parseMonomial(AsmParser &parser, Monomial &monomial,
30-
llvm::StringRef *variable, bool *isConstantTerm) {
30+
llvm::StringRef &variable, bool *isConstantTerm) {
3131
APInt parsedCoeff(apintBitWidth, 1);
3232
auto result = parser.parseOptionalInteger(parsedCoeff);
3333
if (result.has_value()) {
@@ -39,7 +39,7 @@ ParseResult parseMonomial(AsmParser &parser, Monomial &monomial,
3939
}
4040

4141
// Variable name
42-
result = parser.parseOptionalKeyword(variable);
42+
result = parser.parseOptionalKeyword(&variable);
4343
if (!result.has_value() || failed(*result)) {
4444
// We allow "failed" because it triggers when the next token is a +,
4545
// which is allowed when the input is the constant term.
@@ -91,7 +91,7 @@ mlir::Attribute mlir::polynomial::PolynomialAttr::parse(AsmParser &parser,
9191
Monomial parsedMonomial;
9292
llvm::StringRef parsedVariableRef;
9393
bool isConstantTerm = false;
94-
if (failed(parseMonomial(parser, parsedMonomial, &parsedVariableRef,
94+
if (failed(parseMonomial(parser, parsedMonomial, parsedVariableRef,
9595
&isConstantTerm))) {
9696
return {};
9797
}

0 commit comments

Comments
 (0)