Use template instead of void* -based type erasure in MachineRegistry
ClosedPublic

Authored by serge-sans-paille on Wed, Nov 7, 5:52 AM.

Details

Summary

Type safe version of MachinePassRegistry

Previous version used type erasure through a void* (*)() pointer,
which triggered gcc warning and implied a lot of reinterpret_cast.

This version should make it harder to hit ourselves in the foot.

Diff Detail

Repository
rL LLVM
kristina added a subscriber: kristina.

Pass manager related stuff, probably good idea to have Chandler or Fedor look over it since they've been doing a lot of work related to PM infrastructure.

This is the legacy PM, and specifically as it is implemented in codegen, so my opinions are few and far between... Not sure the benefits here are all that important, but maybe? Looping in folks w/ more backend feelings about this kind of thing.

meh

The whole registry system isn't used much. The whole machine seems a little overengineered in retrospect (there only ever is a single listener for example). But making it typesafe seems sensible.

MatzeB accepted this revision.Thu, Nov 8, 11:29 AM

Take my "meh" as LGTM if nobody objects in the next couple days.

This revision is now accepted and ready to land.Thu, Nov 8, 11:29 AM

ok, thanks. The only goal of that patch is to silent disturbing warning, I'll apply it at the end of the day.

This revision now requires review to proceed.Fri, Nov 9, 12:56 AM
This revision was not accepted when it landed; it landed in state Needs Review.Fri, Nov 9, 9:22 AM
Closed by commit rL346522: Type safe version of MachinePassRegistry (authored by serge_sans_paille, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.