Skip to content

Ambiguity in placement of metadata.code function annotations #251

@tlively

Description

@tlively

CodeMetadata.md currently says that @metadata.code.XXX annotations must be within function definitions and gives an example:

(func (@metadata.code.hotness "\01") $test (type 0) ...)

But this could lead to ambiguity for annotations that could apply to either functions or instructions:

(func (@metadata.code.func_or_inst? "unknown") nop)

This potential ambiguity could be avoided (and the text format could be made nicer IMO) if the function annotations were placed before function definitions instead:

(@metadata.code.definitely_a_func "yep")
(func nop)

There are no formally specified function annotations, so this text format is only specified here in the tool-conventions repo. If we get stakeholders to agree, we should be able to change this.

cc @yuri91 as well as @fitzgen to route to appropriate wasm-tools folks, @sbc100 for WABT, and @kripken for binaryen. WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions