[llvm] r339670 - [TableGen] Pass string/vector types by const reference (PR37666). NFCI

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 10:12:20 PDT 2018


Oops - sorry David I didn't see your reply - I'll take another look.

On 27/08/2018 18:01, David Blaikie wrote:
> Ping
>
> On Mon, Aug 20, 2018 at 2:19 PM David Blaikie <dblaikie at gmail.com 
> <mailto:dblaikie at gmail.com>> wrote:
>
>     Looks to me like these should be passed by value but the missing
>     thing was the std::move in the ctor init list.
>
>     (since the members are values - if a caller passes in a temporary,
>     it'd be nice to avoid the copy & move the values into the members)
>
>     On Tue, Aug 14, 2018 at 4:18 AM Simon Pilgrim via llvm-commits
>     <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>>
>     wrote:
>
>         Author: rksimon
>         Date: Tue Aug 14 04:17:38 2018
>         New Revision: 339670
>
>         URL: http://llvm.org/viewvc/llvm-project?rev=339670&view=rev
>         Log:
>         [TableGen] Pass string/vector types by const reference
>         (PR37666). NFCI
>
>         Modified:
>             llvm/trunk/utils/TableGen/FastISelEmitter.cpp
>
>         Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp
>         URL:
>         http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=339670&r1=339669&r2=339670&view=diff
>         ==============================================================================
>         --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original)
>         +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Tue Aug 14
>         04:17:38 2018
>         @@ -39,11 +39,12 @@ struct InstructionMemo {
>            std::vector<std::string> PhysRegs;
>            std::string PredicateCheck;
>
>         -  InstructionMemo(std::string Name, const
>         CodeGenRegisterClass *RC,
>         -                  std::string SubRegNo,
>         std::vector<std::string> PhysRegs,
>         -                  std::string PredicateCheck)
>         -    : Name(Name), RC(RC), SubRegNo(SubRegNo), PhysRegs(PhysRegs),
>         -      PredicateCheck(PredicateCheck) {}
>         +  InstructionMemo(const std::string &Name, const
>         CodeGenRegisterClass *RC,
>         +                  const std::string &SubRegNo,
>         +                  const std::vector<std::string> &PhysRegs,
>         +                  const std::string &PredicateCheck)
>         +      : Name(Name), RC(RC), SubRegNo(SubRegNo),
>         PhysRegs(PhysRegs),
>         +        PredicateCheck(PredicateCheck) {}
>
>            // Make sure we do not copy InstructionMemo.
>            InstructionMemo(const InstructionMemo &Other) = delete;
>
>
>         _______________________________________________
>         llvm-commits mailing list
>         llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
>         http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180827/4ac3a078/attachment.html>


More information about the llvm-commits mailing list