Home | History | Annotate | Download | only in Frontend

Lines Matching refs:CI

93 ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
95 ASTConsumer* Consumer = CreateASTConsumer(CI, InFile);
99 if (CI.getFrontendOpts().AddPluginActions.size() == 0)
106 for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size();
114 if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) {
117 if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i]))
118 Consumers.push_back(c->CreateASTConsumer(CI, InFile));
126 bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
132 setCompilerInstance(&CI);
134 if (!BeginInvocation(CI))
145 llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
148 CI.getFileSystemOpts());
156 CI.setFileManager(&AST->getFileManager());
157 CI.setSourceManager(&AST->getSourceManager());
158 CI.setPreprocessor(&AST->getPreprocessor());
159 CI.setASTContext(&AST->getASTContext());
162 if (!BeginSourceFileAction(CI, Filename))
166 CI.setASTConsumer(CreateWrappedASTConsumer(CI, Filename));
167 if (!CI.hasASTConsumer())
174 if (!CI.hasFileManager())
175 CI.createFileManager();
176 if (!CI.hasSourceManager())
177 CI.createSourceManager(CI.getFileManager());
185 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
188 if (!BeginSourceFileAction(CI, Filename))
195 CI.createPreprocessor();
198 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
199 &CI.getPreprocessor());
202 if (!BeginSourceFileAction(CI, Filename))
208 CI.createASTContext();
211 CreateWrappedASTConsumer(CI, Filename));
215 CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
217 if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
220 source.reset(ChainedIncludesSource::create(CI));
223 CI.getASTContext().setExternalSource(source);
225 } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
230 if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls)
232 if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty())
233 DeserialListener = new DeserializedDeclsChecker(CI.getASTContext(),
234 CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn,
236 CI.createPCHExternalASTSource(
237 CI.getPreprocessorOpts().ImplicitPCHInclude,
238 CI.getPreprocessorOpts().DisablePCHValidation,
239 CI.getPreprocessorOpts().DisableStatCache,
241 if (!CI.getASTContext().getExternalSource())
245 CI.setASTConsumer(Consumer.take());
246 if (!CI.hasASTConsumer())
252 if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
253 Preprocessor &PP = CI.getPreprocessor();
264 CI.setASTContext(0);
265 CI.setPreprocessor(0);
266 CI.setSourceManager(0);
267 CI.setFileManager(0);
270 CI.getDiagnosticClient().EndSourceFile();
277 CompilerInstance &CI = getCompilerInstance();
289 CI.getSourceManager().createMainFileIDForMemBuffer(SB);
291 if (!CI.InitializeSourceManager(getCurrentFile()))
295 if (CI.hasFrontendTimer()) {
296 llvm::TimeRegion Timer(CI.getFrontendTimer());
303 CompilerInstance &CI = getCompilerInstance();
306 CI.getDiagnosticClient().EndSourceFile();
315 if (CI.getFrontendOpts().DisableFree) {
316 CI.takeASTConsumer();
318 CI.takeSema();
319 CI.resetAndLeakASTContext();
323 CI.setSema(0);
324 CI.setASTContext(0);
326 CI.setASTConsumer(0);
330 if (CI.hasPreprocessor())
331 CI.getPreprocessor().EndSourceFile();
333 if (CI.getFrontendOpts().ShowStats) {
335 CI.getPreprocessor().PrintStats();
336 CI.getPreprocessor().getIdentifierTable().PrintStats();
337 CI.getPreprocessor().getHeaderSearchInfo().PrintStats();
338 CI.getSourceManager().PrintStats();
344 CI.clearOutputFiles(/*EraseFiles=*/CI.getDiagnostics().hasErrorOccurred());
347 CI.takeSema();
348 CI.resetAndLeakASTContext();
349 CI.resetAndLeakPreprocessor();
350 CI.resetAndLeakSourceManager();
351 CI.resetAndLeakFileManager();
363 CompilerInstance &CI = getCompilerInstance();
368 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
369 CI.createCodeCompletionConsumer();
373 if (CI.hasCodeCompletionConsumer())
374 CompletionConsumer = &CI.getCodeCompletionConsumer();
376 if (!CI.hasSema())
377 CI.createSema(getTranslationUnitKind(), CompletionConsumer);
379 ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats);
383 PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
388 ASTConsumer *WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI,
390 return WrappedAction->CreateASTConsumer(CI, InFile);
392 bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) {
393 return WrappedAction->BeginInvocation(CI);
395 bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI,
398 WrappedAction->setCompilerInstance(&CI);
399 return WrappedAction->BeginSourceFileAction(CI, Filename);