OSDN Git Service

[tablegen] Avoid creating a temporary vector in getInstructionCase
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 4 Jul 2017 06:16:53 +0000 (06:16 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 4 Jul 2017 06:16:53 +0000 (06:16 +0000)
commitd6059bd671375d749e32f8b031aab635b075705f
treeb52880676daa7223583132599b768fd3a8553dce
parenta2a4e2c7e5dd22af9b522480850aeea143d903ec
[tablegen] Avoid creating a temporary vector in getInstructionCase

Record::getValues returns ArrayRef which has a cast operator
to std::vector, as a result a temporary vector is created
if the type of the variable is const std::vector&
that is suboptimal in this case.

Differential revision: https://reviews.llvm.org/D34969

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307063 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeEmitterGen.cpp