[llvm-commits] [llvm] r95409 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Dan Gohman gohman at apple.com
Fri Feb 5 11:24:11 PST 2010


Author: djg
Date: Fri Feb  5 13:24:11 2010
New Revision: 95409

URL: http://llvm.org/viewvc/llvm-project?rev=95409&view=rev
Log:
Implement releaseMemory in CodeGenPrepare and free the BackEdges
container data. This prevents it from holding onto dangling
pointers and potentially behaving unpredictably.

Modified:
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=95409&r1=95408&r2=95409&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Feb  5 13:24:11 2010
@@ -63,6 +63,10 @@
       AU.addPreserved<ProfileInfo>();
     }
 
+    virtual void releaseMemory() {
+      BackEdges.clear();
+    }
+
   private:
     bool EliminateMostlyEmptyBlocks(Function &F);
     bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;





More information about the llvm-commits mailing list