Home | History | Annotate | Download | only in Frontend

Lines Matching refs:CI

37 CodeCompleteConsumer *GetCodeCompletionConsumer(CompilerInstance &CI) {
38 return CI.hasCodeCompletionConsumer() ? &CI.getCodeCompletionConsumer()
42 void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) {
44 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
45 CI.createCodeCompletionConsumer();
47 if (!CI.hasSema())
48 CI.createSema(Action.getTranslationUnitKind(),
49 GetCodeCompletionConsumer(CI));
58 InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
70 ASTPrintAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
72 CI.createDefaultOutputFile(false, InFile))
73 return CreateASTPrinter(std::move(OS), CI.getFrontendOpts().ASTDumpFilter);
78 ASTDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
79 const FrontendOptions &Opts = CI.getFrontendOpts();
87 ASTDeclListAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
92 ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
97 GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
99 if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot))
104 CreateOutputFile(CI, InFile, /*ref*/ OutputFile);
108 if (!CI.getFrontendOpts().RelocatablePCH)
111 const auto &FrontendOpts = CI.getFrontendOpts();
115 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
117 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
118 FrontendOpts.IncludeTimestamps, +CI.getLangOpts().CacheGeneratedPCH));
119 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
120 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
125 bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
127 Sysroot = CI.getHeaderSearchOpts().Sysroot;
128 if (CI.getFrontendOpts().RelocatablePCH && Sysroot.empty()) {
129 CI.getDiagnostics().Report(diag::err_relocatable_without_isysroot);
137 GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile,
140 std::unique_ptr<raw_pwrite_stream> OS = CI.createDefaultOutputFile(
145 OutputFile = CI.getFrontendOpts().OutputFile;
155 bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) {
156 CI.getLangOpts().CompilingPCH = true;
161 GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
163 std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile);
167 std::string OutputFile = CI.getFrontendOpts().OutputFile;
174 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
175 CI.getFrontendOpts().ModuleFileExtensions,
177 +CI.getFrontendOpts().AllowPCMWithCompilerErrors,
179 +CI.getFrontendOpts().BuildingImplicitModule,
181 +CI.getFrontendOpts().BuildingImplicitModule));
182 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
183 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
193 CompilerInstance &CI) {
194 if (!CI.getLangOpts().Modules) {
195 CI.getDiagnostics().Report(diag::err_module_build_requires_fmodules);
199 return GenerateModuleAction::BeginSourceFileAction(CI);
203 GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
207 if (CI.getFrontendOpts().OutputFile.empty()) {
208 StringRef ModuleMapFile = CI.getFrontendOpts().OriginalModuleMap;
212 HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo();
213 CI.getFrontendOpts().OutputFile =
214 HS.getCachedModuleFileName(CI.getLangOpts().CurrentModule,
219 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, /*Extension=*/"",
225 CompilerInstance &CI) {
226 if (!CI.getLangOpts().ModulesTS && !CI.getLangOpts().CPlusPlusModules) {
227 CI.getDiagnostics().Report(diag::err_module_interface_requires_cpp_modules);
231 CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
233 return GenerateModuleAction::BeginSourceFileAction(CI);
237 GenerateModuleInterfaceAction::CreateOutputFile(CompilerInstance &CI,
239 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
243 CompilerInstance &CI) {
244 if (!CI.getLangOpts().Modules) {
245 CI.getDiagnostics().Report(diag::err_header_module_requires_modules);
249 auto &Inputs = CI.getFrontendOpts().Inputs;
251 return GenerateModuleAction::BeginInvocation(CI);
261 CI.getDiagnostics().Report(diag::err_module_header_file_not_found)
280 return GenerateModuleAction::PrepareToExecuteAction(CI);
284 CompilerInstance &CI) {
285 CI.getLangOpts().setCompilingModule(LangOptions::CMK_HeaderModule);
288 auto &HS = CI.getPreprocessor().getHeaderSearchInfo();
296 CI.getDiagnostics().Report(diag::err_module_header_file_not_found)
303 HS.getModuleMap().createHeaderModule(CI.getLangOpts().CurrentModule, Headers);
305 return GenerateModuleAction::BeginSourceFileAction(CI);
309 GenerateHeaderModuleAction::CreateOutputFile(CompilerInstance &CI,
311 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
318 SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
323 DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI,
329 VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
334 CompilerInstance &CI = getCompilerInstance();
335 bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
336 const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot;
338 CI.getPreprocessor(), CI.getModuleCache(), &CI.getASTContext(),
339 CI.getPCHContainerReader(), CI.getFrontendOpts().ModuleFileExtensions,
494 TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
499 CompilerInstance &CI = getCompilerInstance();
505 EnsureSemaIsCreated(CI, *this);
507 CI.getSema().TemplateInstCallbacks.push_back(
712 bool DumpModuleInfoAction::BeginInvocation(CompilerInstance &CI) {
715 CI.getHeaderSearchOpts().ModuleFormat = "obj";
797 CompilerInstance &CI = getCompilerInstance();
815 const SourceManager &SM = CI.getSourceManager();
844 CI.createDefaultOutputFile(BinaryMode, getCurrentFileOrBufferName());
860 DoPrintPreprocessedInput(CI.getPreprocessor(), OS.get(),
861 CI.getPreprocessorOutputOpts());
888 CompilerInstance &CI = getCompilerInstance();
889 auto Buffer = CI.getFileManager().getBufferForFile(getCurrentFile());
892 Lexer::ComputePreamble((*Buffer)->getBuffer(), CI.getLangOpts()).Size;
898 CompilerInstance &CI = getCompilerInstance();
900 CI.createDefaultOutputFile(false, getCurrentFile());
905 const Preprocessor &PP = CI.getPreprocessor();
946 CompilerInstance &CI = getCompilerInstance();
947 SourceManager &SM = CI.getPreprocessor().getSourceManager();
953 FromFile.getBuffer(), Output, Toks, &CI.getDiagnostics(),
955 assert(CI.getDiagnostics().hasErrorOccurred() &&
960 if (CI.getDiagnosticOpts().VerifyDiagnostics) {
962 CI.getDiagnostics().setSuppressAllDiagnostics(true);