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"
30class ThreadSafeContext;
36class CompilerInstance;
37class IncrementalExecutor;
38class 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();
73 llvm::Error
Undo(
unsigned N = 1);
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
GlobalDecl - represents a global declaration.
Create a pre-configured CompilerInstance for incremental processing.
static llvm::Expected< std::unique_ptr< CompilerInstance > > create(std::vector< const char * > &ClangArgv)
Provides top-level interfaces for incremental compilation and execution.
llvm::Error Execute(PartialTranslationUnit &T)
llvm::Expected< llvm::JITTargetAddress > getSymbolAddressFromLinkerName(llvm::StringRef LinkerName) const
const CompilerInstance * getCompilerInstance() const
const llvm::orc::LLJIT * getExecutionEngine() const
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress(GlobalDecl GD) const
llvm::Error ParseAndExecute(llvm::StringRef Code)
static llvm::Expected< std::unique_ptr< Interpreter > > create(std::unique_ptr< CompilerInstance > CI)
llvm::Expected< PartialTranslationUnit & > Parse(llvm::StringRef Code)
llvm::Error Undo(unsigned N=1)
Undo N previous incremental inputs.
YAML serialization mapping.
The class keeps track of various objects created as part of processing incremental inputs.