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/FrontendAction.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/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 66bec7c4aef..633b82c2e0f 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -40,8 +40,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, // AST files follow a very different path, since they share objects via the // AST unit. - bool IsAST = InputKind == IK_AST; - if (IsAST) { + if (InputKind == IK_AST) { assert(!usesPreprocessorOnly() && "Attempt to pass AST file to preprocessor only action!"); assert(hasASTSupport() && "This action does not have AST support!"); @@ -73,6 +72,13 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, return true; } + // Setup the file and source managers, if needed, and the preprocessor. + if (!CI.hasFileManager()) + CI.createFileManager(); + if (!CI.hasSourceManager()) + CI.createSourceManager(); + CI.createPreprocessor(); + // Inform the diagnostic client we are processing a source file. CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), &CI.getPreprocessor()); |