aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-08-04 08:08:13 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-08-04 08:08:13 +0000
commitcc7ba49d85b66955516ff0d9574a70e1637dea36 (patch)
treeadacadc073ce93b363f612101928c015e5e06074 /lib/Linker
parent93ad2cf91092c4ff45ace5b87b97179202e3de06 (diff)
downloadexternal_llvm-cc7ba49d85b66955516ff0d9574a70e1637dea36.zip
external_llvm-cc7ba49d85b66955516ff0d9574a70e1637dea36.tar.gz
external_llvm-cc7ba49d85b66955516ff0d9574a70e1637dea36.tar.bz2
Stop using getValues().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 5fa52b6..5eadc38 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -292,18 +292,16 @@ static Value *RemapOperand(const Value *In,
Constant *Result = 0;
if (const ConstantArray *CPA = dyn_cast<ConstantArray>(CPV)) {
- const std::vector<Use> &Ops = CPA->getValues();
- std::vector<Constant*> Operands(Ops.size());
- for (unsigned i = 0, e = Ops.size(); i != e; ++i)
- Operands[i] =
- cast<Constant>(RemapOperand(Ops[i], LocalMap, GlobalMap));
+ std::vector<Constant*> Operands(CPA->getNumOperands());
+ for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
+ Operands[i] =
+ cast<Constant>(RemapOperand(CPA->getOperand(i), LocalMap, GlobalMap));
Result = ConstantArray::get(cast<ArrayType>(CPA->getType()), Operands);
} else if (const ConstantStruct *CPS = dyn_cast<ConstantStruct>(CPV)) {
- const std::vector<Use> &Ops = CPS->getValues();
- std::vector<Constant*> Operands(Ops.size());
- for (unsigned i = 0; i < Ops.size(); ++i)
- Operands[i] =
- cast<Constant>(RemapOperand(Ops[i], LocalMap, GlobalMap));
+ std::vector<Constant*> Operands(CPS->getNumOperands());
+ for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
+ Operands[i] =
+ cast<Constant>(RemapOperand(CPS->getOperand(i), LocalMap, GlobalMap));
Result = ConstantStruct::get(cast<StructType>(CPS->getType()), Operands);
} else if (isa<ConstantPointerNull>(CPV)) {
Result = const_cast<Constant*>(CPV);
@@ -774,7 +772,7 @@ static bool LinkAppendingVars(Module *M,
Inits.reserve(NewSize);
if (ConstantArray *I = dyn_cast<ConstantArray>(G1->getInitializer())) {
for (unsigned i = 0, e = T1->getNumElements(); i != e; ++i)
- Inits.push_back(cast<Constant>(I->getValues()[i]));
+ Inits.push_back(I->getOperand(i));
} else {
assert(isa<ConstantAggregateZero>(G1->getInitializer()));
Constant *CV = Constant::getNullValue(T1->getElementType());
@@ -783,7 +781,7 @@ static bool LinkAppendingVars(Module *M,
}
if (ConstantArray *I = dyn_cast<ConstantArray>(G2->getInitializer())) {
for (unsigned i = 0, e = T2->getNumElements(); i != e; ++i)
- Inits.push_back(cast<Constant>(I->getValues()[i]));
+ Inits.push_back(I->getOperand(i));
} else {
assert(isa<ConstantAggregateZero>(G2->getInitializer()));
Constant *CV = Constant::getNullValue(T2->getElementType());