mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
IR: Enable uniquing callbacks during MDNode::replaceWithUniqued()
Uniqued nodes have more complete registration with `ReplaceableMetadataImpl` so that they can update themselves when operands change. Fix a bug where `MDNode::replaceWithUniqued()` wasn't enabling these callbacks. The two most obvious ways missing callbacks causes problems is that auto-resolution fails and re-uniquing (on changed operands) just doesn't happen. I've added tests for both -- in both cases, I confirmed that the final check was failing before the fix. rdar://problem/20365935 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -761,6 +761,11 @@ protected:
|
||||
MDOperand *mutable_begin() { return mutable_end() - NumOperands; }
|
||||
MDOperand *mutable_end() { return reinterpret_cast<MDOperand *>(this); }
|
||||
|
||||
typedef iterator_range<MDOperand *> mutable_op_range;
|
||||
mutable_op_range mutable_operands() {
|
||||
return mutable_op_range(mutable_begin(), mutable_end());
|
||||
}
|
||||
|
||||
public:
|
||||
static inline MDTuple *get(LLVMContext &Context, ArrayRef<Metadata *> MDs);
|
||||
static inline MDTuple *getIfExists(LLVMContext &Context,
|
||||
|
Reference in New Issue
Block a user