Lines Matching defs:CI

222 BuildASTContext(CompilerInstance &CI, SelectorTable &ST, Builtin::Context &BC) {
223 auto &PP = CI.getPreprocessor();
225 CI.getLangOpts(), CI.getSourceManager(),
227 AST->InitBuiltinTypes(CI.getTarget());
231 std::unique_ptr<CodeGenerator> BuildCodeGen(CompilerInstance &CI,
235 CI.getDiagnostics(), ModuleName, &CI.getVirtualFileSystem(),
236 CI.getHeaderSearchOpts(), CI.getPreprocessorOpts(), CI.getCodeGenOpts(),
253 std::unique_ptr<CompilerInstance> CI;
255 ASTContext &getASTContext() { return CI->getASTContext(); }
256 FileManager &getFileManager() { return CI->getFileManager(); }
259 if (ExternalASTSource *Source = CI->getASTContext().getExternalSource())
264 return CI->getDiagnosticClient();
266 CompilerInstance &getCompilerInstance() { return *CI; }
269 void AddExternalSource(CIAndOrigins &CI,
272 {CI.getASTContext(), CI.getFileManager()});
278 CI.getASTContext().setExternalSource(ES.release());
279 CI.getASTContext().getTranslationUnitDecl()->setHasExternalVisibleStorage();
282 CIAndOrigins BuildIndirect(CIAndOrigins &CI) {
289 AddExternalSource(IndirectCI, CI);
293 llvm::Error ParseSource(const std::string &Path, CompilerInstance &CI,
295 SourceManager &SM = CI.getSourceManager();
296 auto FE = CI.getFileManager().getFileRef(Path);
303 ParseAST(CI.getPreprocessor(), &Consumer, CI.getASTContext());
310 CIAndOrigins CI{init_convenience::BuildCompilerInstance()};
314 init_convenience::BuildASTContext(CI.getCompilerInstance(), *ST, *BC);
315 CI.getCompilerInstance().setASTContext(AST.release());
317 AddExternalSource(CI, Imports);
323 init_convenience::BuildCodeGen(CI.getCompilerInstance(), *LLVMCtx));
331 CI.getDiagnosticClient().BeginSourceFile(
332 CI.getCompilerInstance().getLangOpts(),
333 &CI.getCompilerInstance().getPreprocessor());
335 Consumers.Initialize(CI.getASTContext());
337 if (llvm::Error PE = ParseSource(Path, CI.getCompilerInstance(), Consumers))
339 CI.getDiagnosticClient().EndSourceFile();
342 if (CI.getDiagnosticClient().getNumErrors())
345 return std::move(CI);
348 void Forget(CIAndOrigins &CI, llvm::MutableArrayRef<CIAndOrigins> Imports) {
353 ExternalASTSource *Source = CI.CI->getASTContext().getExternalSource();