clang 19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
clang::CodeGen::Address Class Reference

Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this class is possibly signed. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/Address.h"

Public Member Functions

 Address (llvm::Value *pointer, llvm::Type *elementType, CharUnits alignment, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
 
 Address (llvm::Value *BasePtr, llvm::Type *ElementType, CharUnits Alignment, llvm::Value *Offset, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
 
 Address (RawAddress RawAddr)
 
bool isValid () const
 
void replaceBasePointer (llvm::Value *P)
 This function is used in situations where the caller is doing some sort of opaque "laundering" of the pointer.
 
CharUnits getAlignment () const
 
void setAlignment (CharUnits Value)
 
llvm::Value * getBasePointer () const
 
llvm::PointerType * getType () const
 Return the type of the pointer value.
 
llvm::Type * getElementType () const
 Return the type of the values stored in this address.
 
unsigned getAddressSpace () const
 Return the address space that this address resides in.
 
llvm::StringRef getName () const
 Return the IR name of the pointer value.
 
void setElementType (llvm::Type *Ty)
 
KnownNonNull_t isKnownNonNull () const
 Whether the pointer is known not to be null.
 
Address setKnownNonNull ()
 
bool hasOffset () const
 
llvm::Value * getOffset () const
 
llvm::Value * emitRawPointer (CodeGenFunction &CGF) const
 Return the pointer contained in this class after authenticating it and adding offset to it if necessary.
 
Address withPointer (llvm::Value *NewPointer, KnownNonNull_t IsKnownNonNull) const
 Return address with different pointer, but same element type and alignment.
 
Address withAlignment (CharUnits NewAlignment) const
 Return address with different alignment, but same pointer and element type.
 
Address withElementType (llvm::Type *ElemTy) const
 Return address with different element type, but same pointer and alignment.
 

Static Public Member Functions

static Address invalid ()
 

Protected Member Functions

 Address (std::nullptr_t)
 

Friends

class CGBuilderTy
 

Detailed Description

Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this class is possibly signed.

Definition at line 111 of file Address.h.

Constructor & Destructor Documentation

◆ Address() [1/4]

clang::CodeGen::Address::Address ( std::nullptr_t  )
inlineprotected

Definition at line 130 of file Address.h.

◆ Address() [2/4]

clang::CodeGen::Address::Address ( llvm::Value *  pointer,
llvm::Type *  elementType,
CharUnits  alignment,
KnownNonNull_t  IsKnownNonNull = NotKnownNonNull 
)
inline

Definition at line 133 of file Address.h.

References clang::CharUnits::isZero().

◆ Address() [3/4]

clang::CodeGen::Address::Address ( llvm::Value *  BasePtr,
llvm::Type *  ElementType,
CharUnits  Alignment,
llvm::Value *  Offset,
KnownNonNull_t  IsKnownNonNull = NotKnownNonNull 
)
inline

Definition at line 142 of file Address.h.

◆ Address() [4/4]

clang::CodeGen::Address::Address ( RawAddress  RawAddr)
inline

Definition at line 147 of file Address.h.

Member Function Documentation

◆ emitRawPointer()

llvm::Value * clang::CodeGen::Address::emitRawPointer ( CodeGenFunction CGF) const
inline

Return the pointer contained in this class after authenticating it and adding offset to it if necessary.

Definition at line 220 of file Address.h.

References getBasePointer().

Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), ApplyNonVirtualAndVirtualOffset(), clang::CodeGen::CGObjCRuntime::canMessageReceiverBeNull(), castValueFromUintptr(), clang::CodeGen::CGBuilderTy::CreateAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateAtomicCmpXchg(), clang::CodeGen::CGBuilderTy::CreateAtomicRMW(), CreateCoercedLoad(), CreateCoercedStore(), clang::CodeGen::CGBuilderTy::CreateGEP(), createLoadInstBefore(), createStoreInstBefore(), emitARCCopyOperation(), emitARCLoadOperation(), emitARCStoreOperation(), EmitArrayDelete(), emitArraySubscriptGEP(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), EmitDestroyingObjectDelete(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), EmitDoacrossOrdered(), clang::CodeGen::CGOpenMPRuntime::emitForNext(), emitForStaticInitCall(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenPGO::emitMCDCCondBitmapUpdate(), clang::CodeGen::CodeGenPGO::emitMCDCTestVectorBitmapUpdate(), clang::CodeGen::emitMergePHI(), emitNonZeroVLAInit(), EmitObjectDelete(), EmitOMPAggregateInit(), EmitOMPAggregateReduction(), emitOMPAtomicCompareExpr(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), emitProxyTaskFunction(), clang::CodeGen::LValue::emitRawPointer(), clang::CodeGen::AggValueSlot::emitRawPointer(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), emitStructGetterCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsCall(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarInit(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CGOpenMPRuntime::emitUpdateClause(), clang::CodeGen::CGOpenMPRuntime::emitUsesAllocatorsInit(), clang::CodeGen::EmitVAArgInstr(), clang::CodeGen::emitVoidPtrDirectVAArg(), emitWritebackArg(), EnterNewDeleteCleanup(), clang::CodeGen::RValue::get(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getPointerAndSize(), clang::CodeGen::LValue::getRawBitFieldPointer(), clang::CodeGen::LValue::getRawExtVectorPointer(), clang::CodeGen::LValue::getRawVectorPointer(), InitCatchParam(), performTypeAdjustment(), pushTemporaryCleanup(), clang::CodeGen::CGCXXABI::ReadArrayCookie(), clang::CodeGen::DominatingLLVMValue::save(), clang::CodeGen::CodeGenFunction::setBeforeOutermostConditional(), clang::CodeGen::CodeGenFunction::OMPMapVars::setVarAddr(), shuffleAndStore(), and wrapWithBPFPreserveStaticOffset().

◆ getAddressSpace()

unsigned clang::CodeGen::Address::getAddressSpace ( ) const
inline

Return the address space that this address resides in.

Definition at line 190 of file Address.h.

References getType().

◆ getAlignment()

CharUnits clang::CodeGen::Address::getAlignment ( ) const
inline

Definition at line 166 of file Address.h.

Referenced by ApplyNonVirtualAndVirtualOffset(), CheckAtomicAlignment(), clang::CodeGen::CGBuilderTy::CreateAddrSpaceCast(), clang::CodeGen::CGBuilderTy::CreateAtomicCmpXchg(), clang::CodeGen::CGBuilderTy::CreateAtomicRMW(), CreateCoercedLoad(), CreateCoercedStore(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateConstByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), createLoadInstBefore(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CGBuilderTy::CreateMemCpyInline(), clang::CodeGen::CGBuilderTy::CreateMemMove(), clang::CodeGen::CGBuilderTy::CreateMemSet(), clang::CodeGen::CGBuilderTy::CreateMemSetInline(), clang::CodeGen::CGBuilderTy::CreatePreserveStructAccessIndex(), clang::CodeGen::CGBuilderTy::CreateStore(), createStoreInstBefore(), clang::CodeGen::CGBuilderTy::CreateStructGEP(), clang::CodeGen::CodeGenFunction::CXXDefaultInitExprScope::CXXDefaultInitExprScope(), EmitArrayDelete(), emitArraySubscriptGEP(), emitGlobalToListCopyFunction(), emitListToGlobalCopyFunction(), clang::CodeGen::emitMergePHI(), emitNonZeroVLAInit(), EmitNullBaseClassInitialization(), EmitOMPAggregateInit(), EmitOMPAggregateReduction(), emitStoresForConstant(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::ParamValue::forIndirect(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::AggValueSlot::getAlignment(), clang::CodeGen::CodeGenFunction::mergeAddressesInConditionalExpr(), clang::CodeGen::DominatingValue< Address >::save(), clang::CodeGen::CodeGenFunction::setBeforeOutermostConditional(), shuffleAndStore(), withElementType(), withPointer(), and wrapWithBPFPreserveStaticOffset().

◆ getBasePointer()

llvm::Value * clang::CodeGen::Address::getBasePointer ( ) const
inline

◆ getElementType()

llvm::Type * clang::CodeGen::Address::getElementType ( ) const
inline

Return the type of the values stored in this address.

Definition at line 184 of file Address.h.

References isValid().

Referenced by clang::CodeGen::ReductionCodeGen::adjustPrivateAddress(), CheckAtomicAlignment(), CreateCoercedLoad(), CreateCoercedStore(), clang::CodeGen::CGBuilderTy::CreateConstArrayGEP(), clang::CodeGen::CGBuilderTy::CreateConstByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP(), clang::CodeGen::CGBuilderTy::CreateGEP(), clang::CodeGen::CGBuilderTy::CreateInBoundsGEP(), clang::CodeGen::CGBuilderTy::CreateLoad(), createLoadInstBefore(), clang::CodeGen::CGBuilderTy::CreatePreserveStructAccessIndex(), clang::CodeGen::CGBuilderTy::CreateStructGEP(), emitARCStoreOperation(), EmitArrayDelete(), emitArraySubscriptGEP(), EmitCheckedMixedSignMultiply(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), clang::CodeGen::emitMergePHI(), emitNonZeroVLAInit(), EmitOMPAggregateInit(), EmitOMPAggregateReduction(), emitOMPArraySectionBase(), emitOMPAtomicCompareExpr(), emitStoresForConstant(), emitStoresForPatternInit(), emitStoresForZeroInit(), clang::CodeGen::emitVoidPtrDirectVAArg(), emitWriteback(), EnterStructPointerForCoercedAccess(), findDominatingStoreToReturnValue(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getNullForVariable(), getPointerAndSize(), clang::CodeGen::DominatingValue< Address >::save(), shuffleAndStore(), tryEmitARCCopyWeakInit(), withAlignment(), withPointer(), and wrapWithBPFPreserveStaticOffset().

◆ getName()

llvm::StringRef clang::CodeGen::Address::getName ( ) const
inline

Return the IR name of the pointer value.

Definition at line 193 of file Address.h.

References Pointer.

Referenced by CreateCoercedLoad().

◆ getOffset()

llvm::Value * clang::CodeGen::Address::getOffset ( ) const
inline

◆ getType()

llvm::PointerType * clang::CodeGen::Address::getType ( ) const
inline

◆ hasOffset()

bool clang::CodeGen::Address::hasOffset ( ) const
inline

◆ invalid()

static Address clang::CodeGen::Address::invalid ( )
inlinestatic

◆ isKnownNonNull()

KnownNonNull_t clang::CodeGen::Address::isKnownNonNull ( ) const
inline

◆ isValid()

bool clang::CodeGen::Address::isValid ( ) const
inline

◆ replaceBasePointer()

void clang::CodeGen::Address::replaceBasePointer ( llvm::Value *  P)
inline

This function is used in situations where the caller is doing some sort of opaque "laundering" of the pointer.

Definition at line 158 of file Address.h.

References isValid(), P, and Pointer.

Referenced by clang::CodeGen::CGBuilderTy::CreateLaunderInvariantGroup(), clang::CodeGen::CGBuilderTy::CreatePreserveUnionAccessIndex(), clang::CodeGen::CGBuilderTy::CreateStripInvariantGroup(), and clang::CodeGen::CodeGenFunction::mergeAddressesInConditionalExpr().

◆ setAlignment()

void clang::CodeGen::Address::setAlignment ( CharUnits  Value)
inline

◆ setElementType()

void clang::CodeGen::Address::setElementType ( llvm::Type *  Ty)
inline

Definition at line 196 of file Address.h.

References hasOffset().

◆ setKnownNonNull()

Address clang::CodeGen::Address::setKnownNonNull ( )
inline

Definition at line 208 of file Address.h.

References isValid(), clang::CodeGen::KnownNonNull, and Pointer.

Referenced by clang::CodeGen::AggValueSlot::forAddr().

◆ withAlignment()

Address clang::CodeGen::Address::withAlignment ( CharUnits  NewAlignment) const
inline

Return address with different alignment, but same pointer and element type.

Definition at line 234 of file Address.h.

References getElementType(), isKnownNonNull(), and Pointer.

Referenced by CheckAtomicAlignment(), emitOutlinedFunctionPrologue(), and emitPrivatesInit().

◆ withElementType()

Address clang::CodeGen::Address::withElementType ( llvm::Type *  ElemTy) const
inline

◆ withPointer()

Address clang::CodeGen::Address::withPointer ( llvm::Value *  NewPointer,
KnownNonNull_t  IsKnownNonNull 
) const
inline

Return address with different pointer, but same element type and alignment.

Definition at line 226 of file Address.h.

References getAlignment(), and getElementType().

Referenced by castToBase().

Friends And Related Function Documentation

◆ CGBuilderTy

friend class CGBuilderTy
friend

Definition at line 112 of file Address.h.


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