On 8/29/24 12:16 PM, Richard Sandiford wrote:

Most passes were written while the codebase was still C.  I think newer
passes have generally been written in the way I described.  Where possible,
it'd be better for new code to avoid using globals to communicate
information between functions, to reduce the work involved in any future
parallelisation effort.  (There have been tentative steps towards reducing
existing uses of globals in the past.)

Using classes also allows pass-level RAII.  I realise that doesn't matter
for the current code, but like I say, we should consider future extensions
too.
Right. I've actually got a patch here from Jivan that does this kind of conversion of ext-dce. I haven't done anything with it yet as I'm starting to worry it's got some fundamental flaws and may need to get pulled out.

Jeff

Reply via email to