On this page:
7.1 Type and Value Classification
_  llvm-type-kind
_  llvm-value-kind
7.2 Linkage and Visibility
_  llvm-linkage
_  llvm-visibility
7.3 Addressing and Storage
_  llvm-unnamed-addr
_  llvmdll-storage-class
7.4 Thread-Local Storage
_  llvm-thread-local-mode
7.5 Calling Conventions
_  llvm-call-conv
7.6 Enums for Atomic Operations
_  llvm-atomic-ordering
_  llvm-atomic-rmw-bin-op
7.7 Function Call Optimization
_  llvm-tail-call-kind
7.8 Enums for Inline Assembly
_  llvm-inline-asm-dialect
7.9 Code Generation Configuration
_  llvm-code-gen-opt-level
_  llvm-reloc-mode
_  llvm-code-model
_  llvm-code-gen-file-type
7.10 Module and Debug Information
_  llvm-module-flag-behavior
_  llvmdi-flags
_  llvmdwarf-source-language
_  llvmdwarf-emission-kind
7.11 Other Enumerations
_  llvm-diagnostic-severity
_  llvm-comdat-selection-kind
_  llvm-binary-type
_  llvm-global-i-sel-abort-mode
9.1

7 Enumerations🔗ℹ

LLVM uses enumerations to represent various configuration options, types, and flags. This section documents the commonly used enumerations in racket-llvm.

7.1 Type and Value Classification🔗ℹ

A classification of LLVM types. Used by llvm-get-type-kind to determine the kind of a type.

Possible values:
  • llvm-void-type-kind — Void type

  • llvm-integer-type-kind — Integer type

  • llvm-float-type-kind — IEEE 754 single-precision float

  • llvm-double-type-kind — IEEE 754 double-precision float

  • llvm-label-type-kind — Label type for basic blocks

  • llvm-function-type-kind — Function type

  • llvm-struct-type-kind — Struct type

  • llvm-array-type-kind — Array type

  • llvm-pointer-type-kind — Pointer type

  • llvm-vector-type-kind — Vector type

  • llvm-metadata-type-kind — Metadata type

  • Other floating-point and special types

A classification of LLVM values (operands in instructions). Used by llvm-get-value-kind to determine the kind of a value.

Possible values include:
  • llvm-argument-value-kind — Function argument

  • llvm-basic-block-value-kind — Basic block

  • llvm-function-value-kind — Function

  • llvm-global-variable-value-kind — Global variable

  • llvm-global-alias-value-kind — Global alias

  • llvm-constant-int-value-kind — Constant integer

  • llvm-constant-fp-value-kind — Constant floating-point

  • llvm-instruction-value-kind — Instruction

  • Other constant and special value kinds

7.2 Linkage and Visibility🔗ℹ

Specifies how a global value is linked. Used by llvm-get-linkage and llvm-set-linkage to control global symbol visibility and linking behavior.

Possible values:
  • llvm-external-linkage — External linkage (default)

  • llvm-available-externally-linkage — Available externally

  • llvm-link-once-any-linkage — Link once, any definition

  • llvm-link-once-odr-linkage — Link once, one definition rule (ODR)

  • llvm-weak-any-linkage — Weak linkage, any definition

  • llvm-weak-odr-linkage — Weak linkage, ODR

  • llvm-appending-linkage — Appending linkage

  • llvm-internal-linkage — Internal (static) linkage

  • llvm-private-linkage — Private linkage

  • llvm-external-weak-linkage — External weak linkage

  • llvm-common-linkage — Common linkage

Controls the visibility of a global symbol. Used by llvm-get-visibility and llvm-set-visibility.

Possible values:
  • llvm-default-visibility — Default visibility

  • llvm-hidden-visibility — Hidden visibility (not exported from shared library)

  • llvm-protected-visibility — Protected visibility (exported but not overridable)

7.3 Addressing and Storage🔗ℹ

Specifies the unnamed address mode for global values. Used by llvm-get-unnamed-address and llvm-set-unnamed-address.

Possible values:
  • llvm-no-unnamed-addr — Address is significant

  • llvm-local-unnamed-addr — Address is locally unnamed

  • llvm-global-unnamed-addr — Address is globally unnamed

Specifies DLL storage class for symbols on Windows. Used by llvm-get-dll-storage-class and llvm-set-dll-storage-class.

Possible values:
  • llvm-default-storage-class — Default storage class

  • llvmdll-import-storage-class — DLL import

  • llvmdll-export-storage-class — DLL export

