From 5d0cacdbb6577f2449986f345858db17dc1bcf59 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 31 Dec 2009 01:22:29 +0000 Subject: rename "elements" of metadata to "operands". "Elements" are things that occur in types. "operands" are things that occur in values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Writer/BitcodeWriter.cpp | 16 ++++++++-------- lib/Bitcode/Writer/ValueEnumerator.cpp | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/Bitcode') diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 8454e54..c78a30e 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -475,10 +475,10 @@ static void WriteMDNode(const MDNode *N, const ValueEnumerator &VE, BitstreamWriter &Stream, SmallVector &Record) { - for (unsigned i = 0, e = N->getNumElements(); i != e; ++i) { - if (N->getElement(i)) { - Record.push_back(VE.getTypeID(N->getElement(i)->getType())); - Record.push_back(VE.getValueID(N->getElement(i))); + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { + if (N->getOperand(i)) { + Record.push_back(VE.getTypeID(N->getOperand(i)->getType())); + Record.push_back(VE.getValueID(N->getOperand(i))); } else { Record.push_back(VE.getTypeID(Type::getVoidTy(N->getContext()))); Record.push_back(0); @@ -535,10 +535,10 @@ static void WriteModuleMetadata(const ValueEnumerator &VE, Stream.EmitRecord(bitc::METADATA_NAME, Record, 0/*TODO*/); Record.clear(); - // Write named metadata elements. - for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { - if (NMD->getElement(i)) - Record.push_back(VE.getValueID(NMD->getElement(i))); + // Write named metadata operands. + for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { + if (NMD->getOperand(i)) + Record.push_back(VE.getValueID(NMD->getOperand(i))); else Record.push_back(0); } diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index 994dcb3..d8128db 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -212,8 +212,8 @@ void ValueEnumerator::EnumerateMetadata(const MetadataBase *MD) { MDValues.push_back(std::make_pair(MD, 1U)); MDValueMap[MD] = MDValues.size(); MDValueID = MDValues.size(); - for (unsigned i = 0, e = N->getNumElements(); i != e; ++i) { - if (Value *V = N->getElement(i)) + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { + if (Value *V = N->getOperand(i)) EnumerateValue(V); else EnumerateType(Type::getVoidTy(MD->getContext())); @@ -222,8 +222,8 @@ void ValueEnumerator::EnumerateMetadata(const MetadataBase *MD) { } if (const NamedMDNode *N = dyn_cast(MD)) { - for (unsigned i = 0, e = N->getNumElements(); i != e; ++i) - EnumerateValue(N->getElement(i)); + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + EnumerateValue(N->getOperand(i)); MDValues.push_back(std::make_pair(MD, 1U)); MDValueMap[MD] = Values.size(); return; @@ -327,8 +327,8 @@ void ValueEnumerator::EnumerateOperandType(const Value *V) { } if (const MDNode *N = dyn_cast(V)) { - for (unsigned i = 0, e = N->getNumElements(); i != e; ++i) - if (Value *Elem = N->getElement(i)) + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + if (Value *Elem = N->getOperand(i)) EnumerateOperandType(Elem); } } else if (isa(V) || isa(V)) -- cgit v1.1