Skip to content

Commit 091b18b

Browse files
committed
[X86] Return const& in IntelExprStateMachine::getIdentifierInfo(). NFCI.
Avoid unnecessary copy in X86AsmParser::ParseIntelOperand
1 parent 68ac02c commit 091b18b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class X86AsmParser : public MCTargetAsmParser {
413413
return State == IES_RBRAC || State == IES_INTEGER;
414414
}
415415
bool hadError() { return State == IES_ERROR; }
416-
InlineAsmIdentifierInfo &getIdentifierInfo() { return Info; }
416+
const InlineAsmIdentifierInfo &getIdentifierInfo() const { return Info; }
417417

418418
void onOr() {
419419
IntelExprState CurrState = State;
@@ -2313,7 +2313,7 @@ bool X86AsmParser::ParseIntelOperand(OperandVector &Operands) {
23132313
// and we are parsing a segment override
23142314
if (!SM.isMemExpr() && !RegNo) {
23152315
if (isParsingMSInlineAsm() && SM.isOffsetOperator()) {
2316-
const InlineAsmIdentifierInfo Info = SM.getIdentifierInfo();
2316+
const InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();
23172317
if (Info.isKind(InlineAsmIdentifierInfo::IK_Var)) {
23182318
// Disp includes the address of a variable; make sure this is recorded
23192319
// for later handling.

0 commit comments

Comments
 (0)