aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp16
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp12
2 files changed, 14 insertions, 14 deletions
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<uint64_t, 64> &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<NamedMDNode>(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<MDNode>(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<MDString>(V) || isa<MDNode>(V))