summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/DCE.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
committerChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
commitf57b845547302d24ecb6a9e79d7bc386f761a6c9 (patch)
tree369bc5be013a3a6d0373dbf26820d701e01c5297 /lib/Transforms/Scalar/DCE.cpp
parentf2361c5e5c2917e6f19a55927b221d8671753a40 (diff)
downloadllvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.tar.gz
llvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.tar.bz2
llvm-f57b845547302d24ecb6a9e79d7bc386f761a6c9.tar.xz
* Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction * Transform getAnalysisUsageInfo into getAnalysisUsage - Method is now const - It now takes one AnalysisUsage object to fill in instead of 3 vectors to fill in - Pass's now specify which other passes they _preserve_ not which ones they modify (be conservative!) - A pass can specify that it preserves all analyses (because it never modifies the underlying program) * s/Method/Function/g in other random places as well git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DCE.cpp')
-rw-r--r--lib/Transforms/Scalar/DCE.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp
index 6169730ce8..0d6f293cd0 100644
--- a/lib/Transforms/Scalar/DCE.cpp
+++ b/lib/Transforms/Scalar/DCE.cpp
@@ -9,7 +9,7 @@
// predecessor only has one successor.
// * Eliminates PHI nodes for basic blocks with a single predecessor
// * Eliminates a basic block that only contains an unconditional branch
-// * Eliminates method prototypes that are not referenced
+// * Eliminates function prototypes that are not referenced
//
// TODO: This should REALLY be worklist driven instead of iterative. Right now,
// we scan linearly through values, removing unused ones as we go. The problem
@@ -163,13 +163,13 @@ static bool PropogatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
// iterator that designates the first element remaining after the block that
// was deleted.
//
-// WARNING: The entry node of a method may not be simplified.
+// WARNING: The entry node of a function may not be simplified.
//
bool SimplifyCFG(Function::iterator &BBIt) {
BasicBlock *BB = *BBIt;
Function *M = BB->getParent();
- assert(BB && BB->getParent() && "Block not embedded in method!");
+ assert(BB && BB->getParent() && "Block not embedded in function!");
assert(BB->getTerminator() && "Degenerate basic block encountered!");
assert(BB->getParent()->front() != BB && "Can't Simplify entry block!");
@@ -258,7 +258,7 @@ bool SimplifyCFG(Function::iterator &BBIt) {
Pred->getInstList().push_back(Def); // Add to end...
}
- // Remove basic block from the method... and advance iterator to the
+ // Remove basic block from the function... and advance iterator to the
// next valid block...
BB = M->getBasicBlocks().remove(BBIt);
@@ -303,7 +303,7 @@ static bool DoDCEPass(Function *F) {
}
// Remove unused global values - This removes unused global values of no
-// possible value. This currently includes unused method prototypes and
+// possible value. This currently includes unused function prototypes and
// unitialized global variables.
//
static bool RemoveUnusedGlobalValues(Module *Mod) {
@@ -313,7 +313,7 @@ static bool RemoveUnusedGlobalValues(Module *Mod) {
Function *Meth = *MI;
if (Meth->isExternal() && Meth->use_size() == 0) {
// No references to prototype?
- //cerr << "Removing method proto: " << Meth->getName() << endl;
+ //cerr << "Removing function proto: " << Meth->getName() << endl;
delete Mod->getFunctionList().remove(MI); // Remove prototype
// Remove moves iterator to point to the next one automatically
Changed = true;
@@ -339,7 +339,7 @@ static bool RemoveUnusedGlobalValues(Module *Mod) {
}
namespace {
- struct DeadCodeElimination : public MethodPass {
+ struct DeadCodeElimination : public FunctionPass {
// Pass Interface...
virtual bool doInitialization(Module *M) {
@@ -349,7 +349,7 @@ namespace {
// It is possible that we may require multiple passes over the code to fully
// eliminate dead code. Iterate until we are done.
//
- virtual bool runOnMethod(Function *F) {
+ virtual bool runOnFunction(Function *F) {
bool Changed = false;
while (DoDCEPass(F)) Changed = true;
return Changed;