jakehehrlich added a comment. I didn't think about that. I think the key thing here then is to use shared_ptr to store all symbols and then use use_count to keep track of the references. Repository: rL LLVM https://reviews.llvm.org/D46896