From a3a17e4d45bbb44c6d8967b83e8569680a90553b Mon Sep 17 00:00:00 2001 From: Valery Pykhtin Date: Mon, 14 Mar 2016 05:25:44 +0000 Subject: [PATCH] [AMDGPU] AsmParser: refactor post push_back vector access. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263409 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp index 7c5cedacc8a..e9c1c2d811f 100644 --- a/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -1106,14 +1106,13 @@ AMDGPUAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) { Parser.Lex(); Modifiers |= 0x2; } - Operands.push_back(AMDGPUOperand::CreateReg( - RegNo, S, E, getContext().getRegisterInfo(), &getSTI(), - isForcedVOP3())); - + auto R = AMDGPUOperand::CreateReg(RegNo, S, E, + getContext().getRegisterInfo(), + &getSTI(), isForcedVOP3()); if (Modifiers) { - AMDGPUOperand &RegOp = ((AMDGPUOperand&)*Operands[Operands.size() - 1]); - RegOp.setModifiers(Modifiers); + R->setModifiers(Modifiers); } + Operands.push_back(std::move(R)); } else { ResTy = parseVOP3OptionalOps(Operands); if (ResTy == MatchOperand_NoMatch) {