Home | History | Annotate | Download | only in Frontend

Lines Matching defs:CI

128 ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
130 ASTConsumer* Consumer = CreateASTConsumer(CI, InFile);
134 if (CI.getFrontendOpts().AddPluginActions.size() == 0)
141 for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size();
149 if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) {
152 if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i]))
153 Consumers.push_back(c->CreateASTConsumer(CI, InFile));
162 bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
167 setCompilerInstance(&CI);
171 if (!BeginInvocation(CI))
182 IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
185 CI.getFileSystemOpts());
192 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
197 CI.setFileManager(&AST->getFileManager());
198 CI.setSourceManager(&AST->getSourceManager());
199 CI.setPreprocessor(&AST->getPreprocessor());
200 CI.setASTContext(&AST->getASTContext());
203 if (!BeginSourceFileAction(CI, InputFile))
207 CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile));
208 if (!CI.hasASTConsumer())
215 if (!CI.hasFileManager())
216 CI.createFileManager();
217 if (!CI.hasSourceManager())
218 CI.createSourceManager(CI.getFileManager());
226 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
230 if (!BeginSourceFileAction(CI, InputFile))
238 if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
239 FileManager &FileMgr = CI.getFileManager();
240 PreprocessorOptions &PPOpts = CI.getPreprocessorOpts();
251 CI.getLangOpts(),
252 CI.getTargetOpts(),
253 CI.getPreprocessorOpts())) {
261 CI.getDiagnostics().Report(diag::err_fe_no_pch_in_dir) << PCHInclude;
268 CI.createPreprocessor();
271 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
272 &CI.getPreprocessor());
276 if (!BeginSourceFileAction(CI, InputFile))
282 CI.createASTContext();
285 CreateWrappedASTConsumer(CI, InputFile));
289 CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
291 if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
294 source.reset(ChainedIncludesSource::create(CI));
297 CI.setModuleManager(static_cast<ASTReader*>(
299 CI.getASTContext().setExternalSource(source);
301 } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
306 if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls)
308 if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty())
309 DeserialListener = new DeserializedDeclsChecker(CI.getASTContext(),
310 CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn,
312 CI.createPCHExternalASTSource(
313 CI.getPreprocessorOpts().ImplicitPCHInclude,
314 CI.getPreprocessorOpts().DisablePCHValidation,
315 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
317 if (!CI.getASTContext().getExternalSource())
321 CI.setASTConsumer(Consumer.take());
322 if (!CI.hasASTConsumer())
328 if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
329 Preprocessor &PP = CI.getPreprocessor();
336 if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() &&
337 CI.hasASTContext() && !CI.getASTContext().getExternalSource()) {
340 CI.getFrontendOpts().OverrideRecordLayoutsFile));
341 CI.getASTContext().setExternalSource(Override);
350 CI.setASTContext(0);
351 CI.setPreprocessor(0);
352 CI.setSourceManager(0);
353 CI.setFileManager(0);
357 CI.getDiagnosticClient().EndSourceFile();
358 CI.clearOutputFiles(/*EraseFiles=*/true);
365 CompilerInstance &CI = getCompilerInstance();
370 if (!CI.InitializeSourceManager(getCurrentInput()))
374 if (CI.hasFrontendTimer()) {
375 llvm::TimeRegion Timer(CI.getFrontendTimer());
382 if (CI.shouldBuildGlobalModuleIndex() && CI.hasFileManager() &&
383 CI.hasPreprocessor()) {
385 CI.getFileManager(),
386 CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath());
393 CompilerInstance &CI = getCompilerInstance();
396 CI.getDiagnosticClient().EndSourceFile();
405 if (CI.getFrontendOpts().DisableFree) {
406 CI.takeASTConsumer();
408 CI.takeSema();
409 CI.resetAndLeakASTContext();
413 CI.setSema(0);
414 CI.setASTContext(0);
416 CI.setASTConsumer(0);
420 if (CI.hasPreprocessor())
421 CI.getPreprocessor().EndSourceFile();
423 if (CI.getFrontendOpts().ShowStats) {
425 CI.getPreprocessor().PrintStats();
426 CI.getPreprocessor().getIdentifierTable().PrintStats();
427 CI.getPreprocessor().getHeaderSearchInfo().PrintStats();
428 CI.getSourceManager().PrintStats();
434 CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles());
437 CI.takeSema();
438 CI.resetAndLeakASTContext();
439 CI.resetAndLeakPreprocessor();
440 CI.resetAndLeakSourceManager();
441 CI.resetAndLeakFileManager();
457 CompilerInstance &CI = getCompilerInstance();
458 if (!CI.hasPreprocessor())
464 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
465 CI.createCodeCompletionConsumer();
469 if (CI
470 CompletionConsumer = &CI.getCodeCompletionConsumer();
472 if (!CI.hasSema())
473 CI.createSema(getTranslationUnitKind(), CompletionConsumer);
475 ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats,
476 CI.getFrontendOpts().SkipFunctionBodies);
482 PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
487 ASTConsumer *WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI,
489 return WrappedAction->CreateASTConsumer(CI, InFile);
491 bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) {
492 return WrappedAction->BeginInvocation(CI);
494 bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI,
497 WrappedAction->setCompilerInstance(&CI);
498 return WrappedAction->BeginSourceFileAction(CI, Filename);