LLVM 24.0.0git
llvm::ubi::ExecutorBase Class Reference

#include "UBAwareInterpreter/ExecutorBase.h"

Inheritance diagram for llvm::ubi::ExecutorBase:
[legend]

Public Member Functions

DiagnosticReporter reportImmediateUB ()
DiagnosticReporter reportError ()
std::pair< MemoryObject *, uint64_t > verifyMemAccess (const Pointer &Ptr, uint64_t AccessSize, Align Alignment, bool IsStore)
 Check if the upcoming memory access is valid.
AnyValue load (const AnyValue &Ptr, Align Alignment, Type *ValTy, bool NoUndef)
void store (const AnyValue &Ptr, Align Alignment, const AnyValue &Val, Type *ValTy)
void executeMemTransfer (const AnyValue &Dest, const AnyValue &Src, const AnyValue &Length, Intrinsic::ID IID, bool IsLibCall)
 Copy Length bytes from Src to Dest according to the intrinsic IID.
void executeMemSet (const AnyValue &Dest, const AnyValue &Val, const AnyValue &Length)
 Fill Length bytes at Dest with Val.
void requestProgramExit (ProgramExitInfo::ProgramExitKind Kind, uint64_t ExitCode=0)
void setFailed ()
bool hasProgramExited () const
std::optional< ProgramExitInfo > getExitInfo () const
unsigned getIntSize () const
void dumpStackTrace () const

Protected Member Functions

 ExecutorBase (Context &C, EventHandler &H)
 ~ExecutorBase ()=default

Protected Attributes

Context & Ctx
EventHandler & Handler
Frame * CurrentFrame = nullptr
std::optional< ProgramExitInfo > ExitInfo

Friends

class DiagnosticReporter

Detailed Description

Definition at line 86 of file ExecutorBase.h.

Constructor & Destructor Documentation

◆ ExecutorBase()

llvm::ubi::ExecutorBase::ExecutorBase ( Context & C,
EventHandler & H )
inlineprotected

Definition at line 95 of file ExecutorBase.h.

References C(), Ctx, ExitInfo, H, and Handler.

Referenced by llvm::ubi::InstExecutor::InstExecutor().

◆ ~ExecutorBase()

llvm::ubi::ExecutorBase::~ExecutorBase ( )
protecteddefault

Member Function Documentation

◆ dumpStackTrace()

◆ executeMemSet()

◆ executeMemTransfer()

void llvm::ubi::ExecutorBase::executeMemTransfer ( const AnyValue & Dest,
const AnyValue & Src,
const AnyValue & Length,
Intrinsic::ID IID,
bool IsLibCall )

Copy Length bytes from Src to Dest according to the intrinsic IID.

If IsLibCall is true, the C library semantics are used instead.

Definition at line 167 of file ExecutorBase.cpp.

References llvm::ubi::AnyValue::asPointer(), assert(), llvm::ArrayRef< T >::data(), llvm::MutableArrayRef< T >::data(), llvm::ubi::AnyValue::isPoison(), llvm::Length, reportImmediateUB(), llvm::ArrayRef< T >::slice(), llvm::MutableArrayRef< T >::slice(), uint64_t, and verifyMemAccess().

Referenced by llvm::ubi::InstExecutor::callIntrinsic().

◆ getExitInfo()

std::optional< ProgramExitInfo > llvm::ubi::ExecutorBase::getExitInfo ( ) const

Definition at line 278 of file ExecutorBase.cpp.

References ExitInfo.

Referenced by llvm::ubi::InstExecutor::runMainLoop().

◆ getIntSize()

unsigned llvm::ubi::ExecutorBase::getIntSize ( ) const

Definition at line 282 of file ExecutorBase.cpp.

References CurrentFrame.

◆ hasProgramExited()

◆ load()

AnyValue llvm::ubi::ExecutorBase::load ( const AnyValue & Ptr,
Align Alignment,
Type * ValTy,
bool NoUndef )

◆ reportError()

◆ reportImmediateUB()

◆ requestProgramExit()

void llvm::ubi::ExecutorBase::requestProgramExit ( ProgramExitInfo::ProgramExitKind Kind,
uint64_t ExitCode = 0 )

Definition at line 266 of file ExecutorBase.cpp.

References ExitInfo, Handler, and uint64_t.

Referenced by llvm::ubi::InstExecutor::runMainLoop(), and setFailed().

◆ setFailed()

◆ store()

void llvm::ubi::ExecutorBase::store ( const AnyValue & Ptr,
Align Alignment,
const AnyValue & Val,
Type * ValTy )

◆ verifyMemAccess()

std::pair< MemoryObject *, uint64_t > llvm::ubi::ExecutorBase::verifyMemAccess ( const Pointer & Ptr,
uint64_t AccessSize,
Align Alignment,
bool IsStore )

Check if the upcoming memory access is valid.

Returns the resolved memory object and offset if it is valid.

Definition at line 61 of file ExecutorBase.cpp.

References llvm::Address, llvm::ubi::Pointer::address(), llvm::ubi::Alive, Ctx, llvm::ubi::Freed, llvm::Log2(), llvm::Offset, reportImmediateUB(), uint64_t, and llvm::Twine::utohexstr().

Referenced by llvm::ubi::InstExecutor::enterCall(), executeMemSet(), executeMemTransfer(), load(), and store().

◆ DiagnosticReporter

friend class DiagnosticReporter
friend

Definition at line 87 of file ExecutorBase.h.

References DiagnosticReporter.

Referenced by DiagnosticReporter, reportError(), reportImmediateUB(), and ~ExecutorBase().

Member Data Documentation

◆ Ctx

◆ CurrentFrame

◆ ExitInfo

std::optional<ProgramExitInfo> llvm::ubi::ExecutorBase::ExitInfo
protected

◆ Handler


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