UninitialuzedValues now only tracks BlockVarDecls; obviating false positives with
globals and function parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42055 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 4051806..a690413 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -58,6 +58,7 @@
   ParseCFGView,                 // Parse ASTS. Build CFGs. View CFGs.
   AnalysisLiveVariables,        // Print results of live-variable analysis.
   WarnDeadStores,               // Run DeadStores checker on parsed ASTs.
+  WarnUninitVals,               // Run UnitializedVariables checker.
   ParsePrintCallbacks,          // Parse and print each callback.
   ParseSyntaxOnly,              // Parse and perform semantic analysis.
   ParseNoop,                    // Parse with noop callbacks.
@@ -98,6 +99,8 @@
                         "Print results of live variable analysis."),
              clEnumValN(WarnDeadStores, "check-dead-stores",
                         "Flag warnings of stores to dead variables."),
+             clEnumValN(WarnUninitVals, "check-unit-vals",
+                        "Flag warnings of uses of unitialized variables."),
              clEnumValN(EmitLLVM, "emit-llvm",
                         "Build ASTs then convert to LLVM, emit .ll file"),
              clEnumValEnd));
@@ -870,6 +873,11 @@
     ParseAST(PP, MainFileID, *C.get(), Stats);
     break;
   }
+  case WarnUninitVals: {
+    std::auto_ptr<ASTConsumer> C(CreateUnitValsChecker(PP.getDiagnostics()));
+    ParseAST(PP, MainFileID, *C.get(), Stats);
+    break;
+  }    
   case EmitLLVM: {
     std::auto_ptr<ASTConsumer> C(CreateLLVMEmitter(PP.getDiagnostics()));
     ParseAST(PP, MainFileID, *C.get(), Stats);