clang 17.0.0git
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 Member Functions

 ~Interpreter ()
 
const CompilerInstancegetCompilerInstance () const
 
const llvm::orc::LLJIT * getExecutionEngine () const
 
llvm::Expected< PartialTranslationUnit & > Parse (llvm::StringRef Code)
 
llvm::Error Execute (PartialTranslationUnit &T)
 
llvm::Error ParseAndExecute (llvm::StringRef Code)
 
llvm::Error Undo (unsigned N=1)
 Undo N previous incremental inputs.
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress (GlobalDecl GD) const
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress (llvm::StringRef IRName) const
 
llvm::Expected< llvm::JITTargetAddress > getSymbolAddressFromLinkerName (llvm::StringRef LinkerName) const
 

Static Public Member Functions

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

Detailed Description

Provides top-level interfaces for incremental compilation and execution.

Definition at line 48 of file Interpreter.h.

Constructor & Destructor Documentation

◆ ~Interpreter()

Interpreter::~Interpreter ( )

Definition at line 183 of file Interpreter.cpp.

References toString().

Member Function Documentation

◆ create()

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

Definition at line 193 of file Interpreter.cpp.

◆ Execute()

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

◆ getCompilerInstance()

const CompilerInstance * Interpreter::getCompilerInstance ( ) const

Definition at line 202 of file Interpreter.cpp.

Referenced by Execute().

◆ getExecutionEngine()

const llvm::orc::LLJIT * Interpreter::getExecutionEngine ( ) const

Definition at line 206 of file Interpreter.cpp.

◆ getSymbolAddress() [1/2]

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

Definition at line 239 of file Interpreter.cpp.

References getSymbolAddress().

Referenced by getSymbolAddress().

◆ getSymbolAddress() [2/2]

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

Definition at line 249 of file Interpreter.cpp.

References clang::IncrementalExecutor::IRName.

◆ getSymbolAddressFromLinkerName()

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

Definition at line 259 of file Interpreter.cpp.

References clang::IncrementalExecutor::LinkerName.

◆ Parse()

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

Definition at line 213 of file Interpreter.cpp.

Referenced by ParseAndExecute().

◆ ParseAndExecute()

llvm::Error clang::Interpreter::ParseAndExecute ( llvm::StringRef  Code)
inline

Definition at line 63 of file Interpreter.h.

References Execute(), and Parse().

◆ Undo()

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

Undo N previous incremental inputs.

Definition at line 268 of file Interpreter.cpp.


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