From 9e33c7f5d32cdad091296fdffb6030881386e5a7 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. llvm-svn: 263409 --- llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp index 7c5ceda..e9c1c2d 100644 --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/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) { -- 2.7.4