[PATCH] [CodeGen] Reuse stack space from unused function results (with more accurate unused result detection)

Reid Kleckner rnk at google.com
Fri May 29 13:34:06 PDT 2015


Can you add some negative lifetime tests? These would be corner case situations like the original Twine bug where we thought the call result was unused but it's actually consumed by someone.


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/CGExprAgg.cpp:1398
@@ -1396,2 +1397,3 @@
  
-  AggExprEmitter(*this, Slot).Visit(const_cast<Expr*>(E));
+  bool isResultUnused = !isa<const MaterializeTemporaryExpr>(E);
+  AggExprEmitter(*this, Slot, isResultUnused).Visit(const_cast<Expr*>(E));
----------------
This condition doesn't seem right. You can Slot.isIgnored(), which should do the trick, though. :)

http://reviews.llvm.org/D10042

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list