Lines Matching refs:CI
35 CodeCompleteConsumer *GetCodeCompletionConsumer(CompilerInstance &CI) { in GetCodeCompletionConsumer() argument
36 return CI.hasCodeCompletionConsumer() ? &CI.getCodeCompletionConsumer() in GetCodeCompletionConsumer()
40 void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) { in EnsureSemaIsCreated() argument
42 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty()) in EnsureSemaIsCreated()
43 CI.createCodeCompletionConsumer(); in EnsureSemaIsCreated()
45 if (!CI.hasSema()) in EnsureSemaIsCreated()
46 CI.createSema(Action.getTranslationUnitKind(), in EnsureSemaIsCreated()
47 GetCodeCompletionConsumer(CI)); in EnsureSemaIsCreated()
56 InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
68 ASTPrintAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
70 CI.createDefaultOutputFile(false, InFile)) in CreateASTConsumer()
71 return CreateASTPrinter(std::move(OS), CI.getFrontendOpts().ASTDumpFilter); in CreateASTConsumer()
76 ASTDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
78 CI.getFrontendOpts().ASTDumpFilter, in CreateASTConsumer()
79 CI.getFrontendOpts().ASTDumpDecls, in CreateASTConsumer()
80 CI.getFrontendOpts().ASTDumpAll, in CreateASTConsumer()
81 CI.getFrontendOpts().ASTDumpLookups); in CreateASTConsumer()
85 ASTDeclListAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
90 ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
95 GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
97 if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot)) in CreateASTConsumer()
102 CreateOutputFile(CI, InFile, /*ref*/ OutputFile); in CreateASTConsumer()
106 if (!CI.getFrontendOpts().RelocatablePCH) in CreateASTConsumer()
109 const auto &FrontendOpts = CI.getFrontendOpts(); in CreateASTConsumer()
113 CI.getPreprocessor(), OutputFile, Sysroot, in CreateASTConsumer()
115 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors, in CreateASTConsumer()
117 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator( in CreateASTConsumer()
118 CI, InFile, OutputFile, std::move(OS), Buffer)); in CreateASTConsumer()
123 bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI, in ComputeASTConsumerArguments() argument
125 Sysroot = CI.getHeaderSearchOpts().Sysroot; in ComputeASTConsumerArguments()
126 if (CI.getFrontendOpts().RelocatablePCH && Sysroot.empty()) { in ComputeASTConsumerArguments()
127 CI.getDiagnostics().Report(diag::err_relocatable_without_isysroot); in ComputeASTConsumerArguments()
135 GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile, in CreateOutputFile() argument
141 CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true, in CreateOutputFile()
147 OutputFile = CI.getFrontendOpts().OutputFile; in CreateOutputFile()
157 bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) { in BeginSourceFileAction() argument
158 CI.getLangOpts().CompilingPCH = true; in BeginSourceFileAction()
163 GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
165 std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile); in CreateASTConsumer()
169 std::string OutputFile = CI.getFrontendOpts().OutputFile; in CreateASTConsumer()
176 CI.getPreprocessor(), OutputFile, Sysroot, in CreateASTConsumer()
177 Buffer, CI.getFrontendOpts().ModuleFileExtensions, in CreateASTConsumer()
180 +CI.getFrontendOpts().BuildingImplicitModule)); in CreateASTConsumer()
181 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator( in CreateASTConsumer()
182 CI, InFile, OutputFile, std::move(OS), Buffer)); in CreateASTConsumer()
187 CompilerInstance &CI) { in BeginSourceFileAction() argument
188 if (!CI.getLangOpts().Modules) { in BeginSourceFileAction()
189 CI.getDiagnostics().Report(diag::err_module_build_requires_fmodules); in BeginSourceFileAction()
193 return GenerateModuleAction::BeginSourceFileAction(CI); in BeginSourceFileAction()
197 GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI, in CreateOutputFile() argument
201 if (CI.getFrontendOpts().OutputFile.empty()) { in CreateOutputFile()
202 StringRef ModuleMapFile = CI.getFrontendOpts().OriginalModuleMap; in CreateOutputFile()
206 HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo(); in CreateOutputFile()
207 CI.getFrontendOpts().OutputFile = in CreateOutputFile()
208 HS.getCachedModuleFileName(CI.getLangOpts().CurrentModule, in CreateOutputFile()
215 return CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true, in CreateOutputFile()
222 CompilerInstance &CI) { in BeginSourceFileAction() argument
223 if (!CI.getLangOpts().ModulesTS) { in BeginSourceFileAction()
224 CI.getDiagnostics().Report(diag::err_module_interface_requires_modules_ts); in BeginSourceFileAction()
228 CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface); in BeginSourceFileAction()
230 return GenerateModuleAction::BeginSourceFileAction(CI); in BeginSourceFileAction()
234 GenerateModuleInterfaceAction::CreateOutputFile(CompilerInstance &CI, in CreateOutputFile() argument
236 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm"); in CreateOutputFile()
240 CompilerInstance &CI) { in PrepareToExecuteAction() argument
241 if (!CI.getLangOpts().Modules && !CI.getLangOpts().ModulesTS) { in PrepareToExecuteAction()
242 CI.getDiagnostics().Report(diag::err_header_module_requires_modules); in PrepareToExecuteAction()
246 auto &Inputs = CI.getFrontendOpts().Inputs; in PrepareToExecuteAction()
248 return GenerateModuleAction::BeginInvocation(CI); in PrepareToExecuteAction()
258 CI.getDiagnostics().Report(diag::err_module_header_file_not_found) in PrepareToExecuteAction()
276 return GenerateModuleAction::PrepareToExecuteAction(CI); in PrepareToExecuteAction()
280 CompilerInstance &CI) { in BeginSourceFileAction() argument
281 CI.getLangOpts().setCompilingModule(LangOptions::CMK_HeaderModule); in BeginSourceFileAction()
284 auto &HS = CI.getPreprocessor().getHeaderSearchInfo(); in BeginSourceFileAction()
292 CI.getDiagnostics().Report(diag::err_module_header_file_not_found) in BeginSourceFileAction()
298 HS.getModuleMap().createHeaderModule(CI.getLangOpts().CurrentModule, Headers); in BeginSourceFileAction()
300 return GenerateModuleAction::BeginSourceFileAction(CI); in BeginSourceFileAction()
304 GenerateHeaderModuleAction::CreateOutputFile(CompilerInstance &CI, in CreateOutputFile() argument
306 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm"); in CreateOutputFile()
313 SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
318 DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI, in CreateASTConsumer() argument
324 VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
329 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
330 bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0; in ExecuteAction()
331 const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot; in ExecuteAction()
333 CI.getPreprocessor(), &CI.getASTContext(), CI.getPCHContainerReader(), in ExecuteAction()
334 CI.getFrontendOpts().ModuleFileExtensions, in ExecuteAction()
466 TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { in CreateASTConsumer() argument
471 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
477 EnsureSemaIsCreated(CI, *this); in ExecuteAction()
479 CI.getSema().TemplateInstCallbacks.push_back( in ExecuteAction()
683 bool DumpModuleInfoAction::BeginInvocation(CompilerInstance &CI) { in BeginInvocation() argument
686 CI.getHeaderSearchOpts().ModuleFormat = "obj"; in BeginInvocation()
768 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
784 const SourceManager& SM = CI.getSourceManager(); in ExecuteAction()
812 CI.createDefaultOutputFile(BinaryMode, getCurrentFileOrBufferName()); in ExecuteAction()
828 DoPrintPreprocessedInput(CI.getPreprocessor(), OS.get(), in ExecuteAction()
829 CI.getPreprocessorOutputOpts()); in ExecuteAction()
855 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
856 auto Buffer = CI.getFileManager().getBufferForFile(getCurrentFile()); in ExecuteAction()
859 Lexer::ComputePreamble((*Buffer)->getBuffer(), CI.getLangOpts()).Size; in ExecuteAction()
865 CompilerInstance &CI = getCompilerInstance(); in ExecuteAction() local
867 CI.createDefaultOutputFile(false, getCurrentFile()); in ExecuteAction()
872 const Preprocessor &PP = CI.getPreprocessor(); in ExecuteAction()