summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/Spiller.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-07 22:44:07 +0000
committerChris Lattner <sabre@nondot.org>2010-04-07 22:44:07 +0000
commitcc7bb24fe2276c532dfe1d360825c2a2d7dfd61e (patch)
treea471a0164838912aa18fbbab2d35c050d02087fa /llvm/lib/CodeGen/Spiller.cpp
parentb6166b372e9cff274065f074ff4f8114f064d0f5 (diff)
downloadbcm5719-llvm-cc7bb24fe2276c532dfe1d360825c2a2d7dfd61e.tar.gz
bcm5719-llvm-cc7bb24fe2276c532dfe1d360825c2a2d7dfd61e.zip
remove some unneeded errorhandling stuff.
llvm-svn: 100703
Diffstat (limited to 'llvm/lib/CodeGen/Spiller.cpp')
-rw-r--r--llvm/lib/CodeGen/Spiller.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/Spiller.cpp b/llvm/lib/CodeGen/Spiller.cpp
index 7ba44031714..63c55549a3e 100644
--- a/llvm/lib/CodeGen/Spiller.cpp
+++ b/llvm/lib/CodeGen/Spiller.cpp
@@ -46,7 +46,6 @@ namespace {
/// Utility class for spillers.
class SpillerBase : public Spiller {
protected:
-
MachineFunction *mf;
LiveIntervals *lis;
MachineFrameInfo *mfi;
@@ -160,9 +159,11 @@ protected:
return added;
}
-
};
+} // end anonymous namespace
+
+namespace {
/// Spills any live range using the spill-everywhere method with no attempt at
/// folding.
@@ -178,9 +179,12 @@ public:
// Ignore spillIs - we don't use it.
return trivialSpillEverywhere(li);
}
-
};
+} // end anonymous namespace
+
+namespace {
+
/// Falls back on LiveIntervals::addIntervalsForSpills.
class StandardSpiller : public Spiller {
protected:
@@ -198,9 +202,12 @@ public:
SlotIndex*) {
return lis->addIntervalsForSpills(*li, spillIs, loopInfo, *vrm);
}
-
};
+} // end anonymous namespace
+
+namespace {
+
/// When a call to spill is placed this spiller will first try to break the
/// interval up into its component values (one new interval per value).
/// If this fails, or if a call is placed to spill a previously split interval
@@ -513,15 +520,16 @@ private:
};
-}
+} // end anonymous namespace
+
llvm::Spiller* llvm::createSpiller(MachineFunction *mf, LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
VirtRegMap *vrm) {
switch (spillerOpt) {
- case trivial: return new TrivialSpiller(mf, lis, vrm); break;
- case standard: return new StandardSpiller(lis, loopInfo, vrm); break;
- case splitting: return new SplittingSpiller(mf, lis, loopInfo, vrm); break;
- default: llvm_unreachable("Unreachable!"); break;
+ default: assert(0 && "unknown spiller");
+ case trivial: return new TrivialSpiller(mf, lis, vrm);
+ case standard: return new StandardSpiller(lis, loopInfo, vrm);
+ case splitting: return new SplittingSpiller(mf, lis, loopInfo, vrm);
}
}
OpenPOWER on IntegriCloud