diff options
author | Chris Lattner <sabre@nondot.org> | 2007-09-15 23:21:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-09-15 23:21:08 +0000 |
commit | c0508f9fe37a3afb1ccad39879348272545e55db (patch) | |
tree | 9da5b0a52b2251d80f2f8af88bd65805763aebb1 /Driver/clang.cpp | |
parent | 3d4997da95b169f0ac32cf83af3368778c429898 (diff) |
switch the various CFG-based stuff over to using ASTConsumer interface,
this eliminates their dependence on the preprocessor and eliminates some
duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r-- | Driver/clang.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 7c25a0a9b0..7301354c17 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -855,17 +855,21 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, break; } case ParseCFGDump: - DumpCFGs(PP, MainFileID, Stats); - break; - case ParseCFGView: - DumpCFGs(PP, MainFileID, Stats, true); + case ParseCFGView: { + std::auto_ptr<ASTConsumer> C(CreateCFGDumper(ProgAction == ParseCFGView)); + ParseAST(PP, MainFileID, *C.get(), Stats); break; - case AnalysisLiveVariables: - AnalyzeLiveVariables(PP, MainFileID); + } + case AnalysisLiveVariables: { + std::auto_ptr<ASTConsumer> C(CreateLiveVarAnalyzer()); + ParseAST(PP, MainFileID, *C.get(), Stats); break; - case WarnDeadStores: - RunDeadStoresCheck(PP, MainFileID, Stats); + } + case WarnDeadStores: { + std::auto_ptr<ASTConsumer> C(CreateDeadStoreChecker(PP.getDiagnostics())); + ParseAST(PP, MainFileID, *C.get(), Stats); break; + } case EmitLLVM: EmitLLVMFromASTs(PP, MainFileID, Stats); break; |