reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Frontend/FrontendAction.cpp
  543   setCompilerInstance(&CI);
  548   if (!BeginInvocation(CI))
  554     IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
  566         InputFile, CI.getPCHContainerReader(), ASTUnit::LoadPreprocessorOnly,
  567         ASTDiags, CI.getFileSystemOpts(), CI.getCodeGenOpts().DebugTypeExtRefs);
  567         ASTDiags, CI.getFileSystemOpts(), CI.getCodeGenOpts().DebugTypeExtRefs);
  573     CI.getHeaderSearchOpts() = AST->getHeaderSearchOpts();
  574     CI.getPreprocessorOpts() = AST->getPreprocessorOpts();
  575     CI.getLangOpts() = AST->getLangOpts();
  579     CI.setFileManager(&AST->getFileManager());
  580     CI.createSourceManager(CI.getFileManager());
  580     CI.createSourceManager(CI.getFileManager());
  581     CI.getSourceManager().initializeForReplay(AST->getSourceManager());
  592           CI.getFrontendOpts().ModuleFiles.push_back(MF.FileName);
  596         CI.getFrontendOpts().ModuleMapFiles.push_back(FE->getName());
  626     IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
  632         InputFile, CI.getPCHContainerReader(), ASTUnit::LoadEverything, Diags,
  633         CI.getFileSystemOpts(), CI.getCodeGenOpts().DebugTypeExtRefs);
  633         CI.getFileSystemOpts(), CI.getCodeGenOpts().DebugTypeExtRefs);
  639     CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  639     CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  644     CI.setFileManager(&AST->getFileManager());
  645     CI.setSourceManager(&AST->getSourceManager());
  646     CI.setPreprocessor(AST->getPreprocessorPtr());
  647     Preprocessor &PP = CI.getPreprocessor();
  650     CI.setASTContext(&AST->getASTContext());
  655     if (!BeginSourceFileAction(CI))
  659     CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile));
  659     CI.setASTConsumer(CreateWrappedASTConsumer(CI, InputFile));
  660     if (!CI.hasASTConsumer())
  667   if (!CI.hasFileManager()) {
  668     if (!CI.createFileManager()) {
  672   if (!CI.hasSourceManager())
  673     CI.createSourceManager(CI.getFileManager());
  673     CI.createSourceManager(CI.getFileManager());
  677   for (const auto &F : CI.getFrontendOpts().ModulesEmbedFiles) {
  678     if (auto FE = CI.getFileManager().getFile(F, /*openFile*/true))
  679       CI.getSourceManager().setFileIsTransient(*FE);
  681       CI.getDiagnostics().Report(diag::err_modules_embed_file_not_found) << F;
  683   if (CI.getFrontendOpts().ModulesEmbedAllFiles)
  684     CI.getSourceManager().setAllFilesAreTransient(true);
  692     CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  692     CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), nullptr);
  696     if (!BeginSourceFileAction(CI))
  700     if (!CI.InitializeSourceManager(CurrentInput))
  708   if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
  709     FileManager &FileMgr = CI.getFileManager();
  710     PreprocessorOptions &PPOpts = CI.getPreprocessorOpts();
  712     std::string SpecificModuleCachePath = CI.getSpecificModuleCachePath();
  724                 Dir->path(), FileMgr, CI.getPCHContainerReader(),
  725                 CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(),
  725                 CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(),
  725                 CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(),
  734         CI.getDiagnostics().Report(diag::err_fe_no_pch_in_dir) << PCHInclude;
  743     CI.createPreprocessor(getTranslationUnitKind());
  746   CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
  746   CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
  747                                            &CI.getPreprocessor());
  751   if (!CI.InitializeSourceManager(Input))
  757     CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleMap);
  761     if (loadModuleMapForModuleBuild(CI, Input.isSystem(),
  766     auto *CurrentModule = prepareToBuildModule(CI, Input.getFile());
  774       CI.getPreprocessor().setSkipMainFilePreamble(OffsetToContents, true);
  777       auto Buffer = getInputBufferForModule(CI, CurrentModule);
  783       auto &SourceMgr = CI.getSourceManager();
  791   if (!BeginSourceFileAction(CI))
  795   for (const auto &Filename : CI.getFrontendOpts().ModuleMapFiles) {
  796     if (auto File = CI.getFileManager().getFile(Filename))
  797       CI.getPreprocessor().getHeaderSearchInfo().loadModuleMapFile(
  800       CI.getDiagnostics().Report(diag::err_module_map_not_found) << Filename;
  805   CI.getPreprocessor()
  815       CI.createASTContext();
  821       ReadOriginalFileName(CI, PresumedInputFile);
  824         CreateWrappedASTConsumer(CI, PresumedInputFile);
  830       CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
  832     if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
  835       source = createChainedIncludesSource(CI, FinalReader);
  838       CI.setModuleManager(static_cast<ASTReader *>(FinalReader.get()));
  839       CI.getASTContext().setExternalSource(source);
  840     } else if (CI.getLangOpts().Modules ||
  841                !CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
  847       if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls) {
  852       if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty()) {
  854             CI.getASTContext(),
  855             CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn,
  859       if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
  860         CI.createPCHExternalASTSource(
  861             CI.getPreprocessorOpts().ImplicitPCHInclude,
  862             CI.getPreprocessorOpts().DisablePCHValidation,
  863           CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, DeserialListener,
  865         if (!CI.getASTContext().getExternalSource())
  871       if (CI.getLangOpts().Modules || !CI.hasASTContext() ||
  871       if (CI.getLangOpts().Modules || !CI.hasASTContext() ||
  872           !CI.getASTContext().getExternalSource()) {
  873         CI.createModuleManager();
  874         CI.getModuleManager()->setDeserializationListener(DeserialListener,
  879     CI.setASTConsumer(std::move(Consumer));
  880     if (!CI.hasASTConsumer())
  886   if (CI.getLangOpts().Modules || !CI.hasASTContext() ||
  886   if (CI.getLangOpts().Modules || !CI.hasASTContext() ||
  887       !CI.getASTContext().getExternalSource()) {
  888     Preprocessor &PP = CI.getPreprocessor();
  894     assert((!CI.getLangOpts().Modules || CI.getModuleManager()) &&
  894     assert((!CI.getLangOpts().Modules || CI.getModuleManager()) &&
  900   for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles)
  901     if (!CI.loadModuleFile(ModuleFile))
  906   if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() &&
  907       CI.hasASTContext() && !CI.getASTContext().getExternalSource()) {
  907       CI.hasASTContext() && !CI.getASTContext().getExternalSource()) {
  910                      CI.getFrontendOpts().OverrideRecordLayoutsFile));
  911     CI.getASTContext().setExternalSource(Override);
  920     CI.getDiagnosticClient().EndSourceFile();
  921   CI.clearOutputFiles(/*EraseFiles=*/true);
  922   CI.getLangOpts().setCompilingModule(LangOptions::CMK_None);