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

Leny Kholodov leny.kholodov at gmail.com
Fri May 29 11:28:17 PDT 2015


Reid, first of all thank you very much for your comments. I've updated the implementation. Now I do decision about result usage inside CodeGenFunction::EmitAggExpr method. For an unused result I have incoming expression with type CallExpr. But for the used result I have two calls of EmitAggExpr method second of which has incoming expression with type MaterializeTemporaryExpr. So I decided to mark result as used in case of incoming MaterializeTemporaryExpr expression and to mark result as unused in other cases.

In the current implementation I don't use automatically cleanup mechanism for CallLifetimeEnd. I want to prepare it in separate patch.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10042

Files:
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CGCall.h
  lib/CodeGen/CGExprAgg.cpp
  test/CodeGenCXX/stack-reuse-miscompile.cpp
  test/CodeGenCXX/stack-reuse.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10042.26798.patch
Type: text/x-patch
Size: 9179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150529/7c02f09b/attachment.bin>


More information about the cfe-commits mailing list