Lines Matching defs:CI
43 CodeCompleteConsumer *GetCodeCompletionConsumer(CompilerInstance &CI) {
44 return CI.hasCodeCompletionConsumer() ? &CI.getCodeCompletionConsumer()
48 void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) {
50 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
51 CI.createCodeCompletionConsumer();
53 if (!CI.hasSema())
54 CI.createSema(Action.getTranslationUnitKind(),
55 GetCodeCompletionConsumer(CI));
64 InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
87 ReadPCHAndPreprocessAction::CreateASTConsumer(CompilerInstance &CI,
97 ASTPrintAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
99 CI.createDefaultOutputFile(false, InFile))
100 return CreateASTPrinter(std::move(OS), CI.getFrontendOpts().ASTDumpFilter);
105 ASTDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
106 const FrontendOptions &Opts = CI.getFrontendOpts();
114 ASTDeclListAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
119 ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
124 GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
126 if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot))
131 CreateOutputFile(CI, InFile, /*ref*/ OutputFile);
135 if (!CI.getFrontendOpts().RelocatablePCH)
138 const auto &FrontendOpts = CI.getFrontendOpts();
142 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
144 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
146 +CI.getLangOpts().CacheGeneratedPCH));
147 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
148 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
153 bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
155 Sysroot = CI.getHeaderSearchOpts().Sysroot;
156 if (CI.getFrontendOpts().RelocatablePCH && Sysroot.empty()) {
157 CI.getDiagnostics().Report(diag::err_relocatable_without_isysroot);
165 GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile,
168 std::unique_ptr<raw_pwrite_stream> OS = CI.createDefaultOutputFile(
173 OutputFile = CI.getFrontendOpts().OutputFile;
183 bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) {
184 CI.getLangOpts().CompilingPCH = true;
189 GenerateModuleAction::CreateMultiplexConsumer(CompilerInstance &CI,
191 std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile);
195 std::string OutputFile = CI.getFrontendOpts().OutputFile;
202 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
203 CI.getFrontendOpts().ModuleFileExtensions,
205 +CI.getFrontendOpts().AllowPCMWithCompilerErrors,
207 +CI.getFrontendOpts().BuildingImplicitModule &&
208 +CI.getFrontendOpts().IncludeTimestamps,
209 /*BuildingImplicitModule=*/+CI.getFrontendOpts().BuildingImplicitModule,
211 +CI.getFrontendOpts().BuildingImplicitModule));
212 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
213 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
218 GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
221 CreateMultiplexConsumer(CI, InFile);
234 CompilerInstance &CI) {
235 if (!CI.getLangOpts().Modules) {
236 CI.getDiagnostics().Report(diag::err_module_build_requires_fmodules);
240 return GenerateModuleAction::BeginSourceFileAction(CI);
244 GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
248 if (CI.getFrontendOpts().OutputFile.empty()) {
249 StringRef ModuleMapFile = CI.getFrontendOpts().OriginalModuleMap;
253 HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo();
254 CI.getFrontendOpts().OutputFile =
255 HS.getCachedModuleFileName(CI.getLangOpts().CurrentModule,
260 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, /*Extension=*/"",
267 CompilerInstance &CI) {
268 CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
270 return GenerateModuleAction::BeginSourceFileAction(CI);
274 GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
278 if (CI.getFrontendOpts().GenReducedBMI &&
279 !CI.getFrontendOpts().ModuleOutputPath.empty()) {
281 CI.getPreprocessor(), CI.getModuleCache(),
282 CI.getFrontendOpts().ModuleOutputPath,
283 +CI.getFrontendOpts().AllowPCMWithCompilerErrors));
287 CI.getPreprocessor(), CI.getModuleCache(),
288 CI.getFrontendOpts().OutputFile,
289 +CI.getFrontendOpts().AllowPCMWithCompilerErrors));
295 GenerateModuleInterfaceAction::CreateOutputFile(CompilerInstance &CI,
297 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
301 GenerateReducedModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
303 return std::make_unique<ReducedBMIGenerator>(CI.getPreprocessor(),
304 CI.getModuleCache(),
305 CI.getFrontendOpts().OutputFile);
308 bool GenerateHeaderUnitAction::BeginSourceFileAction(CompilerInstance &CI) {
309 if (!CI.getLangOpts().CPlusPlusModules) {
310 CI.getDiagnostics().Report(diag::err_module_interface_requires_cpp_modules);
313 CI.getLangOpts().setCompilingModule(LangOptions::CMK_HeaderUnit);
314 return GenerateModuleAction::BeginSourceFileAction(CI);
318 GenerateHeaderUnitAction::CreateOutputFile(CompilerInstance &CI,
320 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
327 SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
332 DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI,
338 VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
343 CompilerInstance &CI = getCompilerInstance();
344 bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
345 const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot;
347 CI.getPreprocessor(), CI.getModuleCache(), &CI.getASTContext(),
348 CI.getPCHContainerReader(), CI.getFrontendOpts().ModuleFileExtensions,
584 TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
589 CompilerInstance &CI = getCompilerInstance();
595 EnsureSemaIsCreated(CI, *this);
597 CI.getSema().TemplateInstCallbacks.push_back(
822 bool DumpModuleInfoAction::BeginInvocation(CompilerInstance &CI) {
825 CI.getHeaderSearchOpts().ModuleFormat = "obj";
854 CompilerInstance &CI = getCompilerInstance();
858 CI.getDiagnostics().Report(diag::err_file_is_not_module)
864 StringRef OutputFileName = CI.getFrontendOpts().OutputFile;
873 auto &FileMgr = CI.getFileManager();
879 Preprocessor &PP = CI.getPreprocessor();
976 getCurrentFile(), FileMgr, CI.getModuleCache(),
977 CI.getPCHContainerReader(),
1031 CompilerInstance &CI = getCompilerInstance();
1049 const SourceManager &SM = CI.getSourceManager();
1078 CI.createDefaultOutputFile(BinaryMode, getCurrentFileOrBufferName());
1094 DoPrintPreprocessedInput(CI.getPreprocessor(), OS.get(),
1095 CI.getPreprocessorOutputOpts());
1123 CompilerInstance &CI = getCompilerInstance();
1124 auto Buffer = CI.getFileManager().getBufferForFile(getCurrentFile());
1127 Lexer::ComputePreamble((*Buffer)->getBuffer(), CI.getLangOpts()).Size;
1133 CompilerInstance &CI = getCompilerInstance();
1135 CI.createDefaultOutputFile(false, getCurrentFile());
1140 const Preprocessor &PP = CI.getPreprocessor();
1181 CompilerInstance &CI = getCompilerInstance();
1182 SourceManager &SM = CI.getPreprocessor().getSourceManager();
1188 FromFile.getBuffer(), Tokens, Directives, &CI.getDiagnostics(),
1190 assert(CI.getDiagnostics().hasErrorOccurred() &&
1195 if (CI.getDiagnosticOpts().VerifyDiagnostics) {
1197 CI.getDiagnostics().setSuppressAllDiagnostics(true);
1212 CompilerInstance &CI = getCompilerInstance();
1213 Preprocessor &PP = CI.getPreprocessor();
1220 auto ModResult = CI.loadModule(FileStart, Path, Module::Hidden, false);