Lines Matching refs:CI
138 FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, in CreateWrappedASTConsumer() argument
140 std::unique_ptr<ASTConsumer> Consumer = CreateASTConsumer(CI, InFile); in CreateWrappedASTConsumer()
160 for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size(); in CreateWrappedASTConsumer()
162 if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) { in CreateWrappedASTConsumer()
170 P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs[it->getName()])) { in CreateWrappedASTConsumer()
171 std::unique_ptr<ASTConsumer> PluginConsumer = P->CreateASTConsumer(CI, InFile); in CreateWrappedASTConsumer()
189 bool FrontendAction::BeginSourceFile(CompilerInstance &CI, in BeginSourceFile() argument
194 setCompilerInstance(&CI); in BeginSourceFile()
198 if (!BeginInvocation(CI)) in BeginSourceFile()
209 IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics()); in BeginSourceFile()
212 InputFile, CI.getPCHContainerReader(), Diags, CI.getFileSystemOpts(), in BeginSourceFile()
213 CI.getCodeGenOpts().DebugTypeExtRefs); in BeginSourceFile()
219 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr); in BeginSourceFile()
224 CI.setFileManager(&AST->getFileManager()); in BeginSourceFile()
225 CI.setSourceManager(&AST->getSourceManager()); in BeginSourceFile()
226 CI.setPreprocessor(&AST->getPreprocessor()); in BeginSourceFile()
227 CI.setASTContext(&AST->getASTContext()); in BeginSourceFile()
232 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
236 CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile)); in BeginSourceFile()
237 if (!CI.hasASTConsumer()) in BeginSourceFile()
243 if (!CI.hasVirtualFileSystem()) { in BeginSourceFile()
245 createVFSFromCompilerInvocation(CI.getInvocation(), in BeginSourceFile()
246 CI.getDiagnostics())) in BeginSourceFile()
247 CI.setVirtualFileSystem(VFS); in BeginSourceFile()
253 if (!CI.hasFileManager()) in BeginSourceFile()
254 CI.createFileManager(); in BeginSourceFile()
255 if (!CI.hasSourceManager()) in BeginSourceFile()
256 CI.createSourceManager(CI.getFileManager()); in BeginSourceFile()
264 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr); in BeginSourceFile()
268 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
272 if (!CI.InitializeSourceManager(CurrentInput)) in BeginSourceFile()
280 if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { in BeginSourceFile()
281 FileManager &FileMgr = CI.getFileManager(); in BeginSourceFile()
282 PreprocessorOptions &PPOpts = CI.getPreprocessorOpts(); in BeginSourceFile()
284 std::string SpecificModuleCachePath = CI.getSpecificModuleCachePath(); in BeginSourceFile()
294 Dir->path(), FileMgr, CI.getPCHContainerReader(), in BeginSourceFile()
295 CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(), in BeginSourceFile()
304 CI.getDiagnostics().Report(diag::err_fe_no_pch_in_dir) << PCHInclude; in BeginSourceFile()
313 CI.createPreprocessor(getTranslationUnitKind()); in BeginSourceFile()
316 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), in BeginSourceFile()
317 &CI.getPreprocessor()); in BeginSourceFile()
321 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
326 if (!CI.InitializeSourceManager(CurrentInput)) in BeginSourceFile()
334 CI.createASTContext(); in BeginSourceFile()
337 CreateWrappedASTConsumer(CI, InputFile); in BeginSourceFile()
343 CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener()); in BeginSourceFile()
345 if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) { in BeginSourceFile()
348 source = createChainedIncludesSource(CI, FinalReader); in BeginSourceFile()
351 CI.setModuleManager(static_cast<ASTReader *>(FinalReader.get())); in BeginSourceFile()
352 CI.getASTContext().setExternalSource(source); in BeginSourceFile()
353 } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { in BeginSourceFile()
359 if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls) { in BeginSourceFile()
364 if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty()) { in BeginSourceFile()
366 CI.getASTContext(), in BeginSourceFile()
367 CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn, in BeginSourceFile()
371 CI.createPCHExternalASTSource( in BeginSourceFile()
372 CI.getPreprocessorOpts().ImplicitPCHInclude, in BeginSourceFile()
373 CI.getPreprocessorOpts().DisablePCHValidation, in BeginSourceFile()
374 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, DeserialListener, in BeginSourceFile()
376 if (!CI.getASTContext().getExternalSource()) in BeginSourceFile()
380 CI.setASTConsumer(std::move(Consumer)); in BeginSourceFile()
381 if (!CI.hasASTConsumer()) in BeginSourceFile()
387 if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) { in BeginSourceFile()
388 Preprocessor &PP = CI.getPreprocessor(); in BeginSourceFile()
393 if (CI.getLangOpts().Modules) in BeginSourceFile()
394 CI.createModuleManager(); in BeginSourceFile()
401 assert((!CI.getLangOpts().Modules || CI.getModuleManager()) && in BeginSourceFile()
407 for (const auto &Filename : CI.getFrontendOpts().ModuleMapFiles) { in BeginSourceFile()
408 if (auto *File = CI.getFileManager().getFile(Filename)) in BeginSourceFile()
409 CI.getPreprocessor().getHeaderSearchInfo().loadModuleMapFile( in BeginSourceFile()
412 CI.getDiagnostics().Report(diag::err_module_map_not_found) << Filename; in BeginSourceFile()
416 for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles) in BeginSourceFile()
417 if (!CI.loadModuleFile(ModuleFile)) in BeginSourceFile()
422 if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() && in BeginSourceFile()
423 CI.hasASTContext() && !CI.getASTContext().getExternalSource()) { in BeginSourceFile()
426 CI.getFrontendOpts().OverrideRecordLayoutsFile)); in BeginSourceFile()
427 CI.getASTContext().setExternalSource(Override); in BeginSourceFile()
436 CI.setASTContext(nullptr); in BeginSourceFile()
437 CI.setPreprocessor(nullptr); in BeginSourceFile()
438 CI.setSourceManager(nullptr); in BeginSourceFile()
439 CI.setFileManager(nullptr); in BeginSourceFile()
443 CI.getDiagnosticClient().EndSourceFile(); in BeginSourceFile()
444 CI.clearOutputFiles(/*EraseFiles=*/true); in BeginSourceFile()
451 CompilerInstance &CI = getCompilerInstance(); in Execute() local
453 if (CI.hasFrontendTimer()) { in Execute()
454 llvm::TimeRegion Timer(CI.getFrontendTimer()); in Execute()
461 if (CI.shouldBuildGlobalModuleIndex() && CI.hasFileManager() && in Execute()
462 CI.hasPreprocessor()) { in Execute()
464 CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath(); in Execute()
466 GlobalModuleIndex::writeIndex(CI.getFileManager(), in Execute()
467 CI.getPCHContainerReader(), Cache); in Execute()
474 CompilerInstance &CI = getCompilerInstance(); in EndSourceFile() local
477 CI.getDiagnosticClient().EndSourceFile(); in EndSourceFile()
480 if (CI.hasPreprocessor()) in EndSourceFile()
481 CI.getPreprocessor().EndSourceFile(); in EndSourceFile()
489 bool DisableFree = CI.getFrontendOpts().DisableFree; in EndSourceFile()
491 CI.resetAndLeakSema(); in EndSourceFile()
492 CI.resetAndLeakASTContext(); in EndSourceFile()
493 BuryPointer(CI.takeASTConsumer().get()); in EndSourceFile()
495 CI.setSema(nullptr); in EndSourceFile()
496 CI.setASTContext(nullptr); in EndSourceFile()
497 CI.setASTConsumer(nullptr); in EndSourceFile()
500 if (CI.getFrontendOpts().ShowStats) { in EndSourceFile()
502 CI.getPreprocessor().PrintStats(); in EndSourceFile()
503 CI.getPreprocessor().getIdentifierTable().PrintStats(); in EndSourceFile()
504 CI.getPreprocessor().getHeaderSearchInfo().PrintStats(); in EndSourceFile()
505 CI.getSourceManager().PrintStats(); in EndSourceFile()
511 CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles()); in EndSourceFile()
515 CI.resetAndLeakPreprocessor(); in EndSourceFile()
516 CI.resetAndLeakSourceManager(); in EndSourceFile()
517 CI.resetAndLeakFileManager(); in EndSourceFile()
519 CI.setPreprocessor(nullptr); in EndSourceFile()
520 CI.setSourceManager(nullptr); in EndSourceFile()
521 CI.setFileManager(nullptr); in EndSourceFile()
538 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
539 if (!CI.hasPreprocessor()) in ExecuteAction()
545 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty()) in ExecuteAction()
546 CI.createCodeCompletionConsumer(); in ExecuteAction()
550 if (CI.hasCodeCompletionConsumer()) in ExecuteAction()
551 CompletionConsumer = &CI.getCodeCompletionConsumer(); in ExecuteAction()
553 if (!CI.hasSema()) in ExecuteAction()
554 CI.createSema(getTranslationUnitKind(), CompletionConsumer); in ExecuteAction()
556 ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats, in ExecuteAction()
557 CI.getFrontendOpts().SkipFunctionBodies); in ExecuteAction()
563 PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
569 WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
571 return WrappedAction->CreateASTConsumer(CI, InFile); in CreateASTConsumer()
573 bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) { in BeginInvocation() argument
574 return WrappedAction->BeginInvocation(CI); in BeginInvocation()
576 bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI, in BeginSourceFileAction() argument
579 WrappedAction->setCompilerInstance(&CI); in BeginSourceFileAction()
580 auto Ret = WrappedAction->BeginSourceFileAction(CI, Filename); in BeginSourceFileAction()