Skip to content

ast,build: only include textflag.h if required #12

@mmcloughlin

Description

@mmcloughlin

We currently always include textflag.h

avo/printer/goasm.go

Lines 39 to 43 in e364d63

func (p *goasm) header() {
p.Comment(p.cfg.GeneratedWarning())
p.NL()
p.include("textflag.h")
}

We should be able to write a simple pass which uses ContainsTextFlags() to determine if a given file needs the include or not.

avo/attr.go

Lines 62 to 63 in e364d63

// ContainsTextFlags() returns whether the Asm() representation requires macros in "textflags.h".
func (a Attribute) ContainsTextFlags() bool {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions