[PATCH] tsan: support C++ exceptions
Reid Kleckner
rnk at google.com
Fri Jun 26 06:04:24 PDT 2015
I think the GC lowering code does a similar cleanup insertion, so you can
check that out. Here's a sketch of how to add a cleanup, though.
First, find all call insts that might throw. If there are any, create a new
landingpad for them.
For all landingpads, mark them as having cleanups.
Exit early if there were no calls or landingpads.
Create a new basic block with the cleanup code.
Replace all resume insts with a branch to the new block. If you created a
new lpad, have that branch here too.
Create a phi node in the new block to join together the resume values and
new landing pad value.
Terminate the new block with a resume that uses the phi.
There are some special cases where you can simplify the cfg, but that's the
general idea.
Sent from phone
http://reviews.llvm.org/D10740
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list