Lines Matching refs:CI
138 FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, in CreateWrappedASTConsumer() argument
140 std::unique_ptr<ASTConsumer> Consumer = CreateASTConsumer(CI, InFile); in CreateWrappedASTConsumer()
144 if (CI.getFrontendOpts().AddPluginActions.size() == 0) in CreateWrappedASTConsumer()
152 for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size(); in CreateWrappedASTConsumer()
160 if (it->getName() != CI.getFrontendOpts().AddPluginActions[i]) in CreateWrappedASTConsumer()
163 if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i])) in CreateWrappedASTConsumer()
164 Consumers.push_back(P->CreateASTConsumer(CI, InFile)); in CreateWrappedASTConsumer()
171 bool FrontendAction::BeginSourceFile(CompilerInstance &CI, in BeginSourceFile() argument
176 setCompilerInstance(&CI); in BeginSourceFile()
180 if (!BeginInvocation(CI)) in BeginSourceFile()
191 IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics()); in BeginSourceFile()
194 ASTUnit::LoadFromASTFile(InputFile, Diags, CI.getFileSystemOpts()); in BeginSourceFile()
200 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr); in BeginSourceFile()
205 CI.setFileManager(&AST->getFileManager()); in BeginSourceFile()
206 CI.setSourceManager(&AST->getSourceManager()); in BeginSourceFile()
207 CI.setPreprocessor(&AST->getPreprocessor()); in BeginSourceFile()
208 CI.setASTContext(&AST->getASTContext()); in BeginSourceFile()
213 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
217 CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile)); in BeginSourceFile()
218 if (!CI.hasASTConsumer()) in BeginSourceFile()
224 if (!CI.hasVirtualFileSystem()) { in BeginSourceFile()
226 createVFSFromCompilerInvocation(CI.getInvocation(), in BeginSourceFile()
227 CI.getDiagnostics())) in BeginSourceFile()
228 CI.setVirtualFileSystem(VFS); in BeginSourceFile()
234 if (!CI.hasFileManager()) in BeginSourceFile()
235 CI.createFileManager(); in BeginSourceFile()
236 if (!CI.hasSourceManager()) in BeginSourceFile()
237 CI.createSourceManager(CI.getFileManager()); in BeginSourceFile()
245 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr); in BeginSourceFile()
249 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
253 if (!CI.InitializeSourceManager(CurrentInput)) in BeginSourceFile()
261 if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { in BeginSourceFile()
262 FileManager &FileMgr = CI.getFileManager(); in BeginSourceFile()
263 PreprocessorOptions &PPOpts = CI.getPreprocessorOpts(); in BeginSourceFile()
265 std::string SpecificModuleCachePath = CI.getSpecificModuleCachePath(); in BeginSourceFile()
275 CI.getLangOpts(), in BeginSourceFile()
276 CI.getTargetOpts(), in BeginSourceFile()
277 CI.getPreprocessorOpts(), in BeginSourceFile()
286 CI.getDiagnostics().Report(diag::err_fe_no_pch_in_dir) << PCHInclude; in BeginSourceFile()
295 CI.createPreprocessor(getTranslationUnitKind()); in BeginSourceFile()
298 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), in BeginSourceFile()
299 &CI.getPreprocessor()); in BeginSourceFile()
303 if (!BeginSourceFileAction(CI, InputFile)) in BeginSourceFile()
308 if (!CI.InitializeSourceManager(CurrentInput)) in BeginSourceFile()
316 CI.createASTContext(); in BeginSourceFile()
319 CreateWrappedASTConsumer(CI, InputFile); in BeginSourceFile()
325 CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener()); in BeginSourceFile()
327 if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) { in BeginSourceFile()
330 source = createChainedIncludesSource(CI, FinalReader); in BeginSourceFile()
333 CI.setModuleManager(static_cast<ASTReader *>(FinalReader.get())); in BeginSourceFile()
334 CI.getASTContext().setExternalSource(source); in BeginSourceFile()
335 } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { in BeginSourceFile()
341 if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls) { in BeginSourceFile()
346 if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty()) { in BeginSourceFile()
348 CI.getASTContext(), in BeginSourceFile()
349 CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn, in BeginSourceFile()
353 CI.createPCHExternalASTSource( in BeginSourceFile()
354 CI.getPreprocessorOpts().ImplicitPCHInclude, in BeginSourceFile()
355 CI.getPreprocessorOpts().DisablePCHValidation, in BeginSourceFile()
356 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, DeserialListener, in BeginSourceFile()
358 if (!CI.getASTContext().getExternalSource()) in BeginSourceFile()
362 CI.setASTConsumer(std::move(Consumer)); in BeginSourceFile()
363 if (!CI.hasASTConsumer()) in BeginSourceFile()
369 if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) { in BeginSourceFile()
370 Preprocessor &PP = CI.getPreprocessor(); in BeginSourceFile()
375 if (CI.getLangOpts().Modules) in BeginSourceFile()
376 CI.createModuleManager(); in BeginSourceFile()
383 assert((!CI.getLangOpts().Modules || CI.getModuleManager()) && in BeginSourceFile()
389 for (const auto &Filename : CI.getFrontendOpts().ModuleMapFiles) { in BeginSourceFile()
390 if (auto *File = CI.getFileManager().getFile(Filename)) in BeginSourceFile()
391 CI.getPreprocessor().getHeaderSearchInfo().loadModuleMapFile( in BeginSourceFile()
394 CI.getDiagnostics().Report(diag::err_module_map_not_found) << Filename; in BeginSourceFile()
398 for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles) in BeginSourceFile()
399 if (!CI.loadModuleFile(ModuleFile)) in BeginSourceFile()
404 if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() && in BeginSourceFile()
405 CI.hasASTContext() && !CI.getASTContext().getExternalSource()) { in BeginSourceFile()
408 CI.getFrontendOpts().OverrideRecordLayoutsFile)); in BeginSourceFile()
409 CI.getASTContext().setExternalSource(Override); in BeginSourceFile()
418 CI.setASTContext(nullptr); in BeginSourceFile()
419 CI.setPreprocessor(nullptr); in BeginSourceFile()
420 CI.setSourceManager(nullptr); in BeginSourceFile()
421 CI.setFileManager(nullptr); in BeginSourceFile()
425 CI.getDiagnosticClient().EndSourceFile(); in BeginSourceFile()
426 CI.clearOutputFiles(/*EraseFiles=*/true); in BeginSourceFile()
433 CompilerInstance &CI = getCompilerInstance(); in Execute() local
435 if (CI.hasFrontendTimer()) { in Execute()
436 llvm::TimeRegion Timer(CI.getFrontendTimer()); in Execute()
443 if (CI.shouldBuildGlobalModuleIndex() && CI.hasFileManager() && in Execute()
444 CI.hasPreprocessor()) { in Execute()
446 CI.getFileManager(), in Execute()
447 CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath()); in Execute()
454 CompilerInstance &CI = getCompilerInstance(); in EndSourceFile() local
457 CI.getDiagnosticClient().EndSourceFile(); in EndSourceFile()
460 if (CI.hasPreprocessor()) in EndSourceFile()
461 CI.getPreprocessor().EndSourceFile(); in EndSourceFile()
469 bool DisableFree = CI.getFrontendOpts().DisableFree; in EndSourceFile()
472 CI.resetAndLeakSema(); in EndSourceFile()
473 CI.resetAndLeakASTContext(); in EndSourceFile()
475 BuryPointer(CI.takeASTConsumer().get()); in EndSourceFile()
478 CI.setSema(nullptr); in EndSourceFile()
479 CI.setASTContext(nullptr); in EndSourceFile()
481 CI.setASTConsumer(nullptr); in EndSourceFile()
484 if (CI.getFrontendOpts().ShowStats) { in EndSourceFile()
486 CI.getPreprocessor().PrintStats(); in EndSourceFile()
487 CI.getPreprocessor().getIdentifierTable().PrintStats(); in EndSourceFile()
488 CI.getPreprocessor().getHeaderSearchInfo().PrintStats(); in EndSourceFile()
489 CI.getSourceManager().PrintStats(); in EndSourceFile()
495 CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles()); in EndSourceFile()
499 CI.resetAndLeakSema(); in EndSourceFile()
500 CI.resetAndLeakASTContext(); in EndSourceFile()
501 CI.resetAndLeakPreprocessor(); in EndSourceFile()
502 CI.resetAndLeakSourceManager(); in EndSourceFile()
503 CI.resetAndLeakFileManager(); in EndSourceFile()
519 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
520 if (!CI.hasPreprocessor()) in ExecuteAction()
526 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty()) in ExecuteAction()
527 CI.createCodeCompletionConsumer(); in ExecuteAction()
531 if (CI.hasCodeCompletionConsumer()) in ExecuteAction()
532 CompletionConsumer = &CI.getCodeCompletionConsumer(); in ExecuteAction()
534 if (!CI.hasSema()) in ExecuteAction()
535 CI.createSema(getTranslationUnitKind(), CompletionConsumer); in ExecuteAction()
537 ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats, in ExecuteAction()
538 CI.getFrontendOpts().SkipFunctionBodies); in ExecuteAction()
544 PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
550 WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
552 return WrappedAction->CreateASTConsumer(CI, InFile); in CreateASTConsumer()
554 bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) { in BeginInvocation() argument
555 return WrappedAction->BeginInvocation(CI); in BeginInvocation()
557 bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI, in BeginSourceFileAction() argument
560 WrappedAction->setCompilerInstance(&CI); in BeginSourceFileAction()
561 return WrappedAction->BeginSourceFileAction(CI, Filename); in BeginSourceFileAction()