analyze() now checks to see that we don't analyze the same method twice.
[oota-llvm.git] / lib / Analysis / LiveVar / FunctionLiveVarInfo.cpp
index 91c2498e9750c46cee02264642fcefc6d54ecf9c..e47c9d2bc3c63730030f1f96093f78931da0f504 100644 (file)
@@ -114,7 +114,11 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
 // performs live var anal for a method
 void MethodLiveVarInfo::analyze()        
 {
-
+  // Don't analyze the same method twice!
+  // Later, we need to add change notification here.
+  if (HasAnalyzed)
+    return;
+  
   if( DEBUG_LV) cout << "Analysing live variables ..." << endl;
 
   // create and initialize all the BBLiveVars of the CFG