diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-07 23:23:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-07 23:23:50 +0000 |
commit | aed46fcbe9188c4ce29481003cc1374593a6a4d7 (patch) | |
tree | a8009c678901ce4641cb184f0ed1cfee916f3119 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 8654638b23a185d9dcb4a5a14e5d51def34bbc37 (diff) | |
download | bcm5719-llvm-aed46fcbe9188c4ce29481003cc1374593a6a4d7.tar.gz bcm5719-llvm-aed46fcbe9188c4ce29481003cc1374593a6a4d7.zip |
Frontend: Move some initialization from CompilerInstance to FrontendAction, to parallel what is done for AST inputs.
llvm-svn: 105579
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 0af355c4319..0ff70edf8b4 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -489,25 +489,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) { const std::string &InFile = getFrontendOpts().Inputs[i].second; - // If we aren't using an AST file, setup the file and source managers and - // the preprocessor. - bool IsAST = getFrontendOpts().Inputs[i].first == IK_AST; - if (!IsAST) { - if (!i) { - // Create a file manager object to provide access to and cache the - // filesystem. - createFileManager(); - - // Create the source manager. - createSourceManager(); - } else { - // Reset the ID tables if we are reusing the SourceManager. - getSourceManager().clearIDTables(); - } - - // Create the preprocessor. - createPreprocessor(); - } + // Reset the ID tables if we are reusing the SourceManager. + if (hasSourceManager()) + getSourceManager().clearIDTables(); if (Act.BeginSourceFile(*this, InFile, getFrontendOpts().Inputs[i].first)) { Act.Execute(); @@ -530,7 +514,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { OS << " generated.\n"; } - if (getFrontendOpts().ShowStats) { + if (getFrontendOpts().ShowStats && hasFileManager()) { getFileManager().PrintStats(); OS << "\n"; } |