compiler2: Uniform thread-safe ID generation

Issue #10 new
Simon Zünd
created an issue

Currently IDs for VirtualRegisters, MachineOperands, MachineBasicBlockss are implemented as static counters. I see two issues with that:

  • It is not thread-safe
  • IDs do not get reset after a compiler run

I propose we add a (possibly templated) ID generator to the PassRunner. Since each compiler run has its own PassRunner instance and all passes run on the same thread, its thread-safe. They also get reset by the default, since each run/instance creates new generator(s).

Comments (0)

  1. Log in to comment