[llvm] 091b18b - [X86] Return const& in IntelExprStateMachine::getIdentifierInfo(). NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 22 07:55:24 PDT 2020
Author: Simon Pilgrim
Date: 2020-10-22T15:55:06+01:00
New Revision: 091b18ba81fc1c9774f36df0d903d75aa72b64fb
URL: https://github.com/llvm/llvm-project/commit/091b18ba81fc1c9774f36df0d903d75aa72b64fb
DIFF: https://github.com/llvm/llvm-project/commit/091b18ba81fc1c9774f36df0d903d75aa72b64fb.diff
LOG: [X86] Return const& in IntelExprStateMachine::getIdentifierInfo(). NFCI.
Avoid unnecessary copy in X86AsmParser::ParseIntelOperand
Added:
Modified:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 7fd93cff692e..e18771386751 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -413,7 +413,7 @@ class X86AsmParser : public MCTargetAsmParser {
return State == IES_RBRAC || State == IES_INTEGER;
}
bool hadError() { return State == IES_ERROR; }
- InlineAsmIdentifierInfo &getIdentifierInfo() { return Info; }
+ const InlineAsmIdentifierInfo &getIdentifierInfo() const { return Info; }
void onOr() {
IntelExprState CurrState = State;
@@ -2313,7 +2313,7 @@ bool X86AsmParser::ParseIntelOperand(OperandVector &Operands) {
// and we are parsing a segment override
if (!SM.isMemExpr() && !RegNo) {
if (isParsingMSInlineAsm() && SM.isOffsetOperator()) {
- const InlineAsmIdentifierInfo Info = SM.getIdentifierInfo();
+ const InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();
if (Info.isKind(InlineAsmIdentifierInfo::IK_Var)) {
// Disp includes the address of a variable; make sure this is recorded
// for later handling.
More information about the llvm-commits
mailing list