Go to the documentation of this file.
14 #ifndef LLVM_CLANG_INTERPRETER_INTERPRETER_H
15 #define LLVM_CLANG_INTERPRETER_INTERPRETER_H
21 #include "llvm/ExecutionEngine/JITSymbol.h"
22 #include "llvm/Support/Error.h"
30 class ThreadSafeContext;
36 class CompilerInstance;
37 class IncrementalExecutor;
38 class IncrementalParser;
44 create(std::vector<const char *> &ClangArgv);
49 std::unique_ptr<llvm::orc::ThreadSafeContext> TSCtx;
50 std::unique_ptr<IncrementalParser> IncrParser;
51 std::unique_ptr<IncrementalExecutor> IncrExecutor;
53 Interpreter(std::unique_ptr<CompilerInstance> CI, llvm::Error &Err);
58 create(std::unique_ptr<CompilerInstance> CI);
64 auto PTU =
Parse(Code);
66 return PTU.takeError();
69 return llvm::Error::success();
88 #endif // LLVM_CLANG_INTERPRETER_INTERPRETER_H
YAML serialization mapping.
llvm::Expected< PartialTranslationUnit & > Parse(llvm::StringRef Code)
llvm::Expected< llvm::JITTargetAddress > getSymbolAddressFromLinkerName(llvm::StringRef LinkerName) const
const CompilerInstance * getCompilerInstance() const
GlobalDecl - represents a global declaration.
Provides top-level interfaces for incremental compilation and execution.
llvm::Error ParseAndExecute(llvm::StringRef Code)
Create a pre-configured CompilerInstance for incremental processing.
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress(GlobalDecl GD) const
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
static llvm::Expected< std::unique_ptr< CompilerInstance > > create(std::vector< const char * > &ClangArgv)
const llvm::orc::LLJIT * getExecutionEngine() const
llvm::Error Execute(PartialTranslationUnit &T)
The class keeps track of various objects created as part of processing incremental inputs.
static llvm::Expected< std::unique_ptr< Interpreter > > create(std::unique_ptr< CompilerInstance > CI)