clang 20.0.0git
|
Provides top-level interfaces for incremental compilation and execution. More...
#include "clang/Interpreter/Interpreter.h"
Public Types | |
enum | InterfaceKind { NoAlloc , WithAlloc , CopyArray , NewTag } |
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::Expected< llvm::orc::ExecutorAddr > | CompileDtorCall (CXXRecordDecl *CXXRD) |
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 |
const llvm::SmallVectorImpl< Expr * > & | getValuePrintingInfo () const |
Expr * | SynthesizeExpr (Expr *E) |
Static Public Member Functions | |
static llvm::Expected< std::unique_ptr< Interpreter > > | create (std::unique_ptr< CompilerInstance > CI) |
static llvm::Expected< std::unique_ptr< Interpreter > > | createWithCUDA (std::unique_ptr< CompilerInstance > CI, std::unique_ptr< CompilerInstance > DCI) |
Protected Member Functions | |
Interpreter (std::unique_ptr< CompilerInstance > CI, llvm::Error &Err, std::unique_ptr< llvm::orc::LLJITBuilder > JITBuilder=nullptr) | |
llvm::Error | CreateExecutor () |
void | ResetExecutor () |
virtual std::unique_ptr< RuntimeInterfaceBuilder > | FindRuntimeInterface () |
Provides top-level interfaces for incremental compilation and execution.
Definition at line 91 of file Interpreter.h.
Enumerator | |
---|---|
NoAlloc | |
WithAlloc | |
CopyArray | |
NewTag |
Definition at line 170 of file Interpreter.h.
|
protected |
Definition at line 244 of file Interpreter.cpp.
References CreateExecutor(), and Execute().
|
virtual |
Definition at line 273 of file Interpreter.cpp.
References toString().
llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::CompileDtorCall | ( | CXXRecordDecl * | CXXRD | ) |
Definition at line 555 of file Interpreter.cpp.
References clang::Dtor_Base, getCompilerInstance(), clang::CompilerInstance::getSema(), getSymbolAddress(), clang::CXXRecordDecl::hasIrrelevantDestructor(), and clang::Sema::LookupDestructor().
Referenced by clang::Value::Value().
|
static |
Definition at line 309 of file Interpreter.cpp.
References Runtimes.
Referenced by createWithCUDA().
|
protected |
Definition at line 418 of file Interpreter.cpp.
References clang::IncrementalExecutor::createDefaultJITBuilder(), createJITTargetMachineBuilder(), getCompilerInstance(), clang::CompilerInstance::getTargetOpts(), and clang::TargetOptions::Triple.
Referenced by Execute(), getExecutionEngine(), and Interpreter().
|
static |
Definition at line 328 of file Interpreter.cpp.
llvm::Error Interpreter::Execute | ( | PartialTranslationUnit & | T | ) |
Definition at line 453 of file Interpreter.cpp.
References CreateExecutor(), and clang::T.
Referenced by Interpreter(), and ParseAndExecute().
|
protectedvirtual |
Definition at line 585 of file Interpreter.cpp.
References clang::Sema::BuildDeclarationNameExpr(), CopyArray, createInProcessRuntimeInterfaceBuilder(), E, clang::LookupResult::empty(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::Sema::getASTContext(), getCompilerInstance(), clang::ASTContext::getLangOpts(), clang::CompilerInstance::getSema(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::Idents, clang::Interface, clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), MagicRuntimeInterface, NewTag, NoAlloc, and WithAlloc.
Referenced by SynthesizeExpr().
ASTContext & Interpreter::getASTContext | ( | ) |
Definition at line 372 of file Interpreter.cpp.
References clang::CompilerInstance::getASTContext(), and getCompilerInstance().
const ASTContext & Interpreter::getASTContext | ( | ) | const |
Definition at line 376 of file Interpreter.cpp.
References clang::CompilerInstance::getASTContext(), and getCompilerInstance().
Referenced by clang::Value::getASTContext().
CompilerInstance * Interpreter::getCompilerInstance | ( | ) |
Definition at line 359 of file Interpreter.cpp.
const CompilerInstance * Interpreter::getCompilerInstance | ( | ) | const |
Definition at line 355 of file Interpreter.cpp.
Referenced by CompileDtorCall(), CreateExecutor(), FindRuntimeInterface(), getASTContext(), Parse(), and SynthesizeExpr().
llvm::Expected< llvm::orc::LLJIT & > Interpreter::getExecutionEngine | ( | ) |
Definition at line 363 of file Interpreter.cpp.
References CreateExecutor().
Referenced by LoadDynamicLibrary().
llvm::Expected< llvm::orc::ExecutorAddr > 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 490 of file Interpreter.cpp.
References getSymbolAddress().
Referenced by CompileDtorCall(), and getSymbolAddress().
llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::getSymbolAddress | ( | llvm::StringRef | IRName | ) | const |
ExecutorAddr
of a given name as written in the IR. Definition at line 500 of file Interpreter.cpp.
References clang::IncrementalExecutor::IRName.
llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::getSymbolAddressFromLinkerName | ( | llvm::StringRef | LinkerName | ) | const |
ExecutorAddr
of a given name as written in the object file. Definition at line 510 of file Interpreter.cpp.
References clang::IncrementalExecutor::LinkerName.
|
inline |
Definition at line 172 of file Interpreter.h.
llvm::Error Interpreter::LoadDynamicLibrary | ( | const char * | name | ) |
Link a dynamic library.
Definition at line 538 of file Interpreter.cpp.
References getExecutionEngine().
llvm::Expected< PartialTranslationUnit & > Interpreter::Parse | ( | llvm::StringRef | Code | ) |
Definition at line 392 of file Interpreter.cpp.
References E, getCompilerInstance(), clang::CompilerInstance::getDiagnostics(), clang::diag::Ignored, and clang::DiagnosticsEngine::setSeverity().
Referenced by ParseAndExecute().
llvm::Error Interpreter::ParseAndExecute | ( | llvm::StringRef | Code, |
Value * | V = nullptr |
||
) |
Definition at line 470 of file Interpreter.cpp.
References clang::Value::clear(), clang::Value::dump(), Execute(), clang::Value::isValid(), Parse(), and V.
|
protected |
Definition at line 451 of file Interpreter.cpp.
Definition at line 842 of file Interpreter.cpp.
References clang::CStyleCastPtrExpr(), E, FindRuntimeInterface(), clang::Sema::getASTContext(), getCompilerInstance(), clang::CompilerInstance::getSema(), clang::Result, and clang::ASTContext::VoidPtrTy.
llvm::Error Interpreter::Undo | ( | unsigned | N = 1 | ) |
Undo N previous incremental inputs.
Definition at line 519 of file Interpreter.cpp.