summaryrefslogtreecommitdiff
path: root/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-04-25 16:53:59 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-04-25 16:53:59 +0000
commit280a6e607d8eb7401749a92db624a82de47da777 (patch)
tree040d0b406293ebcc56801552313daa6136ee5e6c /lib/VMCore/BasicBlock.cpp
parent419ace9bda6abaaa65560708064b210b4e48880f (diff)
downloadllvm-280a6e607d8eb7401749a92db624a82de47da777.tar.gz
llvm-280a6e607d8eb7401749a92db624a82de47da777.tar.bz2
llvm-280a6e607d8eb7401749a92db624a82de47da777.tar.xz
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r--lib/VMCore/BasicBlock.cpp38
1 files changed, 6 insertions, 32 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 16aa7faa08..17469d6bdb 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -74,8 +74,8 @@ template class SymbolTableListTraits<Instruction, BasicBlock>;
BasicBlock::BasicBlock(const std::string &Name, Function *NewParent,
- BasicBlock *InsertBefore, BasicBlock *Dest)
- : User(Type::LabelTy, Value::BasicBlockVal, &unwindDest, 0/*FIXME*/), Parent(0) {
+ BasicBlock *InsertBefore)
+ : Value(Type::LabelTy, Value::BasicBlockVal), Parent(0) {
// Make sure that we get added to a function
LeakDetector::addGarbageObject(this);
@@ -89,8 +89,6 @@ BasicBlock::BasicBlock(const std::string &Name, Function *NewParent,
}
setName(Name);
- unwindDest.init(NULL, this);
- setUnwindDest(Dest);
}
@@ -119,19 +117,6 @@ void BasicBlock::eraseFromParent() {
getParent()->getBasicBlockList().erase(this);
}
-const BasicBlock *BasicBlock::getUnwindDest() const {
- return cast_or_null<const BasicBlock>(unwindDest.get());
-}
-
-BasicBlock *BasicBlock::getUnwindDest() {
- return cast_or_null<BasicBlock>(unwindDest.get());
-}
-
-void BasicBlock::setUnwindDest(BasicBlock *dest) {
- NumOperands = unwindDest ? 1 : 0;
- unwindDest.set(dest);
-}
-
/// moveBefore - Unlink this basic block from its current function and
/// insert it into the function that MovePos lives in, right before MovePos.
void BasicBlock::moveBefore(BasicBlock *MovePos) {
@@ -170,7 +155,6 @@ Instruction* BasicBlock::getFirstNonPHI()
}
void BasicBlock::dropAllReferences() {
- setUnwindDest(NULL);
for(iterator I = begin(), E = end(); I != E; ++I)
I->dropAllReferences();
}
@@ -192,8 +176,7 @@ BasicBlock *BasicBlock::getSinglePredecessor() {
/// called while the predecessor still refers to this block.
///
void BasicBlock::removePredecessor(BasicBlock *Pred,
- bool DontDeleteUselessPHIs,
- bool OnlyDeleteOne) {
+ bool DontDeleteUselessPHIs) {
assert((hasNUsesOrMore(16)||// Reduce cost of this assertion for complex CFGs.
find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
"removePredecessor: BB is not a predecessor!");
@@ -228,11 +211,7 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
// Yup, loop through and nuke the PHI nodes
while (PHINode *PN = dyn_cast<PHINode>(&front())) {
// Remove the predecessor first.
- if (OnlyDeleteOne) {
- int idx = PN->getBasicBlockIndex(Pred);
- PN->removeIncomingValue(idx, !DontDeleteUselessPHIs);
- } else
- PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs);
+ PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs);
// If the PHI _HAD_ two uses, replace PHI node with its now *single* value
if (max_idx == 2) {
@@ -253,12 +232,7 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
PHINode *PN;
for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) {
++II;
- if (OnlyDeleteOne) {
- int idx = PN->getBasicBlockIndex(Pred);
- PN->removeIncomingValue(idx, false);
- } else
- PN->removeIncomingValue(Pred, false);
-
+ PN->removeIncomingValue(Pred, false);
// If all incoming values to the Phi are the same, we can replace the Phi
// with that value.
Value* PNV = 0;
@@ -287,7 +261,7 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
assert(I != InstList.end() &&
"Trying to get me to create degenerate basic block!");
- BasicBlock *New = new(0/*FIXME*/) BasicBlock(BBName, getParent(), getNext());
+ BasicBlock *New = BasicBlock::Create(BBName, getParent(), getNext());
// Move all of the specified instructions from the original basic block into
// the new basic block.