LLVM 19.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::sandboxir::Context Class Reference

#include "llvm/SandboxIR/SandboxIR.h"

Public Member Functions

 Context (LLVMContext &LLVMCtx)
 
sandboxir::ValuegetValue (llvm::Value *V) const
 
const sandboxir::ValuegetValue (const llvm::Value *V) const
 
FunctioncreateFunction (llvm::Function *F)
 
size_t getNumValues () const
 \Returns the number of values registered with Context.
 

Protected Member Functions

ValueregisterValue (std::unique_ptr< Value > &&VPtr)
 Take ownership of VPtr and store it in LLVMValueToValueMap.
 
ValuegetOrCreateValueInternal (llvm::Value *V, llvm::User *U=nullptr)
 
ArgumentgetOrCreateArgument (llvm::Argument *LLVMArg)
 
ValuegetOrCreateValue (llvm::Value *LLVMV)
 
BasicBlockcreateBasicBlock (llvm::BasicBlock *BB)
 

Protected Attributes

LLVMContextLLVMCtx
 
DenseMap< llvm::Value *, std::unique_ptr< sandboxir::Value > > LLVMValueToValueMap
 Maps LLVM Value to the corresponding sandboxir::Value.
 

Friends

class BasicBlock
 Various leaf nodes.
 

Detailed Description

Definition at line 618 of file SandboxIR.h.

Constructor & Destructor Documentation

◆ Context()

llvm::sandboxir::Context::Context ( LLVMContext LLVMCtx)
inline

Definition at line 650 of file SandboxIR.h.

Member Function Documentation

◆ createBasicBlock()

BasicBlock * Context::createBasicBlock ( llvm::BasicBlock BB)
protected

Definition at line 386 of file SandboxIR.cpp.

References assert(), BasicBlock, getValue(), and registerValue().

Referenced by createFunction().

◆ createFunction()

Function * Context::createFunction ( llvm::Function F)

◆ getNumValues()

size_t llvm::sandboxir::Context::getNumValues ( ) const
inline

\Returns the number of values registered with Context.

Definition at line 660 of file SandboxIR.h.

References LLVMValueToValueMap.

Referenced by llvm::sandboxir::Value::Value().

◆ getOrCreateArgument()

Argument * llvm::sandboxir::Context::getOrCreateArgument ( llvm::Argument LLVMArg)
inlineprotected

Definition at line 631 of file SandboxIR.h.

References LLVMValueToValueMap.

Referenced by createFunction().

◆ getOrCreateValue()

Value * llvm::sandboxir::Context::getOrCreateValue ( llvm::Value LLVMV)
inlineprotected

Definition at line 641 of file SandboxIR.h.

References getOrCreateValueInternal().

◆ getOrCreateValueInternal()

Value * Context::getOrCreateValueInternal ( llvm::Value V,
llvm::User U = nullptr 
)
protected

◆ getValue() [1/2]

const sandboxir::Value * llvm::sandboxir::Context::getValue ( const llvm::Value V) const
inline

Definition at line 653 of file SandboxIR.h.

References getValue().

◆ getValue() [2/2]

Value * Context::getValue ( llvm::Value V) const

◆ registerValue()

Value * Context::registerValue ( std::unique_ptr< Value > &&  VPtr)
protected

Take ownership of VPtr and store it in LLVMValueToValueMap.

Definition at line 347 of file SandboxIR.cpp.

References assert(), and LLVMValueToValueMap.

Referenced by createBasicBlock(), and createFunction().

Friends And Related Function Documentation

◆ BasicBlock

friend class BasicBlock
friend

Various leaf nodes.

Definition at line 647 of file SandboxIR.h.

Referenced by createBasicBlock().

Member Data Documentation

◆ LLVMCtx

LLVMContext& llvm::sandboxir::Context::LLVMCtx
protected

Definition at line 620 of file SandboxIR.h.

◆ LLVMValueToValueMap

DenseMap<llvm::Value *, std::unique_ptr<sandboxir::Value> > llvm::sandboxir::Context::LLVMValueToValueMap
protected

Maps LLVM Value to the corresponding sandboxir::Value.

Owns all SandboxIR objects.

Definition at line 624 of file SandboxIR.h.

Referenced by getNumValues(), getOrCreateArgument(), getOrCreateValueInternal(), getValue(), and registerValue().


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