[PATCH] D41695: [Metadata] Extend 'count' field of DISubrange to take a metadata node
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 14:12:38 PST 2018
sdesmalen added a comment.
In https://reviews.llvm.org/D41695#980508, @aprantl wrote:
> The fact that we are using a ConstantInt for the constants has me slightly concerned. What happens when a global points to the same ConstantInt and is optimized away? Will it also delete the ConstantInt as its last non-metadata user?
I don't think I fully understand the concern yet... I see your point about the ConstantInt itself being deleted and references to ValueAsMetadata to be removed by ValueAsMetadata::handleDeletion() (called by the destructor of Value), but Constant*'s are stored in many places in LLVM IR, so how would this use be any different?
Note that DIDerivedType does something similar for getConstant() and getStorageOffsetInBits().
https://reviews.llvm.org/D41695
More information about the llvm-commits
mailing list