clang  15.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. More...
 
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 186 of file Interpreter.cpp.

Member Function Documentation

◆ create()

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

Definition at line 189 of file Interpreter.cpp.

◆ Execute()

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

◆ getCompilerInstance()

const CompilerInstance * Interpreter::getCompilerInstance ( ) const

Definition at line 198 of file Interpreter.cpp.

Referenced by Execute().

◆ getExecutionEngine()

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

Definition at line 202 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 235 of file Interpreter.cpp.

◆ 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 245 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 255 of file Interpreter.cpp.

◆ Parse()

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

Definition at line 209 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 264 of file Interpreter.cpp.


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