LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Structure Types
Collaboration diagram for Structure Types:

Functions

LLVMTypeRef LLVMStructTypeInContext (LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 
LLVMTypeRef LLVMStructType (LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 
LLVMTypeRef LLVMStructCreateNamed (LLVMContextRef C, const char *Name)
 
const char * LLVMGetStructName (LLVMTypeRef Ty)
 
void LLVMStructSetBody (LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
 
unsigned LLVMCountStructElementTypes (LLVMTypeRef StructTy)
 
void LLVMGetStructElementTypes (LLVMTypeRef StructTy, LLVMTypeRef *Dest)
 
LLVMBool LLVMIsPackedStruct (LLVMTypeRef StructTy)
 
LLVMBool LLVMIsOpaqueStruct (LLVMTypeRef StructTy)
 

Detailed Description

These functions relate to LLVMTypeRef instances.

See Also
llvm::StructType

Function Documentation

unsigned LLVMCountStructElementTypes ( LLVMTypeRef  StructTy)

Get the number of elements defined inside the structure.

See Also
llvm::StructType::getNumElements()

Definition at line 388 of file Core.cpp.

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 392 of file Core.cpp.

References llvm::StructType::element_begin(), llvm::StructType::element_end(), I, and llvm::wrap().

const char* LLVMGetStructName ( LLVMTypeRef  Ty)

Obtain the name of a structure.

See Also
llvm::StructType::getName()

Definition at line 374 of file Core.cpp.

References llvm::StringRef::data(), llvm::StructType::getName(), and llvm::StructType::hasName().

LLVMBool LLVMIsOpaqueStruct ( LLVMTypeRef  StructTy)

Determine whether a structure is opaque.

See Also
llvm::StructType::isOpaque()

Definition at line 403 of file Core.cpp.

LLVMBool LLVMIsPackedStruct ( LLVMTypeRef  StructTy)

Determine whether a structure is packed.

See Also
llvm::StructType::isPacked()

Definition at line 399 of file Core.cpp.

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 369 of file Core.cpp.

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

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 382 of file Core.cpp.

References llvm::unwrap().

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 363 of file Core.cpp.

References LLVMGetGlobalContext(), and 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 357 of file Core.cpp.

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

Referenced by LLVMStructType().