LLVM 19.0.0git
Functions

These functions relate to LLVMTypeRef instances. More...

Collaboration diagram for Structure Types:

Functions

LLVMTypeRef LLVMStructTypeInContext (LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 Create a new structure type in a context.
 
LLVMTypeRef LLVMStructType (LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 Create a new structure type in the global context.
 
LLVMTypeRef LLVMStructCreateNamed (LLVMContextRef C, const char *Name)
 Create an empty structure in a context having a specified name.
 
const charLLVMGetStructName (LLVMTypeRef Ty)
 Obtain the name of a structure.
 
void LLVMStructSetBody (LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 Set the contents of a structure type.
 
unsigned LLVMCountStructElementTypes (LLVMTypeRef StructTy)
 Get the number of elements defined inside the structure.
 
void LLVMGetStructElementTypes (LLVMTypeRef StructTy, LLVMTypeRef *Dest)
 Get the elements within a structure.
 
LLVMTypeRef LLVMStructGetTypeAtIndex (LLVMTypeRef StructTy, unsigned i)
 Get the type of the element at a given index in the structure.
 
LLVMBool LLVMIsPackedStruct (LLVMTypeRef StructTy)
 Determine whether a structure is packed.
 
LLVMBool LLVMIsOpaqueStruct (LLVMTypeRef StructTy)
 Determine whether a structure is opaque.
 
LLVMBool LLVMIsLiteralStruct (LLVMTypeRef StructTy)
 Determine whether a structure is literal.
 

Detailed Description

These functions relate to LLVMTypeRef instances.

See also
llvm::StructType

Function Documentation

◆ LLVMCountStructElementTypes()

unsigned LLVMCountStructElementTypes ( LLVMTypeRef  StructTy)

Get the number of elements defined inside the structure.

See also
llvm::StructType::getNumElements()

Definition at line 803 of file Core.cpp.

◆ LLVMGetStructElementTypes()

void LLVMGetStructElementTypes ( LLVMTypeRef  StructTy,
LLVMTypeRef Dest 
)

Get the elements within a structure.

The function is passed the address of a pre-allocated array of LLVMTypeRef at least LLVMCountStructElementTypes() long. After invocation, this array will be populated with the structure's elements. The objects in the destination array will have a lifetime of the structure type itself, which is the lifetime of the context it is contained in.

Definition at line 807 of file Core.cpp.

References llvm::StructType::elements(), and llvm::wrap().

◆ LLVMGetStructName()

const char * LLVMGetStructName ( LLVMTypeRef  Ty)

Obtain the name of a structure.

See also
llvm::StructType::getName()

Definition at line 789 of file Core.cpp.

◆ LLVMIsLiteralStruct()

LLVMBool LLVMIsLiteralStruct ( LLVMTypeRef  StructTy)

Determine whether a structure is literal.

See also
llvm::StructType::isLiteral()

Definition at line 826 of file Core.cpp.

◆ LLVMIsOpaqueStruct()

LLVMBool LLVMIsOpaqueStruct ( LLVMTypeRef  StructTy)

Determine whether a structure is opaque.

See also
llvm::StructType::isOpaque()

Definition at line 822 of file Core.cpp.

◆ LLVMIsPackedStruct()

LLVMBool LLVMIsPackedStruct ( LLVMTypeRef  StructTy)

Determine whether a structure is packed.

See also
llvm::StructType::isPacked()

Definition at line 818 of file Core.cpp.

◆ LLVMStructCreateNamed()

LLVMTypeRef LLVMStructCreateNamed ( LLVMContextRef  C,
const char Name 
)

Create an empty structure in a context having a specified name.

See also
llvm::StructType::create()

Definition at line 784 of file Core.cpp.

References llvm::CallingConv::C, llvm::StructType::create(), Name, llvm::unwrap(), and llvm::wrap().

◆ LLVMStructGetTypeAtIndex()

LLVMTypeRef LLVMStructGetTypeAtIndex ( LLVMTypeRef  StructTy,
unsigned  i 
)

Get the type of the element at a given index in the structure.

See also
llvm::StructType::getTypeAtIndex()

Definition at line 813 of file Core.cpp.

References llvm::StructType::getTypeAtIndex(), and llvm::wrap().

◆ LLVMStructSetBody()

void LLVMStructSetBody ( LLVMTypeRef  StructTy,
LLVMTypeRef ElementTypes,
unsigned  ElementCount,
LLVMBool  Packed 
)

Set the contents of a structure type.

See also
llvm::StructType::setBody()

Definition at line 797 of file Core.cpp.

References llvm::unwrap().

◆ LLVMStructType()

LLVMTypeRef LLVMStructType ( LLVMTypeRef ElementTypes,
unsigned  ElementCount,
LLVMBool  Packed 
)

Create a new structure type in the global context.

See also
llvm::StructType::create()

Definition at line 778 of file Core.cpp.

References LLVMGetGlobalContext(), and LLVMStructTypeInContext().

◆ LLVMStructTypeInContext()

LLVMTypeRef LLVMStructTypeInContext ( LLVMContextRef  C,
LLVMTypeRef ElementTypes,
unsigned  ElementCount,
LLVMBool  Packed 
)

Create a new structure type in a context.

A structure is specified by a list of inner elements/types and whether these can be packed together.

See also
llvm::StructType::create()

Definition at line 772 of file Core.cpp.

References llvm::CallingConv::C, llvm::StructType::get(), llvm::unwrap(), and llvm::wrap().

Referenced by LLVMStructType().