clang 22.0.0git
|
Provides top-level interfaces for incremental compilation and execution. More...
#include "clang/Interpreter/Interpreter.h"
Classes | |
struct | JITConfig |
Public Member Functions | |
virtual | ~Interpreter () |
const ASTContext & | getASTContext () const |
ASTContext & | getASTContext () |
const CompilerInstance * | getCompilerInstance () const |
CompilerInstance * | getCompilerInstance () |
llvm::Expected< llvm::orc::LLJIT & > | getExecutionEngine () |
llvm::Expected< PartialTranslationUnit & > | Parse (llvm::StringRef Code) |
llvm::Error | Execute (PartialTranslationUnit &T) |
llvm::Error | ParseAndExecute (llvm::StringRef Code, Value *V=nullptr) |
llvm::Error | Undo (unsigned N=1) |
Undo N previous incremental inputs. | |
llvm::Error | LoadDynamicLibrary (const char *name) |
Link a dynamic library. | |
llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddress (GlobalDecl GD) const |
llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddress (llvm::StringRef IRName) const |
llvm::Expected< llvm::orc::ExecutorAddr > | getSymbolAddressFromLinkerName (llvm::StringRef LinkerName) const |
uint32_t | getOutOfProcessExecutorPID () const |
Static Public Member Functions | |
static llvm::Expected< std::unique_ptr< Interpreter > > | create (std::unique_ptr< CompilerInstance > CI, JITConfig Config={}) |
static llvm::Expected< std::unique_ptr< Interpreter > > | createWithCUDA (std::unique_ptr< CompilerInstance > CI, std::unique_ptr< CompilerInstance > DCI) |
static llvm::Expected< std::unique_ptr< llvm::orc::LLJITBuilder > > | createLLJITBuilder (std::unique_ptr< llvm::orc::ExecutorProcessControl > EPC, llvm::StringRef OrcRuntimePath) |
static llvm::Expected< std::pair< std::unique_ptr< llvm::orc::LLJITBuilder >, uint32_t > > | outOfProcessJITBuilder (JITConfig Config) |
static llvm::Expected< std::string > | getOrcRuntimePath (const driver::ToolChain &TC) |
Protected Member Functions | |
Interpreter (std::unique_ptr< CompilerInstance > Instance, llvm::Error &Err, std::unique_ptr< llvm::orc::LLJITBuilder > JITBuilder=nullptr, std::unique_ptr< clang::ASTConsumer > Consumer=nullptr, JITConfig Config=JITConfig()) | |
llvm::Error | CreateExecutor (JITConfig Config=JITConfig()) |
void | ResetExecutor () |
Friends | |
class | Value |
Provides top-level interfaces for incremental compilation and execution.
Definition at line 91 of file Interpreter.h.
|
protected |
Definition at line 251 of file Interpreter.cpp.
References clang::C, CreateExecutor(), and Execute().
Referenced by create(), and getCompilerInstance().
|
virtual |
Definition at line 307 of file Interpreter.cpp.
References toString().
|
static |
Definition at line 420 of file Interpreter.cpp.
References clang::C, getOrcRuntimePath(), clang::TargetInfo::getTriple(), Interpreter(), clang::Interpreter::JITConfig::IsOutOfProcess, clang::Interpreter::JITConfig::OrcRuntimePath, and clang::Runtimes.
Referenced by createWithCUDA().
Definition at line 619 of file Interpreter.cpp.
References clang::Interpreter::JITConfig::CM, clang::IncrementalExecutor::createDefaultJITBuilder(), clang::createJITTargetMachineBuilder(), clang::Interpreter::JITConfig::ExecutorPID, getCompilerInstance(), clang::CompilerInstance::getTargetOpts(), clang::Interpreter::JITConfig::IsOutOfProcess, outOfProcessJITBuilder(), and clang::TargetOptions::Triple.
Referenced by Execute(), getExecutionEngine(), and Interpreter().
|
static |
Definition at line 601 of file Interpreter.cpp.
References clang::IncrementalExecutor::createDefaultJITBuilder(), and clang::createJITTargetMachineBuilder().
Referenced by outOfProcessJITBuilder().
|
static |
Definition at line 469 of file Interpreter.cpp.
References create().
llvm::Error clang::Interpreter::Execute | ( | PartialTranslationUnit & | T | ) |
Definition at line 678 of file Interpreter.cpp.
References CreateExecutor(), and clang::T.
Referenced by Interpreter(), and ParseAndExecute().
ASTContext & clang::Interpreter::getASTContext | ( | ) |
Definition at line 527 of file Interpreter.cpp.
References clang::CompilerInstance::getASTContext(), and getCompilerInstance().
const ASTContext & clang::Interpreter::getASTContext | ( | ) | const |
Definition at line 531 of file Interpreter.cpp.
References clang::CompilerInstance::getASTContext(), and getCompilerInstance().
Referenced by clang::Value::getASTContext().
CompilerInstance * clang::Interpreter::getCompilerInstance | ( | ) |
Definition at line 513 of file Interpreter.cpp.
const CompilerInstance * clang::Interpreter::getCompilerInstance | ( | ) | const |
Definition at line 514 of file Interpreter.cpp.
References getCompilerInstance(), and Interpreter().
Referenced by CreateExecutor(), getASTContext(), getASTContext(), getCompilerInstance(), and Parse().
llvm::Expected< llvm::orc::LLJIT & > clang::Interpreter::getExecutionEngine | ( | ) |
Definition at line 518 of file Interpreter.cpp.
References CreateExecutor().
Referenced by LoadDynamicLibrary().
|
static |
Definition at line 393 of file Interpreter.cpp.
References clang::driver::ToolChain::getCompilerRTPath(), and clang::driver::ToolChain::getRuntimePath().
Referenced by create().
uint32_t clang::Interpreter::getOutOfProcessExecutorPID | ( | ) | const |
Definition at line 545 of file Interpreter.cpp.
llvm::Expected< llvm::orc::ExecutorAddr > clang::Interpreter::getSymbolAddress | ( | GlobalDecl | GD | ) | const |
ExecutorAddr
of a GlobalDecl
. This interface uses the CodeGenModule's internal mangling cache to avoid recomputing the mangled name. Definition at line 722 of file Interpreter.cpp.
References getSymbolAddress().
Referenced by getSymbolAddress().
llvm::Expected< llvm::orc::ExecutorAddr > clang::Interpreter::getSymbolAddress | ( | llvm::StringRef | IRName | ) | const |
ExecutorAddr
of a given name as written in the IR. Definition at line 732 of file Interpreter.cpp.
References clang::IncrementalExecutor::IRName.
llvm::Expected< llvm::orc::ExecutorAddr > clang::Interpreter::getSymbolAddressFromLinkerName | ( | llvm::StringRef | LinkerName | ) | const |
ExecutorAddr
of a given name as written in the object file. Definition at line 742 of file Interpreter.cpp.
References clang::IncrementalExecutor::LinkerName.
llvm::Error clang::Interpreter::LoadDynamicLibrary | ( | const char * | name | ) |
Link a dynamic library.
Definition at line 777 of file Interpreter.cpp.
References getExecutionEngine().
|
static |
Definition at line 352 of file Interpreter.cpp.
References createLLJITBuilder(), clang::Interpreter::JITConfig::CustomizeFork, clang::IncrementalExecutor::launchExecutor(), clang::Interpreter::JITConfig::OOPExecutor, clang::Interpreter::JITConfig::OOPExecutorConnect, clang::Interpreter::JITConfig::OrcRuntimePath, clang::Interpreter::JITConfig::SlabAllocateSize, and clang::Interpreter::JITConfig::UseSharedMemory.
Referenced by CreateExecutor().
llvm::Expected< PartialTranslationUnit & > clang::Interpreter::Parse | ( | llvm::StringRef | Code | ) |
Definition at line 552 of file Interpreter.cpp.
References getCompilerInstance(), clang::CompilerInstance::getDiagnostics(), clang::diag::Ignored, clang::DiagnosticsEngine::setSeverity(), clang::PartialTranslationUnit::TheModule, and clang::PartialTranslationUnit::TUPart.
Definition at line 702 of file Interpreter.cpp.
References Execute(), clang::Parse, V, and Value.
|
protected |
Definition at line 676 of file Interpreter.cpp.
llvm::Error clang::Interpreter::Undo | ( | unsigned | N = 1 | ) |
Undo N previous incremental inputs.
Definition at line 751 of file Interpreter.cpp.
|
friend |
Definition at line 92 of file Interpreter.h.
References Value.
Referenced by ParseAndExecute(), and Value.