clang 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::Interpreter Class Reference

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

 ~Interpreter ()
 
const ASTContextgetASTContext () const
 
ASTContextgetASTContext ()
 
const CompilerInstancegetCompilerInstance () const
 
CompilerInstancegetCompilerInstance ()
 
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
 
ExprSynthesizeExpr (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)
 

Detailed Description

Provides top-level interfaces for incremental compilation and execution.

Definition at line 76 of file Interpreter.h.

Member Enumeration Documentation

◆ InterfaceKind

Enumerator
NoAlloc 
WithAlloc 
CopyArray 
NewTag 

Definition at line 132 of file Interpreter.h.

Constructor & Destructor Documentation

◆ ~Interpreter()

Interpreter::~Interpreter ( )

Definition at line 238 of file Interpreter.cpp.

References toString().

Member Function Documentation

◆ CompileDtorCall()

llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::CompileDtorCall ( CXXRecordDecl CXXRD)

◆ create()

llvm::Expected< std::unique_ptr< Interpreter > > Interpreter::create ( std::unique_ptr< CompilerInstance CI)
static

Definition at line 274 of file Interpreter.cpp.

References Runtimes.

Referenced by createWithCUDA().

◆ createWithCUDA()

llvm::Expected< std::unique_ptr< Interpreter > > Interpreter::createWithCUDA ( std::unique_ptr< CompilerInstance CI,
std::unique_ptr< CompilerInstance DCI 
)
static

Definition at line 294 of file Interpreter.cpp.

References create().

◆ Execute()

llvm::Error Interpreter::Execute ( PartialTranslationUnit T)

Definition at line 380 of file Interpreter.cpp.

References clang::PartialTranslationUnit::TheModule.

Referenced by ParseAndExecute().

◆ getASTContext() [1/2]

ASTContext & Interpreter::getASTContext ( )

◆ getASTContext() [2/2]

const ASTContext & Interpreter::getASTContext ( ) const

◆ getCompilerInstance() [1/2]

CompilerInstance * Interpreter::getCompilerInstance ( )

Definition at line 325 of file Interpreter.cpp.

◆ getCompilerInstance() [2/2]

const CompilerInstance * Interpreter::getCompilerInstance ( ) const

Definition at line 321 of file Interpreter.cpp.

Referenced by CompileDtorCall(), getASTContext(), Parse(), and SynthesizeExpr().

◆ getExecutionEngine()

llvm::Expected< llvm::orc::LLJIT & > Interpreter::getExecutionEngine ( )

Definition at line 329 of file Interpreter.cpp.

Referenced by LoadDynamicLibrary().

◆ getSymbolAddress() [1/2]

llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::getSymbolAddress ( GlobalDecl  GD) const
Returns
the ExecutorAddr of a GlobalDecl. This interface uses the CodeGenModule's internal mangling cache to avoid recomputing the mangled name.

Definition at line 417 of file Interpreter.cpp.

References getSymbolAddress().

Referenced by CompileDtorCall(), and getSymbolAddress().

◆ getSymbolAddress() [2/2]

llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::getSymbolAddress ( llvm::StringRef  IRName) const
Returns
the ExecutorAddr of a given name as written in the IR.

Definition at line 427 of file Interpreter.cpp.

References clang::IncrementalExecutor::IRName.

◆ getSymbolAddressFromLinkerName()

llvm::Expected< llvm::orc::ExecutorAddr > Interpreter::getSymbolAddressFromLinkerName ( llvm::StringRef  LinkerName) const
Returns
the ExecutorAddr of a given name as written in the object file.

Definition at line 437 of file Interpreter.cpp.

References clang::IncrementalExecutor::LinkerName.

◆ getValuePrintingInfo()

const llvm::SmallVectorImpl< Expr * > & clang::Interpreter::getValuePrintingInfo ( ) const
inline

Definition at line 134 of file Interpreter.h.

◆ LoadDynamicLibrary()

llvm::Error Interpreter::LoadDynamicLibrary ( const char *  name)

Link a dynamic library.

Definition at line 465 of file Interpreter.cpp.

References getExecutionEngine().

◆ Parse()

llvm::Expected< PartialTranslationUnit & > Interpreter::Parse ( llvm::StringRef  Code)

◆ ParseAndExecute()

llvm::Error Interpreter::ParseAndExecute ( llvm::StringRef  Code,
Value V = nullptr 
)

◆ SynthesizeExpr()

Expr * Interpreter::SynthesizeExpr ( Expr E)

◆ Undo()

llvm::Error Interpreter::Undo ( unsigned  N = 1)

Undo N previous incremental inputs.

Definition at line 446 of file Interpreter.cpp.


The documentation for this class was generated from the following files: