#pragma once #include #include namespace clice { // TODO: class Preamble; std::unique_ptr createInvocation(StringRef filename, StringRef content, llvm::ArrayRef args, Preamble* preamble = nullptr); std::unique_ptr createInstance(std::shared_ptr invocation); /// - build AST /// - build module /// - build preamble /// - build CodeCompletion class Compiler { public: Compiler( // clang::DiagnosticsEngine& engine, llvm::IntrusiveRefCntPtr vfs = llvm::vfs::getRealFileSystem()) : vfs(vfs) {} /// build PreCompiledHeader. void buildPCH(llvm::StringRef filename, llvm::StringRef content, llvm::ArrayRef args); void applyPCH(clang::CompilerInvocation& invocation, llvm::StringRef filename, llvm::StringRef content, llvm::StringRef filepath); /// build PreCompiledModule. void buildPCM(llvm::StringRef filename, llvm::StringRef content, llvm::ArrayRef args); /// build AST. void buildAST(); private: // clang::DiagnosticsEngine& engine; llvm::IntrusiveRefCntPtr vfs; }; } // namespace clice