mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
rename MDNode instance variables to something meaningful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5e9cd43423
commit
dfdb5dcf56
@ -99,8 +99,8 @@ class MDNode : public MetadataBase, public FoldingSetNode {
|
|||||||
// Replace each instance of F from the element list of this node with T.
|
// Replace each instance of F from the element list of this node with T.
|
||||||
void replaceElement(Value *F, Value *T);
|
void replaceElement(Value *F, Value *T);
|
||||||
|
|
||||||
MDNodeElement *Node;
|
MDNodeElement *Operands;
|
||||||
unsigned NodeSize;
|
unsigned NumOperands;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
|
explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
Value *getElement(unsigned i) const;
|
Value *getElement(unsigned i) const;
|
||||||
|
|
||||||
/// getNumElements - Return number of MDNode elements.
|
/// getNumElements - Return number of MDNode elements.
|
||||||
unsigned getNumElements() const { return NodeSize; }
|
unsigned getNumElements() const { return NumOperands; }
|
||||||
|
|
||||||
/// isFunctionLocal - Return whether MDNode is local to a function.
|
/// isFunctionLocal - Return whether MDNode is local to a function.
|
||||||
/// Note: MDNodes are designated as function-local when created, and keep
|
/// Note: MDNodes are designated as function-local when created, and keep
|
||||||
|
@ -87,11 +87,12 @@ void MDNodeElement::allUsesReplacedWith(Value *NV) {
|
|||||||
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) {
|
||||||
NodeSize = NumVals;
|
NumOperands = NumVals;
|
||||||
Node = new MDNodeElement[NodeSize];
|
Operands = new MDNodeElement[NumOperands];
|
||||||
MDNodeElement *Ptr = Node;
|
MDNodeElement *Ptr = Operands;
|
||||||
for (unsigned i = 0; i != NumVals; ++i)
|
for (unsigned i = 0; i != NumVals; ++i)
|
||||||
*Ptr++ = MDNodeElement(Vals[i], this);
|
Ptr[i] = MDNodeElement(Vals[i], this);
|
||||||
|
|
||||||
if (isFunctionLocal)
|
if (isFunctionLocal)
|
||||||
SubclassData |= FunctionLocalBit;
|
SubclassData |= FunctionLocalBit;
|
||||||
}
|
}
|
||||||
@ -122,14 +123,14 @@ MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals,
|
|||||||
MDNode::~MDNode() {
|
MDNode::~MDNode() {
|
||||||
LLVMContextImpl *pImpl = getType()->getContext().pImpl;
|
LLVMContextImpl *pImpl = getType()->getContext().pImpl;
|
||||||
pImpl->MDNodeSet.RemoveNode(this);
|
pImpl->MDNodeSet.RemoveNode(this);
|
||||||
delete [] Node;
|
delete [] Operands;
|
||||||
Node = NULL;
|
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!");
|
||||||
return Node[i];
|
return Operands[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -161,8 +162,7 @@ void MDNode::replaceElement(Value *From, Value *To) {
|
|||||||
// Replace From element(s) in place.
|
// Replace From element(s) in place.
|
||||||
for (SmallVector<unsigned, 4>::iterator I = Indexes.begin(), E = Indexes.end();
|
for (SmallVector<unsigned, 4>::iterator I = Indexes.begin(), E = Indexes.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
unsigned Index = *I;
|
Operands[*I] = MDNodeElement(To, this);
|
||||||
Node[Index] = MDNodeElement(To, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert updated "this" into the context's folding node set.
|
// Insert updated "this" into the context's folding node set.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user