SIL: remove SILValue::getDef and add a cast operator to ValueBase * as a repelacement. NFC.

This commit is contained in:
Erik Eckstein
2016-01-25 15:00:24 -08:00
parent aef0a11a7c
commit 74d44b74e7
63 changed files with 255 additions and 262 deletions

View File

@@ -444,7 +444,7 @@ public:
/// Gets or creates a node for a SILValue (same as above).
CGNode *getNode(SILValue V, EscapeAnalysis *EA) {
return getNode(V.getDef(), EA, true);
return getNode(V, EA, true);
}
/// Gets or creates a content node to which \a AddrNode points to.
@@ -541,7 +541,7 @@ public:
/// Gets or creates a node for a SILValue (same as above).
CGNode *getNodeOrNull(SILValue V, EscapeAnalysis *EA) {
return getNode(V.getDef(), EA, false);
return getNode(V, EA, false);
}
/// Returns the number of use-points of a node.

View File

@@ -109,15 +109,15 @@ private:
llvm::SmallVectorImpl<ValueBase *> &Operands) {
switch (Term->getTermKind()) {
case TermKind::BranchInst:
return Operands.push_back(cast<BranchInst>(Term)->getArg(Index).getDef());
return Operands.push_back(cast<BranchInst>(Term)->getArg(Index));
case TermKind::CondBranchInst: {
auto *CBI = cast<CondBranchInst>(Term);
if (SuccBB == CBI->getTrueBB())
return Operands.push_back(CBI->getTrueArgs()[Index].getDef());
return Operands.push_back(CBI->getTrueArgs()[Index]);
assert(SuccBB == CBI->getFalseBB() &&
"Block is not a successor of terminator!");
Operands.push_back(CBI->getFalseArgs()[Index].getDef());
Operands.push_back(CBI->getFalseArgs()[Index]);
return;
}
@@ -127,7 +127,7 @@ private:
case TermKind::CheckedCastAddrBranchInst:
case TermKind::DynamicMethodBranchInst:
assert(Index == 0 && "Expected argument index to always be zero!");
return Operands.push_back(Term->getOperand(0).getDef());
return Operands.push_back(Term->getOperand(0));
case TermKind::UnreachableInst:
case TermKind::ReturnInst:
@@ -137,7 +137,7 @@ private:
case TermKind::TryApplyInst:
for (auto &O : cast<TryApplyInst>(Term)->getAllOperands())
Operands.push_back(O.get().getDef());
Operands.push_back(O.get());
return;
}
}
@@ -146,7 +146,7 @@ private:
llvm::SmallVectorImpl<ValueBase *> &Operands) {
if (auto *I = dyn_cast<SILInstruction>(User)) {
for (auto &O : I->getAllOperands())
Operands.push_back(O.get().getDef());
Operands.push_back(O.get());
return;
}