riccibruno added a comment.

> I was looking at SpecificBumpPtrAllocator, which knows it's type.
>  But if i look down the indirection, i think 
> AllocatorBase::Allocate<T>()/AllocatorBase::Deallocate<T>() is the place.

I did look at that, but I think it won't work for two reasons:

1. AST nodes are very often allocated with some trailing objects and so the 
typed version of `Allocate` is not used.
2. It would be difficult to add exceptions as done in this patch. The two 
exceptions I added are (I think!) latent bugs, but they seem to be relatively 
harmless (for `ConstantArrayType` you would need to have an array with a size 
which do not fit inline in the `APInt`, and then it would only cause a leak).

In time it would be nice to just remove the two exceptions, but then point 1 
still apply.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66646/new/

https://reviews.llvm.org/D66646



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to