mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-08 21:47:23 +00:00
Add comments explaining why it's not necessary to include the
is-function-local flag in metadata uniquing bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
973a074345
commit
56b092e4cd
@ -190,6 +190,8 @@ MDNode *MDNode::getMDNode(LLVMContext &Context, Value *const *Vals,
|
|||||||
|
|
||||||
// Add all the operand pointers. Note that we don't have to add the
|
// Add all the operand pointers. Note that we don't have to add the
|
||||||
// isFunctionLocal bit because that's implied by the operands.
|
// isFunctionLocal bit because that's implied by the operands.
|
||||||
|
// Note that if the operands are later nulled out, the node will be
|
||||||
|
// removed from the uniquing map.
|
||||||
FoldingSetNodeID ID;
|
FoldingSetNodeID ID;
|
||||||
for (unsigned i = 0; i != NumVals; ++i)
|
for (unsigned i = 0; i != NumVals; ++i)
|
||||||
ID.AddPointer(Vals[i]);
|
ID.AddPointer(Vals[i]);
|
||||||
@ -276,6 +278,8 @@ Value *MDNode::getOperand(unsigned i) const {
|
|||||||
void MDNode::Profile(FoldingSetNodeID &ID) const {
|
void MDNode::Profile(FoldingSetNodeID &ID) const {
|
||||||
// Add all the operand pointers. Note that we don't have to add the
|
// Add all the operand pointers. Note that we don't have to add the
|
||||||
// isFunctionLocal bit because that's implied by the operands.
|
// isFunctionLocal bit because that's implied by the operands.
|
||||||
|
// Note that if the operands are later nulled out, the node will be
|
||||||
|
// removed from the uniquing map.
|
||||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
|
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
|
||||||
ID.AddPointer(getOperand(i));
|
ID.AddPointer(getOperand(i));
|
||||||
}
|
}
|
||||||
@ -326,7 +330,8 @@ void MDNode::replaceOperand(MDNodeOperand *Op, Value *To) {
|
|||||||
|
|
||||||
// If we are dropping an argument to null, we choose to not unique the MDNode
|
// If we are dropping an argument to null, we choose to not unique the MDNode
|
||||||
// anymore. This commonly occurs during destruction, and uniquing these
|
// anymore. This commonly occurs during destruction, and uniquing these
|
||||||
// brings little reuse.
|
// brings little reuse. Also, this means we don't need to include
|
||||||
|
// isFunctionLocal bits in FoldingSetNodeIDs for MDNodes.
|
||||||
if (To == 0) {
|
if (To == 0) {
|
||||||
setIsNotUniqued();
|
setIsNotUniqued();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user