[PATCH] D150256: [NFC]add mov constructor to DIEValue

Wang, Xin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 02:50:10 PDT 2023


XinWang10 added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/DIE.h:466
 
+  DIEValue(DIEValue &&X) : Ty(X.Ty), Attribute(X.Attribute), Form(X.Form) {
+    copyVal(X);
----------------
barannikov88 wrote:
> It is no more efficient than the copy constructor.
> Why do you need it?
> 
Because I think DIEValue could maintain dynamic memory, copy constructor here need to first construct a temporary one and assign to this then destruct it self, couldn't move here be more efficient?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150256/new/

https://reviews.llvm.org/D150256



More information about the llvm-commits mailing list