std::unique_ptr<ASTContext> BuildASTContext(CompilerInstance &CI, SelectorTable &ST, Builtin::Context &BC) { auto AST = llvm::make_unique<ASTContext>( CI.getLangOpts(), CI.getSourceManager(), CI.getPreprocessor().getIdentifierTable(), ST, BC); AST->InitBuiltinTypes(CI.getTarget()); return AST; }
ASTContext::ASTContext(llvm::SourceMgr &SM, LangOptions LangOpts) : SrcMgr(SM), LastSDM(0), LanguageOptions(LangOpts) { TUDecl = TranslationUnitDecl::Create(*this); InitBuiltinTypes(); }