Lines Matching defs:CI
42 CodeCompleteConsumer *GetCodeCompletionConsumer(CompilerInstance &CI) {
43 return CI.hasCodeCompletionConsumer() ? &CI.getCodeCompletionConsumer()
47 void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) {
49 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
50 CI.createCodeCompletionConsumer();
52 if (!CI.hasSema())
53 CI.createSema(Action.getTranslationUnitKind(),
54 GetCodeCompletionConsumer(CI));
63 InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
86 ReadPCHAndPreprocessAction::CreateASTConsumer(CompilerInstance &CI,
96 ASTPrintAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
98 CI.createDefaultOutputFile(false, InFile))
99 return CreateASTPrinter(std::move(OS), CI.getFrontendOpts().ASTDumpFilter);
104 ASTDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
105 const FrontendOptions &Opts = CI.getFrontendOpts();
113 ASTDeclListAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
118 ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
123 GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
125 if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot))
130 CreateOutputFile(CI, InFile, /*ref*/ OutputFile);
134 if (!CI.getFrontendOpts().RelocatablePCH)
137 const auto &FrontendOpts = CI.getFrontendOpts();
141 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
143 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
145 +CI.getLangOpts().CacheGeneratedPCH));
146 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
147 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
152 bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
154 Sysroot = CI.getHeaderSearchOpts().Sysroot;
155 if (CI.getFrontendOpts().RelocatablePCH && Sysroot.empty()) {
156 CI.getDiagnostics().Report(diag::err_relocatable_without_isysroot);
164 GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile,
167 std::unique_ptr<raw_pwrite_stream> OS = CI.createDefaultOutputFile(
172 OutputFile = CI.getFrontendOpts().OutputFile;
182 bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) {
183 CI.getLangOpts().CompilingPCH = true;
188 GenerateModuleAction::CreateMultiplexConsumer(CompilerInstance &CI,
190 std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile);
194 std::string OutputFile = CI.getFrontendOpts().OutputFile;
201 CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
202 CI.getFrontendOpts().ModuleFileExtensions,
204 +CI.getFrontendOpts().AllowPCMWithCompilerErrors,
206 +CI.getFrontendOpts().BuildingImplicitModule &&
207 +CI.getFrontendOpts().IncludeTimestamps,
208 /*BuildingImplicitModule=*/+CI.getFrontendOpts().BuildingImplicitModule,
210 +CI.getFrontendOpts().BuildingImplicitModule));
211 Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
212 CI, std::string(InFile), OutputFile, std::move(OS), Buffer));
217 GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
220 CreateMultiplexConsumer(CI, InFile);
233 CompilerInstance &CI) {
234 if (!CI.getLangOpts().Modules) {
235 CI.getDiagnostics().Report(diag::err_module_build_requires_fmodules);
239 return GenerateModuleAction::BeginSourceFileAction(CI);
243 GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
247 if (CI.getFrontendOpts().OutputFile.empty()) {
248 StringRef ModuleMapFile = CI.getFrontendOpts().OriginalModuleMap;
252 HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo();
253 CI.getFrontendOpts().OutputFile =
254 HS.getCachedModuleFileName(CI.getLangOpts().CurrentModule,
259 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, /*Extension=*/"",
266 CompilerInstance &CI) {
267 CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);
269 return GenerateModuleAction::BeginSourceFileAction(CI);
273 GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
277 if (CI.getFrontendOpts().GenReducedBMI &&
278 !CI.getFrontendOpts().ModuleOutputPath.empty()) {
280 CI.getPreprocessor(), CI.getModuleCache(),
281 CI.getFrontendOpts().ModuleOutputPath));
285 CI.getPreprocessor(), CI.getModuleCache(),
286 CI.getFrontendOpts().OutputFile));
292 GenerateModuleInterfaceAction::CreateOutputFile(CompilerInstance &CI,
294 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
298 GenerateReducedModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
300 return std::make_unique<ReducedBMIGenerator>(CI.getPreprocessor(),
301 CI.getModuleCache(),
302 CI.getFrontendOpts().OutputFile);
305 bool GenerateHeaderUnitAction::BeginSourceFileAction(CompilerInstance &CI) {
306 if (!CI.getLangOpts().CPlusPlusModules) {
307 CI.getDiagnostics().Report(diag::err_module_interface_requires_cpp_modules);
310 CI.getLangOpts().setCompilingModule(LangOptions::CMK_HeaderUnit);
311 return GenerateModuleAction::BeginSourceFileAction(CI);
315 GenerateHeaderUnitAction::CreateOutputFile(CompilerInstance &CI,
317 return CI.createDefaultOutputFile(/*Binary=*/true, InFile, "pcm");
324 SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
329 DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI,
335 VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
340 CompilerInstance &CI = getCompilerInstance();
341 bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
342 const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot;
344 CI.getPreprocessor(), CI.getModuleCache(), &CI.getASTContext(),
345 CI.getPCHContainerReader(), CI.getFrontendOpts().ModuleFileExtensions,
579 TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
584 CompilerInstance &CI = getCompilerInstance();
590 EnsureSemaIsCreated(CI, *this);
592 CI.getSema().TemplateInstCallbacks.push_back(
812 bool DumpModuleInfoAction::BeginInvocation(CompilerInstance &CI) {
815 CI.getHeaderSearchOpts().ModuleFormat = "obj";
844 CompilerInstance &CI = getCompilerInstance();
848 CI.getDiagnostics().Report(diag::err_file_is_not_module)
854 StringRef OutputFileName = CI.getFrontendOpts().OutputFile;
863 auto &FileMgr = CI.getFileManager();
869 Preprocessor &PP = CI.getPreprocessor();
966 getCurrentFile(), FileMgr, CI.getModuleCache(),
967 CI.getPCHContainerReader(),
1021 CompilerInstance &CI = getCompilerInstance();
1039 const SourceManager &SM = CI.getSourceManager();
1068 CI.createDefaultOutputFile(BinaryMode, getCurrentFileOrBufferName());
1084 DoPrintPreprocessedInput(CI.getPreprocessor(), OS.get(),
1085 CI.getPreprocessorOutputOpts());
1114 CompilerInstance &CI = getCompilerInstance();
1115 auto Buffer = CI.getFileManager().getBufferForFile(getCurrentFile());
1118 Lexer::ComputePreamble((*Buffer)->getBuffer(), CI.getLangOpts()).Size;
1124 CompilerInstance &CI = getCompilerInstance();
1126 CI.createDefaultOutputFile(false, getCurrentFile());
1131 const Preprocessor &PP = CI.getPreprocessor();
1172 CompilerInstance &CI = getCompilerInstance();
1173 SourceManager &SM = CI.getPreprocessor().getSourceManager();
1179 FromFile.getBuffer(), Tokens, Directives, &CI.getDiagnostics(),
1181 assert(CI.getDiagnostics().hasErrorOccurred() &&
1186 if (CI.getDiagnosticOpts().VerifyDiagnostics) {
1188 CI.getDiagnostics().setSuppressAllDiagnostics(true);
1203 CompilerInstance &CI = getCompilerInstance();
1204 Preprocessor &PP = CI.getPreprocessor();
1211 auto ModResult = CI.loadModule(FileStart, Path, Module::Hidden, false);