|
LLVM 24.0.0git
|
#include "UBAwareInterpreter/ExecutorBase.h"
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 |
Definition at line 86 of file ExecutorBase.h.
|
inlineprotected |
Definition at line 95 of file ExecutorBase.h.
References C(), Ctx, ExitInfo, H, and Handler.
Referenced by llvm::ubi::InstExecutor::InstExecutor().
|
protecteddefault |
References DiagnosticReporter, llvm::Length, Msg, and uint64_t.
| void llvm::ubi::ExecutorBase::dumpStackTrace | ( | ) | const |
Definition at line 286 of file ExecutorBase.cpp.
References llvm::ubi::Frame::BB, Ctx, CurrentFrame, llvm::errs(), llvm::Instruction::getFunction(), llvm::AsmParserContext::getInstructionOrArgumentLocation(), llvm::ubi::Frame::LastFrame, llvm::ubi::Frame::PC, and llvm::Value::printAsOperand().
| void llvm::ubi::ExecutorBase::executeMemSet | ( | const AnyValue & | Dest, |
| const AnyValue & | Val, | ||
| const AnyValue & | Length ) |
Fill Length bytes at Dest with Val.
Definition at line 231 of file ExecutorBase.cpp.
References llvm::ubi::AnyValue::asInteger(), llvm::ubi::AnyValue::asPointer(), llvm::ubi::Byte::concrete(), llvm::fill(), llvm::APInt::getZExtValue(), llvm::ubi::AnyValue::isPoison(), llvm::Length, llvm::ubi::Byte::poison(), reportImmediateUB(), uint64_t, and verifyMemAccess().
Referenced by llvm::ubi::InstExecutor::callIntrinsic().
| 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().
| std::optional< ProgramExitInfo > llvm::ubi::ExecutorBase::getExitInfo | ( | ) | const |
Definition at line 278 of file ExecutorBase.cpp.
References ExitInfo.
Referenced by llvm::ubi::InstExecutor::runMainLoop().
| unsigned llvm::ubi::ExecutorBase::getIntSize | ( | ) | const |
Definition at line 282 of file ExecutorBase.cpp.
References CurrentFrame.
| bool llvm::ubi::ExecutorBase::hasProgramExited | ( | ) | const |
Definition at line 276 of file ExecutorBase.cpp.
References ExitInfo.
Referenced by llvm::ubi::InstExecutor::callIntrinsic(), llvm::ubi::InstExecutor::enterCall(), llvm::ubi::InstExecutor::returnFromCallee(), llvm::ubi::InstExecutor::runMainLoop(), and llvm::ubi::InstExecutor::visitStoreInst().
| AnyValue llvm::ubi::ExecutorBase::load | ( | const AnyValue & | Ptr, |
| Align | Alignment, | ||
| Type * | ValTy, | ||
| bool | NoUndef ) |
Definition at line 132 of file ExecutorBase.cpp.
References llvm::ubi::AnyValue::asPointer(), Ctx, llvm::ubi::AnyValue::getPoisonValue(), llvm::ubi::AnyValue::isPoison(), llvm::Offset, reportImmediateUB(), and verifyMemAccess().
| DiagnosticReporter llvm::ubi::ExecutorBase::reportError | ( | ) |
Definition at line 38 of file ExecutorBase.cpp.
References DiagnosticReporter, and llvm::ubi::Error.
Referenced by llvm::ubi::InstExecutor::enterCall(), llvm::ubi::InstExecutor::runMainLoop(), and llvm::ubi::InstExecutor::visitAllocaInst().
| DiagnosticReporter llvm::ubi::ExecutorBase::reportImmediateUB | ( | ) |
Definition at line 34 of file ExecutorBase.cpp.
References DiagnosticReporter, and llvm::ubi::ImmediateUB.
Referenced by llvm::ubi::InstExecutor::callIntrinsic(), llvm::ubi::InstExecutor::computeDivRem(), llvm::ubi::InstExecutor::enterCall(), executeMemSet(), executeMemTransfer(), llvm::ubi::InstExecutor::handleAttributes(), llvm::ubi::InstExecutor::handleMetadata(), load(), llvm::ubi::InstExecutor::returnFromCallee(), store(), verifyMemAccess(), llvm::ubi::InstExecutor::visitAllocaInst(), llvm::ubi::InstExecutor::visitCondBrInst(), llvm::ubi::InstExecutor::visitFPConvInst(), llvm::ubi::InstExecutor::visitIndirectBrInst(), llvm::ubi::InstExecutor::visitSwitchInst(), and llvm::ubi::InstExecutor::visitUnreachableInst().
| 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().
| void llvm::ubi::ExecutorBase::setFailed | ( | ) |
Definition at line 272 of file ExecutorBase.cpp.
References llvm::ubi::ProgramExitInfo::Failed, and requestProgramExit().
Referenced by llvm::ubi::InstExecutor::callIntrinsic(), llvm::ubi::InstExecutor::callLibFunc(), llvm::ubi::InstExecutor::enterCall(), llvm::ubi::InstExecutor::visitCallBrInst(), llvm::ubi::InstExecutor::visitInstruction(), llvm::ubi::InstExecutor::visitReturnInst(), and llvm::ubi::InstExecutor::visitStoreInst().
| void llvm::ubi::ExecutorBase::store | ( | const AnyValue & | Ptr, |
| Align | Alignment, | ||
| const AnyValue & | Val, | ||
| Type * | ValTy ) |
Definition at line 153 of file ExecutorBase.cpp.
References llvm::ubi::AnyValue::asPointer(), Ctx, llvm::ubi::AnyValue::isPoison(), llvm::Offset, reportImmediateUB(), and verifyMemAccess().
Referenced by llvm::ubi::InstExecutor::visitStoreInst().
| 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().
|
friend |
Definition at line 87 of file ExecutorBase.h.
References DiagnosticReporter.
Referenced by DiagnosticReporter, reportError(), reportImmediateUB(), and ~ExecutorBase().
|
protected |
Definition at line 90 of file ExecutorBase.h.
Referenced by llvm::ubi::InstExecutor::callIntrinsic(), llvm::ubi::InstExecutor::callVectorReduction(), llvm::ubi::InstExecutor::computeSelect(), dumpStackTrace(), llvm::ubi::InstExecutor::enterCall(), ExecutorBase(), llvm::ubi::InstExecutor::handleAttributes(), llvm::ubi::InstExecutor::handleMetadata(), llvm::ubi::InstExecutor::InstExecutor(), load(), llvm::ubi::InstExecutor::returnFromCallee(), llvm::ubi::InstExecutor::runMainLoop(), store(), verifyMemAccess(), llvm::ubi::InstExecutor::visitAllocaInst(), llvm::ubi::InstExecutor::visitBitCastInst(), llvm::ubi::InstExecutor::visitBitExtractInst(), llvm::ubi::InstExecutor::visitBitInsertInst(), llvm::ubi::InstExecutor::visitExtractElementInst(), llvm::ubi::InstExecutor::visitFPConvInst(), llvm::ubi::InstExecutor::visitFreezeInst(), llvm::ubi::InstExecutor::visitGetElementPtrInst(), llvm::ubi::InstExecutor::visitIndirectBrInst(), llvm::ubi::InstExecutor::visitInsertElementInst(), llvm::ubi::InstExecutor::visitIntToFPInst(), llvm::ubi::InstExecutor::visitIntToPtr(), llvm::ubi::InstExecutor::visitPtrToInt(), and llvm::ubi::InstExecutor::visitShuffleVectorInst().
|
protected |
Definition at line 92 of file ExecutorBase.h.
Referenced by llvm::ubi::InstExecutor::callLibFunc(), dumpStackTrace(), llvm::ubi::InstExecutor::enterCall(), getIntSize(), llvm::ubi::InstExecutor::returnFromCallee(), llvm::ubi::InstExecutor::runMainLoop(), llvm::ubi::InstExecutor::visitAllocaInst(), and llvm::ubi::InstExecutor::visitReturnInst().
|
protected |
Definition at line 93 of file ExecutorBase.h.
Referenced by llvm::ubi::InstExecutor::callLibFunc(), ExecutorBase(), getExitInfo(), hasProgramExited(), and requestProgramExit().
|
protected |
Definition at line 91 of file ExecutorBase.h.
Referenced by llvm::ubi::InstExecutor::callIntrinsic(), llvm::ubi::InstExecutor::callLibFunc(), llvm::ubi::InstExecutor::enterCall(), ExecutorBase(), llvm::ubi::InstExecutor::InstExecutor(), requestProgramExit(), llvm::ubi::InstExecutor::runMainLoop(), llvm::ubi::InstExecutor::visitCallBrInst(), llvm::ubi::InstExecutor::visitInstruction(), llvm::ubi::InstExecutor::visitReturnInst(), and llvm::ubi::InstExecutor::visitStoreInst().