Reduce the amount of raw pointer the HIR API
This draft PR is a first attempt at reducing the amount of raw pointers in the HIR API by replacing those either with references or smart pointers.
Requires #2867 to be merged first.
This PR probably requires a lot of other changes, I was trying to get something that compiles again quickly and many things may be wrong.
@philberty Is this even something you'd like to see merged ?
I think this is a good idea, I did alot of hacky stuff in the HIR just to get stuff going but yeah this was lazy of me. If you can i would persue finishing this PR
It's been a long time since I last updated this PR. This was compiling fine but there was a lot of errors (mainly use after free and segfaults). So even if we manage to rebase it on master it'll still be a long way until merge.
I put you as reviewer because the HIR is mostly your work and I didn't want to bring huge change that you would disagree with.
This does not look good, I should have refactored the hir files before attempting to remove the raw pointers.
Putting this as ready as it will be horrible and long to review, it still requires a few fixes and a rebase though.