Move LLVMTemporaryMDNode and LLVMMetadataReplaceAllUsesWith to the C bindings and add LLVMDeleteTemporaryMDNode for deleting non-RAUW'ed temporary nodes.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm-c/DebugInfo.h | ||
---|---|---|
851 | I think this should be called LLVMDisposeTemporaryMDNode, by analogy with every other destructor. | |
858 | Is this really necessary? If this function remains, it should at least be documented that it is exactly the same as calling LLVMReplaceAllUsesWith and then LLVMDisposeTemporaryMDNode, but I'm not convinced that it has much value. |
llvm::Value::replaceAllUsesWith and llvm::MDNode::replaceAllUsesWith are distinct operations. The former assumes the source and replacement values are the same type, the latter assumes that you're trying to build up a graph of dummy metadata for an incomplete or recursive definition that you will eventually finalize by replacing it with real nodes.
I do agree with the name change for dispose - and it is actually a useful operation to have. We're handing ownership of temporary metadata nodes to the caller and if they don't RAUW they will leak.
llvm::Value::replaceAllUsesWith and llvm::MDNode::replaceAllUsesWith are distinct operations.
Ah, I haven't realized the MDNode function is different. LGTM.
I think this should be called LLVMDisposeTemporaryMDNode, by analogy with every other destructor.