LLVM 22.0.0git

Types represent the type of a value. More...

Collaboration diagram for Types:

Topics

 Integer Types
 Functions in this section operate on integer types.
 Floating Point Types
 Function Types
 Structure Types
 These functions relate to LLVMTypeRef instances.
 Sequential Types
 Sequential types represents "arrays" of types.
 Other Types

Functions

LLVM_C_ABI LLVMTypeKind LLVMGetTypeKind (LLVMTypeRef Ty)
 Obtain the enumerated type of a Type instance.
LLVM_C_ABI LLVMBool LLVMTypeIsSized (LLVMTypeRef Ty)
 Whether the type has a known size.
LLVM_C_ABI LLVMContextRef LLVMGetTypeContext (LLVMTypeRef Ty)
 Obtain the context to which this type instance is associated.
LLVM_C_ABI void LLVMDumpType (LLVMTypeRef Val)
 Dump a representation of a type to stderr.
LLVM_C_ABI charLLVMPrintTypeToString (LLVMTypeRef Val)
 Return a string representation of the type.

Detailed Description

Types represent the type of a value.

Types are associated with a context instance. The context internally deduplicates types so there is only 1 instance of a specific type alive at a time. In other words, a unique type is shared among all consumers within a context.

A Type in the C API corresponds to llvm::Type.

Types have the following hierarchy:

types: integer type real type function type sequence types: array type pointer type vector type void type label type opaque type

Function Documentation

◆ LLVMDumpType()

LLVM_C_ABI void LLVMDumpType ( LLVMTypeRef Val)

Dump a representation of a type to stderr.

See also
llvm::Type::dump()

Definition at line 641 of file Core.cpp.

References llvm::errs(), and llvm::unwrap().

◆ LLVMGetTypeContext()

LLVM_C_ABI LLVMContextRef LLVMGetTypeContext ( LLVMTypeRef Ty)

Obtain the context to which this type instance is associated.

See also
llvm::Type::getContext()

Definition at line 637 of file Core.cpp.

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

◆ LLVMGetTypeKind()

◆ LLVMPrintTypeToString()

LLVM_C_ABI char * LLVMPrintTypeToString ( LLVMTypeRef Val)

Return a string representation of the type.

Use LLVMDisposeMessage to free the string.

See also
llvm::Type::print()

Definition at line 645 of file Core.cpp.

References llvm::raw_ostream::flush(), and llvm::unwrap().

◆ LLVMTypeIsSized()

LLVM_C_ABI LLVMBool LLVMTypeIsSized ( LLVMTypeRef Ty)

Whether the type has a known size.

Things that don't have a size are abstract types, labels, and void.a

See also
llvm::Type::isSized()

Definition at line 632 of file Core.cpp.

References llvm::unwrap().