mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-02 01:38:34 +00:00
rearrange some methods, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92219 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1d880e5114
commit
f2410180d0
@ -89,24 +89,27 @@ void MDNodeElement::allUsesReplacedWith(Value *NV) {
|
|||||||
// MDNode implementation.
|
// MDNode implementation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/// ~MDNode - Destroy MDNode.
|
||||||
|
MDNode::~MDNode() {
|
||||||
|
LLVMContextImpl *pImpl = getType()->getContext().pImpl;
|
||||||
|
pImpl->MDNodeSet.RemoveNode(this);
|
||||||
|
delete [] Operands;
|
||||||
|
Operands = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
MDNode::MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
|
MDNode::MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
|
||||||
bool isFunctionLocal)
|
bool isFunctionLocal)
|
||||||
: MetadataBase(Type::getMetadataTy(C), Value::MDNodeVal) {
|
: MetadataBase(Type::getMetadataTy(C), Value::MDNodeVal) {
|
||||||
NumOperands = NumVals;
|
NumOperands = NumVals;
|
||||||
Operands = new MDNodeElement[NumOperands];
|
Operands = new MDNodeElement[NumOperands];
|
||||||
MDNodeElement *Ptr = Operands;
|
|
||||||
for (unsigned i = 0; i != NumVals; ++i)
|
for (unsigned i = 0; i != NumVals; ++i)
|
||||||
Ptr[i].set(Vals[i], this);
|
Operands[i].set(Vals[i], this);
|
||||||
|
|
||||||
if (isFunctionLocal)
|
if (isFunctionLocal)
|
||||||
SubclassData |= FunctionLocalBit;
|
SubclassData |= FunctionLocalBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MDNode::Profile(FoldingSetNodeID &ID) const {
|
|
||||||
for (unsigned i = 0, e = getNumElements(); i != e; ++i)
|
|
||||||
ID.AddPointer(getElement(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals,
|
MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals,
|
||||||
bool isFunctionLocal) {
|
bool isFunctionLocal) {
|
||||||
LLVMContextImpl *pImpl = Context.pImpl;
|
LLVMContextImpl *pImpl = Context.pImpl;
|
||||||
@ -124,14 +127,12 @@ MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals,
|
|||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ~MDNode - Destroy MDNode.
|
void MDNode::Profile(FoldingSetNodeID &ID) const {
|
||||||
MDNode::~MDNode() {
|
for (unsigned i = 0, e = getNumElements(); i != e; ++i)
|
||||||
LLVMContextImpl *pImpl = getType()->getContext().pImpl;
|
ID.AddPointer(getElement(i));
|
||||||
pImpl->MDNodeSet.RemoveNode(this);
|
|
||||||
delete [] Operands;
|
|
||||||
Operands = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// getElement - Return specified element.
|
/// getElement - Return specified element.
|
||||||
Value *MDNode::getElement(unsigned i) const {
|
Value *MDNode::getElement(unsigned i) const {
|
||||||
assert(i < getNumElements() && "Invalid element number!");
|
assert(i < getNumElements() && "Invalid element number!");
|
||||||
|
Loading…
Reference in New Issue
Block a user