LLVM 20.0.0git
|
#include "llvm/SandboxIR/Context.h"
Classes | |
struct | TypeDeleter |
Type has a protected destructor to prohibit the user from managing the lifetime of the Type objects. More... | |
Public Types | |
using | EraseInstrCallback = std::function< void(Instruction *)> |
using | CreateInstrCallback = std::function< void(Instruction *)> |
using | MoveInstrCallback = std::function< void(Instruction *, const BBIterator &)> |
using | CallbackID = uint64_t |
An ID for a registered callback. | |
Friends | |
class | Type |
MessagePack types as defined in the standard, with the exception of Integer being divided into a signed Int and unsigned UInt variant in order to map directly to C++ types. | |
class | PointerType |
class | IntegerType |
class | StructType |
class | Region |
class | IRSnapshotChecker |
class | Instruction |
class | EraseFromParent |
class | Utils |
class | BasicBlock |
Various leaf nodes. | |
using llvm::sandboxir::Context::CreateInstrCallback = std::function<void(Instruction *)> |
using llvm::sandboxir::Context::EraseInstrCallback = std::function<void(Instruction *)> |
using llvm::sandboxir::Context::MoveInstrCallback = std::function<void(Instruction *, const BBIterator &)> |
llvm::sandboxir::Context::Context | ( | LLVMContext & | LLVMCtx | ) |
Definition at line 608 of file Context.cpp.
llvm::sandboxir::Context::~Context | ( | ) |
Definition at line 612 of file Context.cpp.
|
inline |
Convenience function for getTracker().accept()
Definition at line 209 of file Context.h.
References llvm::sandboxir::Tracker::accept(), and IRTracker.
|
protected |
Definition at line 581 of file Context.cpp.
References AllocaInst, I, and registerValue().
Referenced by llvm::sandboxir::AllocaInst::create().
|
protected |
Definition at line 576 of file Context.cpp.
References AtomicCmpXchgInst, I, and registerValue().
|
protected |
Definition at line 571 of file Context.cpp.
References AtomicRMWInst, I, and registerValue().
Referenced by llvm::sandboxir::AtomicRMWInst::create().
|
protected |
Create a sandboxir::BasicBlock for an existing LLVM IR BB
.
This will also create all contents of the block.
Definition at line 421 of file Context.cpp.
References assert(), BasicBlock, getValue(), and registerValue().
Referenced by createFunction().
|
protected |
Definition at line 567 of file Context.cpp.
References BinaryOperator, I, and registerValue().
Referenced by llvm::sandboxir::BinaryOperator::create().
|
protected |
Definition at line 483 of file Context.cpp.
References BranchInst, and registerValue().
Referenced by llvm::sandboxir::BranchInst::create().
|
protected |
Definition at line 513 of file Context.cpp.
References CallBrInst, I, and registerValue().
|
protected |
Definition at line 503 of file Context.cpp.
References CallInst, I, and registerValue().
|
protected |
Definition at line 585 of file Context.cpp.
References CastInst, I, and registerValue().
Referenced by llvm::sandboxir::CastInst::create().
|
protected |
Definition at line 527 of file Context.cpp.
References CatchPadInst, I, and registerValue().
Referenced by llvm::sandboxir::CatchPadInst::create().
|
protected |
Definition at line 535 of file Context.cpp.
References CatchReturnInst, I, and registerValue().
|
protected |
Definition at line 551 of file Context.cpp.
References CatchSwitchInst, I, and registerValue().
|
protected |
Definition at line 531 of file Context.cpp.
References CleanupPadInst, I, and registerValue().
Referenced by llvm::sandboxir::CleanupPadInst::create().
|
protected |
Definition at line 540 of file Context.cpp.
References CleanupReturnInst, I, and registerValue().
Referenced by llvm::sandboxir::CleanupReturnInst::create().
|
protected |
|
protected |
Definition at line 451 of file Context.cpp.
References ExtractElementInst, and registerValue().
Referenced by llvm::sandboxir::ExtractElementInst::create().
|
protected |
Definition at line 471 of file Context.cpp.
References ExtractValueInst, and registerValue().
Referenced by llvm::sandboxir::ExtractValueInst::create().
|
protected |
Definition at line 597 of file Context.cpp.
References FCmpInst, I, and registerValue().
Referenced by llvm::sandboxir::CmpInst::create().
|
protected |
Definition at line 440 of file Context.cpp.
References FenceInst, and registerValue().
|
protected |
Definition at line 435 of file Context.cpp.
References FreezeInst, and registerValue().
Referenced by llvm::sandboxir::FreezeInst::create().
Function * llvm::sandboxir::Context::createFunction | ( | llvm::Function * | F | ) |
Create a sandboxir::Function for an existing LLVM IR F
, including all blocks and instructions.
This is the main API function for creating Sandbox IR. Note: this will not fully populate its parent module. The only globals that will be available are those used within the function.
Definition at line 630 of file Context.cpp.
References assert(), createBasicBlock(), F, getOrCreateArgument(), getOrCreateModule(), getValue(), and registerValue().
Referenced by createModule().
|
protected |
Definition at line 546 of file Context.cpp.
References GetElementPtrInst, I, and registerValue().
Referenced by llvm::sandboxir::GetElementPtrInst::create().
|
protected |
Definition at line 593 of file Context.cpp.
References I, ICmpInst, and registerValue().
Referenced by llvm::sandboxir::CmpInst::create().
|
protected |
Definition at line 458 of file Context.cpp.
References InsertElementInst, and registerValue().
Referenced by llvm::sandboxir::InsertElementInst::create().
|
protected |
Definition at line 477 of file Context.cpp.
References InsertValueInst, and registerValue().
Referenced by llvm::sandboxir::InsertValueInst::create().
|
protected |
Definition at line 508 of file Context.cpp.
References I, InvokeInst, and registerValue().
|
protected |
Definition at line 523 of file Context.cpp.
References I, LandingPadInst, and registerValue().
Referenced by llvm::sandboxir::LandingPadInst::create().
|
protected |
Definition at line 488 of file Context.cpp.
References LoadInst, and registerValue().
Module * llvm::sandboxir::Context::createModule | ( | llvm::Module * | LLVMM | ) |
Create a sandboxir::Module corresponding to LLVMM
.
Definition at line 648 of file Context.cpp.
References llvm::Module::aliases(), createFunction(), getOrCreateModule(), getOrCreateValue(), llvm::Global, llvm::Module::globals(), and llvm::Module::ifuncs().
|
protected |
Definition at line 589 of file Context.cpp.
References I, PHINode, and registerValue().
Referenced by llvm::sandboxir::PHINode::create().
|
protected |
Definition at line 555 of file Context.cpp.
References I, registerValue(), and ResumeInst.
Referenced by llvm::sandboxir::ResumeInst::create().
|
protected |
Definition at line 498 of file Context.cpp.
References I, registerValue(), and ReturnInst.
|
protected |
Definition at line 445 of file Context.cpp.
References registerValue(), and SelectInst.
Referenced by llvm::sandboxir::SelectInst::create().
|
protected |
Definition at line 465 of file Context.cpp.
References registerValue(), and ShuffleVectorInst.
Referenced by llvm::sandboxir::ShuffleVectorInst::create().
|
protected |
Definition at line 493 of file Context.cpp.
References registerValue(), and StoreInst.
Referenced by llvm::sandboxir::StoreInst::create().
|
protected |
Definition at line 559 of file Context.cpp.
References I, registerValue(), and SwitchInst.
Referenced by llvm::sandboxir::SwitchInst::create().
|
protected |
Definition at line 563 of file Context.cpp.
References I, registerValue(), and UnaryOperator.
Referenced by llvm::sandboxir::UnaryOperator::create().
|
protected |
Definition at line 518 of file Context.cpp.
References registerValue(), and UnreachableInst.
Referenced by llvm::sandboxir::UnreachableInst::create().
|
protected |
Definition at line 430 of file Context.cpp.
References registerValue(), and VAArgInst.
Referenced by llvm::sandboxir::VAArgInst::create().
Remove SBV
from all SandboxIR maps and stop owning it.
This effectively detaches V
from the underlying IR.
Definition at line 27 of file Context.cpp.
References assert(), and detachLLVMValue().
|
protected |
Remove V
from the maps and returns the unique_ptr.
Definition at line 16 of file Context.cpp.
References LLVMValueToValueMap.
Referenced by detach().
|
inlineprotected |
Definition at line 124 of file Context.h.
References LLVMIRBuilder.
Referenced by llvm::sandboxir::Instruction::setInsertPos().
Module * llvm::sandboxir::Context::getModule | ( | llvm::Module * | LLVMM | ) | const |
Definition at line 614 of file Context.cpp.
References LLVMModuleToModuleMap.
Referenced by llvm::sandboxir::Function::getParent().
|
inline |
\Returns the number of values registered with Context.
Definition at line 241 of file Context.h.
References LLVMValueToValueMap.
Referenced by llvm::sandboxir::Value::Value().
|
protected |
Get or create a sandboxir::Argument for an existing LLVM IR LLVMArg
.
Definition at line 407 of file Context.cpp.
References LLVMValueToValueMap.
Referenced by createFunction().
|
protected |
Get or create a sandboxir::Constant from an existing LLVM IR LLVMC
.
Definition at line 417 of file Context.cpp.
References getOrCreateValueInternal().
Referenced by llvm::sandboxir::ShuffleVectorInst::convertShuffleMaskForBitcode(), llvm::sandboxir::CastInst::create(), llvm::sandboxir::ExtractValueInst::create(), llvm::sandboxir::InsertValueInst::create(), llvm::sandboxir::SelectInst::create(), llvm::sandboxir::ShuffleVectorInst::create(), llvm::sandboxir::ExtractElementInst::create(), llvm::sandboxir::InsertElementInst::create(), llvm::sandboxir::ConstantArray::get(), llvm::sandboxir::BlockAddress::get(), llvm::sandboxir::ConstantTokenNone::get(), llvm::sandboxir::NoCFIValue::get(), llvm::sandboxir::ConstantPointerNull::get(), llvm::sandboxir::ConstantStruct::get(), llvm::sandboxir::ConstantAggregateZero::get(), llvm::sandboxir::ConstantFP::get(), llvm::sandboxir::ConstantInt::get(), llvm::sandboxir::ConstantPtrAuth::getAddrDiscriminator(), llvm::sandboxir::GlobalAlias::getAliasee(), llvm::sandboxir::GlobalAlias::getAliaseeObject(), llvm::sandboxir::ConstantInt::getBool(), llvm::sandboxir::ConstantPtrAuth::getDiscriminator(), llvm::sandboxir::UndefValue::getElementValue(), llvm::sandboxir::PoisonValue::getElementValue(), llvm::sandboxir::ConstantInt::getFalse(), llvm::sandboxir::NoCFIValue::getGlobalValue(), llvm::sandboxir::ConstantFP::getInfinity(), llvm::sandboxir::GlobalVariable::getInitializer(), llvm::sandboxir::ConstantPtrAuth::getKey(), llvm::sandboxir::ConstantFP::getNaN(), llvm::sandboxir::ConstantFP::getNegativeZero(), llvm::sandboxir::ConstantPtrAuth::getPointer(), llvm::sandboxir::ConstantFP::getQNaN(), llvm::sandboxir::GlobalIFunc::getResolver(), llvm::sandboxir::GlobalIFunc::getResolverFunction(), llvm::sandboxir::UndefValue::getSequentialElement(), llvm::sandboxir::PoisonValue::getSequentialElement(), llvm::sandboxir::ShuffleVectorInst::getShuffleMaskForBitcode(), llvm::sandboxir::ConstantInt::getSigned(), llvm::sandboxir::ConstantFP::getSNaN(), llvm::sandboxir::UndefValue::getStructElement(), llvm::sandboxir::PoisonValue::getStructElement(), llvm::sandboxir::ConstantInt::getTrue(), llvm::sandboxir::ConstantPtrAuth::getWithSameSchema(), and llvm::sandboxir::ConstantFP::getZero().
Module * llvm::sandboxir::Context::getOrCreateModule | ( | llvm::Module * | LLVMM | ) |
Definition at line 621 of file Context.cpp.
References LLVMModuleToModuleMap.
Referenced by createFunction(), and createModule().
|
inlineprotected |
Get or create a sandboxir::Value for an existing LLVM IR LLVMV
.
Definition at line 103 of file Context.h.
References getOrCreateValueInternal().
Referenced by llvm::BasicBlock::createMarker(), createModule(), and llvm::sandboxir::Utils::getMemInstructionBase().
|
protected |
This is the actual function that creates sandboxir values for V
, and among others handles all instruction types.
Definition at line 55 of file Context.cpp.
References AllocaInst, assert(), AtomicCmpXchgInst, AtomicRMWInst, BinaryOperator, BranchInst, llvm::CallingConv::C, CallBrInst, CallInst, CastInst, CatchPadInst, CatchReturnInst, CatchSwitchInst, CleanupPadInst, CleanupReturnInst, ExtractElementInst, ExtractValueInst, FCmpInst, FenceInst, FreezeInst, GetElementPtrInst, getOpcode(), getOrCreateValueInternal(), getValue(), ICmpInst, InsertElementInst, InsertValueInst, InvokeInst, LandingPadInst, LLVMAlloca, LLVMAtomicCmpXchg, LLVMAtomicRMW, LLVMBr, LLVMCall, LLVMCallBr, LLVMFCmp, LLVMFence, LLVMFreeze, LLVMICmp, LLVMInvoke, LLVMRet, LLVMUnreachable, LLVMVAArg, LLVMValueToValueMap, LoadInst, PHINode, ResumeInst, ReturnInst, SelectInst, ShuffleVectorInst, StoreInst, SwitchInst, UnaryOperator, UnreachableInst, and VAArgInst.
Referenced by getOrCreateConstant(), getOrCreateValue(), and getOrCreateValueInternal().
|
inline |
Definition at line 203 of file Context.h.
References IRTracker.
Referenced by llvm::sandboxir::SwitchInst::addCase(), llvm::sandboxir::CatchSwitchInst::addHandler(), llvm::sandboxir::PHINode::addIncoming(), llvm::Instruction::cloneDebugInfoFrom(), llvm::sandboxir::ShuffleVectorInst::commute(), llvm::sandboxir::Instruction::copyFastMathFlags(), llvm::Instruction::dropOneDbgRecord(), llvm::Instruction::getAccessType(), llvm::Instruction::getModule(), llvm::sandboxir::Instruction::insertInto(), registerValue(), llvm::sandboxir::SwitchInst::removeCase(), llvm::sandboxir::PHINode::removeIncomingValue(), llvm::sandboxir::Value::replaceAllUsesWith(), llvm::Instruction::replaceSuccessorWith(), llvm::sandboxir::Use::set(), llvm::sandboxir::GlobalAlias::setAliasee(), llvm::sandboxir::AtomicRMWInst::setAlignment(), llvm::sandboxir::AtomicCmpXchgInst::setAlignment(), llvm::sandboxir::AllocaInst::setAlignment(), llvm::sandboxir::GlobalObject::setAlignment(), llvm::sandboxir::AllocaInst::setAllocatedType(), llvm::sandboxir::FuncletPadInst::setArgOperand(), llvm::sandboxir::CatchReturnInst::setCatchPad(), llvm::sandboxir::LandingPadInst::setCleanup(), llvm::sandboxir::CleanupReturnInst::setCleanupPad(), llvm::sandboxir::SwitchInst::setCondition(), llvm::sandboxir::GlobalVariable::setConstant(), llvm::sandboxir::CallBrInst::setDefaultDest(), llvm::sandboxir::SwitchInst::setDefaultDest(), llvm::sandboxir::GlobalVariable::setExternallyInitialized(), llvm::sandboxir::AtomicCmpXchgInst::setFailureOrdering(), llvm::sandboxir::Instruction::setFast(), llvm::sandboxir::Instruction::setFastMathFlags(), llvm::sandboxir::GlobalObject::setGlobalObjectSubClassData(), llvm::sandboxir::Instruction::setHasAllowContract(), llvm::sandboxir::Instruction::setHasAllowReassoc(), llvm::sandboxir::Instruction::setHasAllowReciprocal(), llvm::sandboxir::Instruction::setHasApproxFunc(), llvm::sandboxir::Instruction::setHasNoInfs(), llvm::sandboxir::Instruction::setHasNoNaNs(), llvm::sandboxir::Instruction::setHasNoSignedWrap(), llvm::sandboxir::Instruction::setHasNoUnsignedWrap(), llvm::sandboxir::PHINode::setIncomingBlock(), llvm::sandboxir::PHINode::setIncomingValue(), llvm::sandboxir::CallBrInst::setIndirectDest(), llvm::sandboxir::GlobalVariable::setInitializer(), llvm::sandboxir::PossiblyDisjointInst::setIsDisjoint(), llvm::sandboxir::Instruction::setIsExact(), llvm::sandboxir::PossiblyNonNegInst::setNonNeg(), llvm::sandboxir::User::setOperand(), llvm::sandboxir::AtomicRMWInst::setOrdering(), llvm::sandboxir::FuncletPadInst::setParentPad(), llvm::sandboxir::CatchSwitchInst::setParentPad(), llvm::sandboxir::CmpInst::setPredicate(), llvm::sandboxir::GlobalIFunc::setResolver(), llvm::sandboxir::GlobalObject::setSection(), llvm::sandboxir::ShuffleVectorInst::setShuffleMask(), llvm::sandboxir::CatchReturnInst::setSuccessor(), llvm::sandboxir::SwitchInst::setSuccessor(), llvm::sandboxir::AtomicCmpXchgInst::setSuccessOrdering(), llvm::sandboxir::FenceInst::setSyncScopeID(), llvm::sandboxir::AtomicCmpXchgInst::setSyncScopeID(), llvm::sandboxir::GlobalValue::setUnnamedAddr(), llvm::sandboxir::CleanupReturnInst::setUnwindDest(), llvm::sandboxir::AllocaInst::setUsedWithInAlloca(), llvm::sandboxir::GlobalValue::setVisibility(), llvm::sandboxir::LoadInst::setVolatile(), llvm::sandboxir::StoreInst::setVolatile(), llvm::sandboxir::AtomicRMWInst::setVolatile(), llvm::sandboxir::AtomicCmpXchgInst::setVolatile(), llvm::sandboxir::AtomicCmpXchgInst::setWeak(), llvm::sandboxir::Use::swap(), llvm::sandboxir::ICmpInst::swapOperands(), llvm::sandboxir::FCmpInst::swapOperands(), llvm::sandboxir::SelectInst::swapValues(), and llvm::Value::Value().
|
inline |
Definition at line 220 of file Context.h.
References LLVMTypeToTypeMap, and Type.
Referenced by llvm::Instruction::dropPoisonGeneratingReturnAttributes(), llvm::sandboxir::StructType::get(), llvm::sandboxir::PointerType::get(), llvm::sandboxir::Instruction::getAccessType(), llvm::sandboxir::AllocaInst::getAllocatedType(), llvm::sandboxir::CastInst::getDestTy(), llvm::sandboxir::VectorType::getDoubleElementsVectorType(), llvm::sandboxir::VectorType::getElementType(), llvm::sandboxir::VectorType::getExtendedElementVectorType(), llvm::sandboxir::Function::getFunctionType(), llvm::sandboxir::VectorType::getHalfElementsVectorType(), llvm::sandboxir::ExtractValueInst::getIndexedType(), llvm::sandboxir::VectorType::getInteger(), llvm::sandboxir::ConstantInt::getIntegerType(), llvm::sandboxir::GetElementPtrInst::getPointerOperandType(), llvm::sandboxir::GetElementPtrInst::getResultElementType(), llvm::sandboxir::GetElementPtrInst::getSourceElementType(), llvm::sandboxir::CastInst::getSrcTy(), llvm::sandboxir::VectorType::getSubdividedVectorType(), llvm::sandboxir::VectorType::getTruncatedElementVectorType(), llvm::sandboxir::ConstantArray::getType(), llvm::sandboxir::ConstantPointerNull::getType(), llvm::sandboxir::NoCFIValue::getType(), llvm::sandboxir::ShuffleVectorInst::getType(), llvm::sandboxir::AllocaInst::getType(), llvm::sandboxir::Value::getType(), llvm::sandboxir::ExtractElementInst::getVectorOperandType(), and llvm::sandboxir::CmpInst::makeCmpResultType().
|
inline |
Definition at line 212 of file Context.h.
References getValue().
Value * llvm::sandboxir::Context::getValue | ( | llvm::Value * | V | ) | const |
Definition at line 601 of file Context.cpp.
References LLVMValueToValueMap.
Referenced by llvm::sandboxir::BasicBlock::begin(), llvm::Instruction::copyMetadata(), createBasicBlock(), createFunction(), llvm::sandboxir::BasicBlock::dumpOS(), llvm::sandboxir::Function::dumpOS(), llvm::sandboxir::Use::get(), llvm::sandboxir::DSOLocalEquivalent::get(), llvm::sandboxir::Function::getArg(), llvm::sandboxir::AllocaInst::getArraySize(), llvm::sandboxir::BlockAddress::getBasicBlock(), llvm::sandboxir::CallBase::getCalledFunction(), llvm::sandboxir::CallBase::getCalledOperand(), llvm::sandboxir::CallBase::getCaller(), llvm::sandboxir::CatchReturnInst::getCatchPad(), llvm::sandboxir::CatchPadInst::getCatchSwitch(), llvm::sandboxir::CatchReturnInst::getCatchSwitchParentPad(), llvm::sandboxir::LandingPadInst::getClause(), llvm::sandboxir::CleanupReturnInst::getCleanupPad(), llvm::sandboxir::AtomicCmpXchgInst::getCompareOperand(), llvm::sandboxir::BranchInst::getCondition(), llvm::sandboxir::SwitchInst::getCondition(), llvm::sandboxir::CallBrInst::getDefaultDest(), llvm::sandboxir::SwitchInst::getDefaultDest(), llvm::sandboxir::ConstantAggregateZero::getElementValue(), llvm::sandboxir::BlockAddress::getFunction(), llvm::sandboxir::DSOLocalEquivalent::getGlobalValue(), llvm::sandboxir::PHINode::getIncomingBlock(), llvm::sandboxir::PHINode::getIncomingValue(), llvm::sandboxir::PHINode::getIncomingValueForBlock(), llvm::sandboxir::CallBrInst::getIndirectDest(), llvm::sandboxir::CallBrInst::getIndirectDestLabelUse(), llvm::sandboxir::InvokeInst::getLandingPadInst(), llvm::sandboxir::AtomicCmpXchgInst::getNewValOperand(), llvm::sandboxir::BBIterator::getNodeParent(), llvm::sandboxir::InvokeInst::getNormalDest(), getOrCreateValueInternal(), llvm::sandboxir::BasicBlock::getParent(), llvm::sandboxir::FuncletPadInst::getParentPad(), llvm::sandboxir::CatchSwitchInst::getParentPad(), llvm::sandboxir::VAArgInst::getPointerOperand(), llvm::sandboxir::AtomicRMWInst::getPointerOperand(), llvm::sandboxir::LoadInst::getPointerOperand(), llvm::sandboxir::StoreInst::getPointerOperand(), llvm::sandboxir::GetElementPtrInst::getPointerOperand(), llvm::sandboxir::ReturnInst::getReturnValue(), llvm::sandboxir::ConstantAggregateZero::getSequentialElement(), llvm::sandboxir::ConstantAggregateZero::getStructElement(), llvm::sandboxir::CatchReturnInst::getSuccessor(), llvm::sandboxir::CallBrInst::getSuccessor(), llvm::sandboxir::SwitchInst::getSuccessor(), llvm::sandboxir::InvokeInst::getSuccessor(), llvm::sandboxir::BasicBlock::getTerminator(), llvm::sandboxir::CleanupReturnInst::getUnwindDest(), llvm::sandboxir::CatchSwitchInst::getUnwindDest(), llvm::sandboxir::AtomicRMWInst::getValOperand(), llvm::sandboxir::ResumeInst::getValue(), getValue(), llvm::sandboxir::StoreInst::getValueOperand(), llvm::sandboxir::PHINode::hasConstantValue(), llvm::sandboxir::BlockAddress::lookup(), llvm::sandboxir::BBIterator::operator++(), llvm::sandboxir::PHINode::removeIncomingValue(), llvm::sandboxir::Value::use_begin(), llvm::Value::Value(), and llvm::sandboxir::User::verifyUserOfLLVMUse().
Context::CallbackID llvm::sandboxir::Context::registerCreateInstrCallback | ( | CreateInstrCallback | CB | ) |
Register a callback that gets called right after a SandboxIR instruction is created.
Note that this will also be called when reverting the removal of an instruction. \Returns a callback ID for later deregistration.
Definition at line 700 of file Context.cpp.
References assert(), CreateInstrCallbacks, llvm::sandboxir::MaxRegisteredCallbacks, and NextCallbackID.
Referenced by llvm::sandboxir::DependencyGraph::DependencyGraph(), and llvm::sandboxir::Region::Region().
Context::CallbackID llvm::sandboxir::Context::registerEraseInstrCallback | ( | EraseInstrCallback | CB | ) |
Register a callback that gets called when a SandboxIR instruction is about to be removed from its parent.
Note that this will also be called when reverting the creation of an instruction. \Returns a callback ID for later deregistration.
Definition at line 686 of file Context.cpp.
References assert(), EraseInstrCallbacks, llvm::sandboxir::MaxRegisteredCallbacks, and NextCallbackID.
Referenced by llvm::sandboxir::DependencyGraph::DependencyGraph(), llvm::sandboxir::Region::Region(), and llvm::sandboxir::SeedCollector::SeedCollector().
Context::CallbackID llvm::sandboxir::Context::registerMoveInstrCallback | ( | MoveInstrCallback | CB | ) |
Register a callback that gets called when a SandboxIR instruction is about to be moved.
Note that this will also be called when reverting a move. \Returns a callback ID for later deregistration.
Definition at line 713 of file Context.cpp.
References assert(), llvm::sandboxir::MaxRegisteredCallbacks, MoveInstrCallbacks, and NextCallbackID.
Take ownership of VPtr and store it in LLVMValueToValueMap
.
Definition at line 34 of file Context.cpp.
References assert(), llvm::sandboxir::Tracker::emplaceIfTracking(), getTracker(), I, LLVMValueToValueMap, and runCreateInstrCallbacks().
Referenced by createAllocaInst(), createAtomicCmpXchgInst(), createAtomicRMWInst(), createBasicBlock(), createBinaryOperator(), createBranchInst(), createCallBrInst(), createCallInst(), createCastInst(), createCatchPadInst(), createCatchReturnInst(), createCatchSwitchInst(), createCleanupPadInst(), createCleanupReturnInst(), createExtractElementInst(), createExtractValueInst(), createFCmpInst(), createFenceInst(), createFreezeInst(), createFunction(), createGetElementPtrInst(), createICmpInst(), createInsertElementInst(), createInsertValueInst(), createInvokeInst(), createLandingPadInst(), createLoadInst(), createPHINode(), createResumeInst(), createReturnInst(), createSelectInst(), createShuffleVectorInst(), createStoreInst(), createSwitchInst(), createUnaryOperator(), createUnreachableInst(), createVAArgInst(), and llvm::sandboxir::EraseFromParent::revert().
|
inline |
Convenience function for getTracker().revert()
Definition at line 207 of file Context.h.
References IRTracker, and llvm::sandboxir::Tracker::revert().
|
protected |
Definition at line 671 of file Context.cpp.
References CreateInstrCallbacks, and I.
Referenced by registerValue().
|
protected |
Definition at line 666 of file Context.cpp.
References EraseInstrCallbacks, and I.
Referenced by llvm::sandboxir::Instruction::eraseFromParent().
|
protected |
Definition at line 676 of file Context.cpp.
References I, and MoveInstrCallbacks.
|
inline |
Convenience function for getTracker().save()
Definition at line 205 of file Context.h.
References IRTracker, and llvm::sandboxir::Tracker::save().
void llvm::sandboxir::Context::unregisterCreateInstrCallback | ( | CallbackID | ID | ) |
Definition at line 707 of file Context.cpp.
References assert(), and CreateInstrCallbacks.
Referenced by llvm::sandboxir::DependencyGraph::~DependencyGraph(), and llvm::sandboxir::Region::~Region().
void llvm::sandboxir::Context::unregisterEraseInstrCallback | ( | CallbackID | ID | ) |
Definition at line 693 of file Context.cpp.
References assert(), and EraseInstrCallbacks.
Referenced by llvm::sandboxir::DependencyGraph::~DependencyGraph(), llvm::sandboxir::Region::~Region(), and llvm::sandboxir::SeedCollector::~SeedCollector().
void llvm::sandboxir::Context::unregisterMoveInstrCallback | ( | CallbackID | ID | ) |
Definition at line 720 of file Context.cpp.
References assert(), and MoveInstrCallbacks.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
MessagePack types as defined in the standard, with the exception of Integer being divided into a signed Int and unsigned UInt variant in order to map directly to C++ types.
The types map onto corresponding union members of the Object
struct.
Definition at line 47 of file Context.h.
Referenced by getType().
|
protected |
Definition at line 185 of file Context.h.
Referenced by createAllocaInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 183 of file Context.h.
Referenced by createAtomicCmpXchgInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 181 of file Context.h.
Referenced by createAtomicRMWInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 179 of file Context.h.
Referenced by createBinaryOperator(), and getOrCreateValueInternal().
|
protected |
Definition at line 145 of file Context.h.
Referenced by createBranchInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 157 of file Context.h.
Referenced by createCallBrInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 153 of file Context.h.
Referenced by createCallInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 187 of file Context.h.
Referenced by createCastInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 161 of file Context.h.
Referenced by createCatchPadInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 165 of file Context.h.
Referenced by createCatchReturnInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 171 of file Context.h.
Referenced by createCatchSwitchInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 163 of file Context.h.
Referenced by createCleanupPadInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 167 of file Context.h.
Referenced by createCleanupReturnInst(), and getOrCreateValueInternal().
|
protected |
Callbacks called when an IR instruction is about to get created.
Keys are used as IDs for deregistration.
Definition at line 78 of file Context.h.
Referenced by registerCreateInstrCallback(), runCreateInstrCallbacks(), and unregisterCreateInstrCallback().
|
protected |
Callbacks called when an IR instruction is about to get erased.
Keys are used as IDs for deregistration.
Definition at line 75 of file Context.h.
Referenced by registerEraseInstrCallback(), runEraseInstrCallbacks(), and unregisterEraseInstrCallback().
|
protected |
Definition at line 137 of file Context.h.
Referenced by createExtractElementInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 141 of file Context.h.
Referenced by createExtractValueInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 197 of file Context.h.
Referenced by createFCmpInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 131 of file Context.h.
Referenced by createFenceInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 129 of file Context.h.
Referenced by createFreezeInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 169 of file Context.h.
Referenced by createGetElementPtrInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 195 of file Context.h.
Referenced by createICmpInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 135 of file Context.h.
Referenced by createInsertElementInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 143 of file Context.h.
Referenced by createInsertValueInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 155 of file Context.h.
Referenced by createInvokeInst(), and getOrCreateValueInternal().
|
protected |
|
protected |
Definition at line 159 of file Context.h.
Referenced by createLandingPadInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 46 of file Context.h.
Referenced by llvm::sandboxir::ConstantFP::get(), llvm::sandboxir::ConstantTokenNone::get(), llvm::sandboxir::StructType::get(), llvm::sandboxir::ConstantInt::get(), llvm::sandboxir::PointerType::get(), llvm::sandboxir::ConstantInt::getBool(), llvm::sandboxir::ConstantInt::getFalse(), llvm::sandboxir::ConstantInt::getTrue(), llvm::sandboxir::CmpInst::makeCmpResultType(), and llvm::sandboxir::Region::Region().
|
protected |
Definition at line 123 of file Context.h.
Referenced by getLLVMIRBuilder().
|
protected |
Maps an LLVM Module to the corresponding sandboxir::Module.
Definition at line 61 of file Context.h.
Referenced by getModule(), and getOrCreateModule().
|
protected |
|
protected |
Maps LLVM Value to the corresponding sandboxir::Value.
Owns all SandboxIR objects.
Definition at line 58 of file Context.h.
Referenced by detachLLVMValue(), getNumValues(), getOrCreateArgument(), getOrCreateValueInternal(), getValue(), and registerValue().
|
protected |
Definition at line 147 of file Context.h.
Referenced by createLoadInst(), and getOrCreateValueInternal().
|
protected |
Callbacks called when an IR instruction is about to get moved.
Keys are used as IDs for deregistration.
Definition at line 81 of file Context.h.
Referenced by registerMoveInstrCallback(), runMoveInstrCallbacks(), and unregisterMoveInstrCallback().
|
protected |
A counter used for assigning callback IDs during registration.
The same counter is used for all kinds of callbacks so we can detect mismatched registration/deregistration.
Definition at line 86 of file Context.h.
Referenced by registerCreateInstrCallback(), registerEraseInstrCallback(), and registerMoveInstrCallback().
|
protected |
Definition at line 189 of file Context.h.
Referenced by createPHINode(), and getOrCreateValueInternal().
|
protected |
Definition at line 173 of file Context.h.
Referenced by createResumeInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 151 of file Context.h.
Referenced by createReturnInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 133 of file Context.h.
Referenced by createSelectInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 139 of file Context.h.
Referenced by createShuffleVectorInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 149 of file Context.h.
Referenced by createStoreInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 175 of file Context.h.
Referenced by createSwitchInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 177 of file Context.h.
Referenced by createUnaryOperator(), and getOrCreateValueInternal().
|
protected |
Definition at line 191 of file Context.h.
Referenced by createUnreachableInst(), and getOrCreateValueInternal().
|
protected |
Definition at line 127 of file Context.h.
Referenced by createVAArgInst(), and getOrCreateValueInternal().