attribute (attribute --)

Inputs

Outputs

attribute consumes one known Text and stores it as the pending attribute specifier of the current scope. The specifier is attached to the LLVM constant of the next known Text object created in that scope, typically the next Text literal, and is then cleared. The specifier text is emitted verbatim after the constant definition, so it must be valid LLVM global-variable attribute syntax.

The builtin changes only generated code. The affected Text object stays an ordinary known Text at compile time, and no local, field, or pending declaration modifier is created by the builtin itself.

Behavior

Example

{} 0 {} [
  "section \".names\"" attribute
  first: "alpha";
  second: "beta";

  "-- both locals are ordinary known Text values --" printCompilerMessage
  first printStack _:;
  second printStack _:;

  0
] "main" exportFunction

Expected Output During Compilation

-- both locals are ordinary known Text values --
"alpha"
"beta"

In the generated LLVM IR only the first literal carries the specifier:

@2 = private constant [5 x i8] c"alpha", section ".names"
@3 = private constant [4 x i8] c"beta"

See also