7.4 Thread-Local Storage🔗ℹ

Specifies the thread-local storage model for global variables. Used by llvm-get-thread-local-mode and llvm-set-thread-local-mode.

Possible values:
  • llvm-not-thread-local — Not thread-local (default)

  • llvm-general-dynamic-tls-model — General dynamic TLS model

  • llvm-local-dynamic-tls-model — Local dynamic TLS model

  • llvm-initial-exec-tls-model — Initial exec TLS model

  • llvm-local-exec-tls-model — Local exec TLS model

7.5 Calling Conventions🔗ℹ

Specifies the calling convention for functions. Used by llvm-get-function-call-conv.

Possible values include:
  • llvmc-call-conv — C calling convention (default)

  • llvm-fast-call-conv — Fast calling convention

  • llvm-cold-call-conv — Cold calling convention

  • llvmx86-stdcall-call-conv — x86 stdcall

  • llvmx86-fastcall-call-conv — x86 fastcall

  • llvm-arm-aapcs-call-conv — ARM AAPCS

  • llvmx8664-sys-v-call-conv — x86-64 System V

  • llvm-win64-call-conv — Windows x64

  • llvm-preserve-most-call-conv — Preserve most registers

  • llvm-preserve-all-call-conv — Preserve all registers

  • Other platform and architecture specific conventions

7.6 Enums for Atomic Operations🔗ℹ

Specifies memory ordering semantics for atomic operations. Used by llvm-build-atomic-rmw, llvm-build-atomic-cmp-xchg, and related functions.

Possible values:
  • llvm-atomic-ordering-not-atomic — Non-atomic

  • llvm-atomic-ordering-unordered — Unordered

  • llvm-atomic-ordering-monotonic — Monotonic

  • llvm-atomic-ordering-acquire — Acquire semantics

  • llvm-atomic-ordering-release — Release semantics

  • llvm-atomic-ordering-acquire-release — Acquire-release semantics

  • llvm-atomic-ordering-sequentially-consistent — Sequential consistency

Specifies the atomic read-modify-write operation. Used by llvm-build-atomic-rmw, llvm-get-atomic-rmw-bin-op, and llvm-set-atomic-rmw-bin-op.

Possible values:
  • llvm-atomic-rmw-bin-op-xchg — Exchange

  • llvm-atomic-rmw-bin-op-add — Add

  • llvm-atomic-rmw-bin-op-sub — Subtract

  • llvm-atomic-rmw-bin-op-and — Bitwise AND

  • llvm-atomic-rmw-bin-op-or — Bitwise OR

  • llvm-atomic-rmw-bin-op-xor — Bitwise XOR

  • llvm-atomic-rmw-bin-op-max — Maximum (signed)

  • llvm-atomic-rmw-bin-op-min — Minimum (signed)

  • llvm-atomic-rmw-bin-op-u-max — Maximum (unsigned)

  • llvm-atomic-rmw-bin-op-u-min — Minimum (unsigned)

  • Floating-point operations: llvm-atomic-rmw-bin-op-f-add, llvm-atomic-rmw-bin-op-f-sub, etc.

7.7 Function Call Optimization🔗ℹ

Specifies tail call optimization hints for function calls. Used by llvm-get-tail-call-kind and llvm-set-tail-call-kind.

Possible values:
  • llvm-tail-call-kind-none — No tail call optimization

  • llvm-tail-call-kind-tail — May be tail called

  • llvm-tail-call-kind-must-tail — Must be tail called

  • llvm-tail-call-kind-no-tail — Cannot be tail called

7.8 Enums for Inline Assembly🔗ℹ

Specifies the assembly dialect for inline assembly. Used by llvm-get-inline-asm, llvm-get-inline-asm-dialect.

Possible values:
  • llvm-inline-asm-dialect-att — AT&T assembly syntax

  • llvm-inline-asm-dialect-intel — Intel assembly syntax

7.9 Code Generation Configuration🔗ℹ

Specifies the code generation optimization level. Used by llvm-create-target-machine and llvm-target-machine-options-set-code-gen-opt-level.

Possible values:
  • llvm-code-gen-level-none — No optimization

  • llvm-code-gen-level-less — Less optimization (faster compilation)

  • llvm-code-gen-level-default — Default optimization

  • llvm-code-gen-level-aggressive — Aggressive optimization

Specifies the relocation model for code generation. Used by llvm-create-target-machine and llvm-target-machine-options-set-reloc-mode.

