This is the mail archive of the
mailing list for the GCC project.
Re: Updating the CFG after function modifcation
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Matt Davis <mattdavis9 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 16 Jul 2011 09:59:03 +0200
- Subject: Re: Updating the CFG after function modifcation
- References: <20110716043126.GA8647@excelsa.csse.unimelb.edu.au>
> I have an IPA pass (implemented as a plugin) which executes after all IPA
> passes. My pass transforms functions by adding code and also modifying the
> function prototypes. I have had this work on a per-function basis, via a
> GIMPLE_PASS, which calls update_ssa verify_ssa and cleanup_cfg after each
> function is processed. However, I have recently moved my plugin to execute
> after all IPA passes, so I can iterate over the cfg of the program.
Callgraph, not CFG, of the program.
> The e->call_stmt that the null basic block references is from a statement I
> have removed via gsi_remove during my transformation pass. I need to clean
> up the cfg somehow, after I remove the statement. My gimple pass, with
> this same functionality worked fine. Something tells me that my plugin
> should be in a different position. I also tried calling cleanup_tree_cfg()
> after my transformation pass, still no luck
Try invoking rebuild_cgraph_edges.