Fix bug in terminator processing for uninitialized-values: simply ignore the terminator, don't reprocess it.

LiveVariables analysis now does a flow-insensitive analysis to determine what variables have their address taken; these variables are now always treated as being live.

The DataflowSolver now uses "SetTopValue()" when getting the initial value for the entry/exit block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49734 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp
index d5c697a..2116e50 100644
--- a/lib/Analysis/UninitializedValues.cpp
+++ b/lib/Analysis/UninitializedValues.cpp
@@ -58,13 +58,15 @@
   UninitializedValues::ValTy V;
   UninitializedValues::AnalysisDataTy& AD;
 public:
-  TransferFuncs(UninitializedValues::AnalysisDataTy& ad) : AD(ad) {
-    V.resetValues(AD);
-  }
+  TransferFuncs(UninitializedValues::AnalysisDataTy& ad) : AD(ad) {}
   
   UninitializedValues::ValTy& getVal() { return V; }
   CFG& getCFG() { return AD.getCFG(); }
   
+  void SetTopValue(UninitializedValues::ValTy& X) {
+    X.resetValues(AD);
+  }
+    
   bool VisitDeclRefExpr(DeclRefExpr* DR);
   bool VisitBinaryOperator(BinaryOperator* B);
   bool VisitUnaryOperator(UnaryOperator* U);
@@ -76,7 +78,7 @@
   bool Visit(Stmt *S);
   bool BlockStmt_VisitExpr(Expr* E);
     
-  void VisitTerminator(Stmt* T) { Visit(T); }
+  void VisitTerminator(Stmt* T) { }
   
   BlockVarDecl* FindBlockVarDecl(Stmt* S);
 };
@@ -216,12 +218,9 @@
 //  In our transfer functions we take the approach that any
 //  combination of unintialized values, e.g. Unitialized + ___ = Unitialized.
 //
-//  Merges take the opposite approach.
-//
-//  In the merge of dataflow values we prefer unsoundness, and
-//  prefer false negatives to false positives.  At merges, if a value for a
-//  tracked Decl is EVER initialized in any of the predecessors we treat it as
-//  initialized at the confluence point.
+//  Merges take the same approach, preferring soundness.  At a confluence point,
+//  if any predecessor has a variable marked uninitialized, the value is
+//  uninitialized at the confluence point.
 //===----------------------------------------------------------------------===//      
 
 namespace {