rjmccall added inline comments.

================
Comment at: include/clang/AST/Expr.h:875
+  /// is set to true.
+  bool IsUnique = false;
+
----------------
Humor me and pack this in the bitfields in Stmt, please. :)


================
Comment at: include/clang/AST/Expr.h:932
 
+  void setIsUnique() { IsUnique = true; }
+  bool isUnique() const { return IsUnique; }
----------------
Can we assert that there's a source expression?


================
Comment at: lib/Sema/SemaPseudoObject.cpp:432
+  if (capturedRHS->getType()->getAsCXXRecordDecl() && capturedRHS->isRValue())
+    capturedRHS->setIsUnique();
+
----------------
I think you can unconditionally set this here, actually.  You just need to 
teach the other two exhaustive emitters in IRGen (scalar and complex) to look 
through unique OVEs.  Plenty of other things in IRGen could benefit from being 
able to peephole through unique OVEs.

Also, you can set it on the OVE for the base expression if this is a simple 
assignment or load.


https://reviews.llvm.org/D39562



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to