AttributeKind

public enum AttributeKind : String

Enumerates the kinds of attributes of LLVM functions and function parameters.

  • This attribute indicates that, when emitting the prologue and epilogue, the backend should forcibly align the stack pointer.

    Declaration

    Swift

    case alignstack
  • This attribute indicates that the annotated function will always return at least a given number of bytes (or null).

    Declaration

    Swift

    case allocsize
  • This attribute indicates that the inliner should attempt to inline this function into callers whenever possible, ignoring any active inlining size threshold for this caller.

    Declaration

    Swift

    case alwaysinline
  • This indicates that the callee function at a call site should be recognized as a built-in function, even though the function’s declaration uses the nobuiltin attribute

    Declaration

    Swift

    case builtin
  • This attribute indicates that this function is rarely called.

    Declaration

    Swift

    case cold
  • In some parallel execution models, there exist operations that cannot be made control-dependent on any additional values.

    Declaration

    Swift

    case convergent
  • This attribute indicates that the function may only access memory that is not accessible by the module being compiled.

    Declaration

    Swift

    case inaccessiblememonly
  • This attribute indicates that the function may only access memory that is either not accessible by the module being compiled, or is pointed to by its pointer arguments.

    Declaration

    Swift

    case inaccessiblememOrArgmemonly = "inaccessiblemem_or_argmemonly"
  • This attribute indicates that the source code contained a hint that inlin inlining this function is desirable (such as the “inline” keyword in C/C++).

    Declaration

    Swift

    case inlinehint
  • This attribute indicates that the function should be added to a jump-instruction table at code-generation time, and that all address-taken references to this function should be replaced with a reference to the appropriate jump-instruction-table function pointer.

    Declaration

    Swift

    case jumptable
  • This attribute suggests that optimization passes and code generator passes make choices that keep the code size of this function as small as possible and perform optimizations that may sacrifice runtime performance in order to minimize the size of the generated code.

    Declaration

    Swift

    case minsize
  • This attribute disables prologue / epilogue emission for the function.

    Declaration

    Swift

    case naked
  • When this attribute is set to true, the jump tables and lookup tables that can be generated from a switch case lowering are disabled.

    Declaration

    Swift

    case noJumpTables = "no-jump-tables"
  • This indicates that the callee function at a call site is not recognized as a built-in function.

    Declaration

    Swift

    case nobuiltin
  • This attribute indicates that calls to the function cannot be duplicated.

    Declaration

    Swift

    case noduplicate
  • This attributes disables implicit floating point instructions.

    Declaration

    Swift

    case noimplicitfloat
  • This attribute indicates that the inliner should never inline this function in any situation.

    Declaration

    Swift

    case noinline
  • This attribute suppresses lazy symbol binding for the function.

    Declaration

    Swift

    case nonlazybind
  • This attribute indicates that the code generator should not use a red zone, even if the target-specific ABI normally permits it.

    Declaration

    Swift

    case noredzone
  • This function attribute indicates that the function never returns normally.

    Declaration

    Swift

    case noreturn
  • This function attribute indicates that the function does not call itself either directly or indirectly down any possible call path.

    Declaration

    Swift

    case norecurse
  • This function attribute indicates that the function never raises an exception.

    Declaration

    Swift

    case nounwind
  • This function attribute indicates that most optimization passes will skip this function, with the exception of interprocedural optimization passes.

    Declaration

    Swift

    case optnone
  • This attribute suggests that optimization passes and code generator passes make choices that keep the code size of this function low, and otherwise do optimizations specifically to reduce code size as long as they do not significantly impact runtime performance.

    Declaration

    Swift

    case optsize
  • This attribute indicates that the function computes its result (or decides to unwind an exception) based strictly on its arguments, without dereferencing any pointer arguments or otherwise accessing any mutable state (e.g. memory, control registers, etc) visible to caller functions.

    Declaration

    Swift

    case readnone
  • This attribute indicates that the function does not write through any pointer arguments (including byval arguments) or otherwise modify any state (e.g. memory, control registers, etc) visible to caller functions.

    Declaration

    Swift

    case readonly
  • This attribute indicates that the function may write to but does not read read from memory.

    Declaration

    Swift

    case writeonly
  • This attribute indicates that the only memory accesses inside function are loads and stores from objects pointed to by its pointer-typed arguments, with arbitrary offsets.

    Declaration

    Swift

    case argmemonly
  • This attribute indicates that this function can return twice.

    Declaration

    Swift

    case returnsTwice = "returns_twice"
  • This attribute indicates that SafeStack protection is enabled for this function.

    Declaration

    Swift

    case safestack
  • This attribute indicates that AddressSanitizer checks (dynamic address safety analysis) are enabled for this function.

    Declaration

    Swift

    case sanitizeAddress = "sanitize_address"
  • This attribute indicates that MemorySanitizer checks (dynamic detection of accesses to uninitialized memory) are enabled for this function.

    Declaration

    Swift

    case sanitizeMemory = "sanitize_memory"
  • This attribute indicates that ThreadSanitizer checks (dynamic thread safety analysis) are enabled for this function.

    Declaration

    Swift

    case sanitizeThread = "sanitize_thread"
  • This attribute indicates that HWAddressSanitizer checks (dynamic address safety analysis based on tagged pointers) are enabled for this function.

    Declaration

    Swift

    case sanitizeHWAddress = "sanitize_hwaddress"
  • This function attribute indicates that the function does not have any effects besides calculating its result and does not have undefined behavior.

    Declaration

    Swift

    case speculatable
  • ssp

    This attribute indicates that the function should emit a stack smashing protector.

    Declaration

    Swift

    case ssp
  • This attribute indicates that the function should always emit a stack smashing protector

    Declaration

    Swift

    case sspreq
  • This attribute indicates that the function should emit a stack smashing protector.

    Declaration

    Swift

    case sspstrong
  • This attribute indicates that the function was called from a scope that requires strict floating point semantics.

    Declaration

    Swift

    case strictfp
  • This attribute indicates that the ABI being targeted requires that an unwind table entry be produced for this function even if we can show that no exceptions passes by it.

    Declaration

    Swift

    case uwtable
  • This indicates to the code generator that the parameter or return value should be zero-extended to the extent required by the target’s ABI by the caller (for a parameter) or the callee (for a return value).

    Declaration

    Swift

    case zeroext
  • This indicates to the code generator that the parameter or return value should be sign-extended to the extent required by the target’s ABI (which is usually 32-bits) by the caller (for a parameter) or the callee (for a return value).

    Declaration

    Swift

    case signext
  • This indicates that this parameter or return value should be treated in a special target-dependent fashion while emitting code for a function call or return.

    Declaration

    Swift

    case inreg
  • This indicates that the pointer parameter should really be passed by value to the function.

    Declaration

    Swift

    case byval
  • The inalloca argument attribute allows the caller to take the address of outgoing stack arguments

    Declaration

    Swift

    case inalloca
  • This indicates that the pointer parameter specifies the address of a structure that is the return value of the function in the source program.

    Declaration

    Swift

    case sret
  • This indicates that the pointer value may be assumed by the optimizer to have the specified alignment.

    Declaration

    Swift

    case align
  • This indicates that objects accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value.

    The noalias attribute may appear in one of two location: on arguments types or on return types. On argument types, noalias acts like the restrict keyword in C and C++ and implies that no other pointer value points to this object. On return types, noalias implies that the returned pointer is not aliased by any other pointer in the program.

    Practically, this allows LLVM to reorder accesses to this memory.

    Declaration

    Swift

    case noalias
  • This indicates that the callee does not make any copies of the pointer that outlive the callee itself.

    Declaration

    Swift

    case nocapture
  • This indicates that the pointer parameter can be excised using the trampoline intrinsics.

    Declaration

    Swift

    case nest
  • This indicates that the function always returns the argument as its return value.

    Declaration

    Swift

    case returned
  • This indicates that the parameter or return pointer is not null.

    Declaration

    Swift

    case nonnull
  • This indicates that the parameter or return pointer is dereferenceable.

    Declaration

    Swift

    case dereferenceable
  • This indicates that the parameter or return value isn’t both non-null and non-dereferenceable (up to n bytes) at the same time.

    Declaration

    Swift

    case dereferenceableOrNull = "dereferenceable_or_null"
  • This indicates that the parameter is the self/context parameter.

    Declaration

    Swift

    case swiftself
  • This attribute is motivated to model and optimize Swift error handling.

    Declaration

    Swift

    case swifterror