diff options
| author | Ted Kremenek <kremenek@apple.com> | 2007-09-17 20:49:30 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2007-09-17 20:49:30 +0000 |
| commit | 7e61e81bbfeed1f76c617de51a3b5cc8facd6b5f (patch) | |
| tree | 0be6d39c68b73d2b22846fafb6ee6c60db6cc5ba /clang/Driver/clang.cpp | |
| parent | 712dbe9d139af9655009269bf802a39009cb9bc6 (diff) | |
| download | bcm5719-llvm-7e61e81bbfeed1f76c617de51a3b5cc8facd6b5f.tar.gz bcm5719-llvm-7e61e81bbfeed1f76c617de51a3b5cc8facd6b5f.zip | |
UninitialuzedValues now only tracks BlockVarDecls; obviating false positives with
globals and function parameters.
llvm-svn: 42055
Diffstat (limited to 'clang/Driver/clang.cpp')
| -rw-r--r-- | clang/Driver/clang.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 40518067182..a69041396ec 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -58,6 +58,7 @@ enum ProgActions { 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 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore, "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 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, 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); |

