Lines Matching refs:CI

125 ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
127 ASTConsumer* Consumer = CreateASTConsumer(CI, InFile);
131 if (CI.getFrontendOpts().AddPluginActions.size() == 0)
138 for (size_t i = 0, e = CI.getFrontendOpts().AddPluginActions.size();
146 if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) {
149 if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i]))
150 Consumers.push_back(c->CreateASTConsumer(CI, InFile));
158 bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
163 setCompilerInstance(&CI);
166 if (!BeginInvocation(CI))
177 IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
180 CI.getFileSystemOpts());
188 CI.setFileManager(&AST->getFileManager());
189 CI.setSourceManager(&AST->getSourceManager());
190 CI.setPreprocessor(&AST->getPreprocessor());
191 CI.setASTContext(&AST->getASTContext());
194 if (!BeginSourceFileAction(CI, Input.File))
198 CI.setASTConsumer(CreateWrappedASTConsumer(CI, Input.File));
199 if (!CI.hasASTConsumer())
206 if (!CI.hasFileManager())
207 CI.createFileManager();
208 if (!CI.hasSourceManager())
209 CI.createSourceManager(CI.getFileManager());
217 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
221 if (!BeginSourceFileAction(CI, Input.File))
228 CI.createPreprocessor();
231 CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
232 &CI.getPreprocessor());
236 if (!BeginSourceFileAction(CI, Input.File))
242 CI.createASTContext();
245 CreateWrappedASTConsumer(CI, Input.File));
249 CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
251 if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
254 source.reset(ChainedIncludesSource::create(CI));
257 CI.getASTContext().setExternalSource(source);
259 } else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {
264 if (CI.getPreprocessorOpts().DumpDeserializedPCHDecls)
266 if (!CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn.empty())
267 DeserialListener = new DeserializedDeclsChecker(CI.getASTContext(),
268 CI.getPreprocessorOpts().DeserializedPCHDeclsToErrorOn,
270 CI.createPCHExternalASTSource(
271 CI.getPreprocessorOpts().ImplicitPCHInclude,
272 CI.getPreprocessorOpts().DisablePCHValidation,
273 CI.getPreprocessorOpts().DisableStatCache,
274 CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
276 if (!CI.getASTContext().getExternalSource())
280 CI.setASTConsumer(Consumer.take());
281 if (!CI.hasASTConsumer())
287 if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
288 Preprocessor &PP = CI.getPreprocessor();
295 if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() &&
296 CI.hasASTContext() && !CI.getASTContext().getExternalSource()) {
299 CI.getFrontendOpts().OverrideRecordLayoutsFile));
300 CI.getASTContext().setExternalSource(Override);
309 CI.setASTContext(0);
310 CI.setPreprocessor(0);
311 CI.setSourceManager(0);
312 CI.setFileManager(0);
316 CI.getDiagnosticClient().EndSourceFile();
323 CompilerInstance &CI = getCompilerInstance();
328 if (!CI.InitializeSourceManager(getCurrentFile(),
335 if (CI.hasFrontendTimer()) {
336 llvm::TimeRegion Timer(CI.getFrontendTimer());
345 CompilerInstance &CI = getCompilerInstance();
348 CI.getDiagnosticClient().EndSourceFile();
357 if (CI.getFrontendOpts().DisableFree) {
358 CI.takeASTConsumer();
360 CI.takeSema();
361 CI.resetAndLeakASTContext();
365 CI.setSema(0);
366 CI.setASTContext(0);
368 CI.setASTConsumer(0);
372 if (CI.hasPreprocessor())
373 CI.getPreprocessor().EndSourceFile();
375 if (CI.getFrontendOpts().ShowStats) {
377 CI.getPreprocessor().PrintStats();
378 CI.getPreprocessor().getIdentifierTable().PrintStats();
379 CI.getPreprocessor().getHeaderSearchInfo().PrintStats();
380 CI.getSourceManager().PrintStats();
386 CI.clearOutputFiles(/*EraseFiles=*/CI.getDiagnostics().hasErrorOccurred());
389 CI.takeSema();
390 CI.resetAndLeakASTContext();
391 CI.resetAndLeakPreprocessor();
392 CI.resetAndLeakSourceManager();
393 CI.resetAndLeakFileManager();
405 CompilerInstance &CI = getCompilerInstance();
410 !CI.getFrontendOpts().CodeCompletionAt.FileName.empty())
411 CI.createCodeCompletionConsumer();
415 if (CI.hasCodeCompletionConsumer())
416 CompletionConsumer = &CI.getCodeCompletionConsumer();
418 if (!CI.hasSema())
419 CI.createSema(getTranslationUnitKind(), CompletionConsumer);
421 ParseAST(CI.getSema(), CI.getFrontendOpts().ShowStats,
422 CI.getFrontendOpts().SkipFunctionBodies);
428 PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
433 ASTConsumer *WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI,
435 return WrappedAction->CreateASTConsumer(CI, InFile);
437 bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) {
438 return WrappedAction->BeginInvocation(CI);
440 bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI,
443 WrappedAction->setCompilerInstance(&CI);
444 return WrappedAction->BeginSourceFileAction(CI, Filename);