Possible values:
  • llvm-reloc-default — Default relocation model

  • llvm-reloc-static — Static relocation

  • llvm-reloc-pic — Position-independent code (PIC)

  • llvm-reloc-dynamic-no-pic — Dynamic with no PIC

  • llvm-reloc-ropi — Read-only position-independent

  • llvm-reloc-rwpi — Read-write position-independent

  • llvm-reloc-ropi-rwpi — Both read-only and read-write PIC

Specifies the code model for memory addressing. Used by llvm-create-target-machine and llvm-target-machine-options-set-code-model.

Possible values:
  • llvm-code-model-default — Default code model

  • llvm-code-model-jit-default — JIT default

  • llvm-code-model-tiny — Tiny (32KB code)

  • llvm-code-model-small — Small (2GB code)

  • llvm-code-model-kernel — Kernel (512MB absolute addresses)

  • llvm-code-model-medium — Medium (2GB code, unlimited data)

  • llvm-code-model-large — Large (unlimited)

Specifies the output file type for code generation. Used by llvm-target-machine-emit-to-file and llvm-target-machine-emit-to-memory-buffer.

Possible values:
  • llvm-assembly-file — Emit assembly code

  • llvm-object-file — Emit object file

7.10 Module and Debug Information🔗ℹ

Specifies the behavior when module flags conflict. Used by llvm-add-module-flag and llvm-module-flag-entries-get-flag-behavior.

Possible values:
  • llvm-module-flag-behavior-error — Error on conflict

  • llvm-module-flag-behavior-warning — Warn on conflict

  • llvm-module-flag-behavior-require — Require the flag

  • llvm-module-flag-behavior-override — Override existing flag

  • llvm-module-flag-behavior-append — Append to existing flag

  • llvm-module-flag-behavior-append-unique — Append only if unique

Specifies debug information flags for DIType and related nodes. Used by llvmdi-type-get-flags.

Flags are bitwise combinations of debug info properties controlling visibility, virtuality, and other metadata properties for debug information.

Specifies the source language for debug information. Used by llvmdi-builder-create-compile-unit.

Possible values include languages such as:
  • llvmdwarf-source-language-c — C

  • llvmdwarf-source-language-c-plus-plus — C++

  • llvmdwarf-source-language-c99 — C99

  • llvmdwarf-source-language-java — Java

  • llvmdwarf-source-language-obj-c — Objective-C

  • llvmdwarf-source-language-obj-c-plus-plus — Objective-C++

  • Other language identifiers

Specifies the DWARF debug information emission mode. Used by llvmdi-builder-create-compile-unit.

Possible values:
  • llvmdwarf-emission-kind-none — No debug information

  • llvmdwarf-emission-kind-full — Full debug information

  • llvmdwarf-emission-kind-line-tables-only — Line tables only

7.11 Other Enumerations🔗ℹ

Specifies the severity level of a diagnostic message. Used by llvm-get-diag-info-severity.

Possible values:
  • llvmds-error — Error

  • llvmds-warning — Warning

  • llvmds-remark — Remark

  • llvmds-note — Note

Specifies COMDAT symbol selection strategy for linker deduplication. Used by llvm-get-comdat-selection-kind and llvm-set-comdat-selection-kind.

Possible values:
  • llvm-any-comdat-selection-kind — Any definition

  • llvm-exact-match-comdat-selection-kind — Exact match required

  • llvm-largest-comdat-selection-kind — Select largest

  • llvm-no-deduplicate-comdat-selection-kind — No deduplication

  • llvm-same-size-comdat-selection-kind — Same size only

Specifies the type of a binary object file. Used by llvm-binary-get-type.

Possible values include:
  • llvm-binary-type-archive — Archive (static library)

  • llvm-binary-type-coff — COFF object file (Windows)

  • llvm-binary-type-elf32l — ELF 32-bit little-endian

  • llvm-binary-type-elf64l — ELF 64-bit little-endian

  • llvm-binary-type-mach-o64l — Mach-O 64-bit (macOS)

  • llvm-binary-type-wasm — WebAssembly

  • llvm-binary-type-ir — LLVM IR

  • Other binary formats

Controls the behavior of GlobalISel (global instruction selector) when it fails. Used by llvm-set-target-machine-global-i-sel-abort.

Possible values:
  • llvm-global-i-sel-abort-enable — Enable, abort on failure

  • llvm-global-i-sel-abort-disable — Disable GlobalISel

  • llvm-global-i-sel-abort-disable-with-diag — Disable and show diagnostics