MethodPass's are now guaranteed to not be run on external methods!
authorChris Lattner <sabre@nondot.org>
Thu, 31 Jan 2002 00:51:24 +0000 (00:51 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 31 Jan 2002 00:51:24 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1611 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/SCCP.cpp

index c778ca8b0dfc57255c2539ce6eb5a1448f2611ca..aad63c848f2b2284099ba59bcd7d7216c6aca841 100644 (file)
@@ -242,7 +242,7 @@ static inline void InsertCodeToShowMethodExit(BasicBlock *BB, Method *Printf) {
 
 bool InsertTraceCode::doit(Method *M, bool traceBasicBlockExits,
                            bool traceMethodEvents, Method *Printf) {
-  if (M->isExternal() || (!traceBasicBlockExits && !traceMethodEvents))
+  if (!traceBasicBlockExits && !traceMethodEvents)
     return false;
 
   vector<Instruction*> valuesStoredInMethod;
index 38865003bb35e95925ee1bf9fc9f4167fba2a63d..ef0a5fd314dbfbc33356cc43f48e732170ce05ea 100644 (file)
@@ -435,8 +435,6 @@ static bool DoRaisePass(Method *M) {
 // level.
 //
 bool RaisePointerReferences::doit(Method *M) {
-  if (M->isExternal()) return false;
-
 #ifdef DEBUG_PEEPHOLE_INSTS
   cerr << "\n\n\nStarting to work on Method '" << M->getName() << "'\n";
 #endif
index 5449f223462dfafaacc97f09f357ff7e3cbb1d17..71c50674f4cccf4d4c6ee832f88101072ecb1503 100644 (file)
@@ -292,9 +292,7 @@ BasicBlock *ADCE::fixupCFG(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks,
 // doADCE - Execute the Agressive Dead Code Elimination Algorithm
 //
 bool AgressiveDCE::runOnMethod(Method *M) {
-  if (M->isExternal()) return false;
-  ADCE DCE(M);
-  return DCE.doADCE(
+  return ADCE(M).doADCE(
        getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID));
 }
 
index 48faffebf4bd177ef3081c76ae11f158b7fe1449..d06c19787fec5836c23e48044edba19841a0e5c7 100644 (file)
@@ -185,8 +185,6 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) {
 }
 
 bool InductionVariableSimplify::doit(Method *M, cfg::LoopInfo &Loops) {
-  if (M->isExternal()) return false;
-
   // Induction Variables live in the header nodes of the loops of the method...
   return reduce_apply_bool(Loops.getTopLevelLoops().begin(),
                            Loops.getTopLevelLoops().end(),
index 9b2343c936cddf126d4c86f37a62bdc21526be3a..d6b7c40f34b885aa58fc0bbabab96b9a104a1e9f 100644 (file)
@@ -511,7 +511,6 @@ void SCCP::OperandChangedState(User *U) {
 // to prove whether a value is constant and whether blocks are used.
 //
 bool SCCPPass::doSCCP(Method *M) {
-  if (M->isExternal()) return false;
   SCCP S(M);
   return S.doSCCP();
 }