ir,build: pragma support (#97)

Adds support for arbitrary compiler directives.

Fixes #15
This commit is contained in:
Michael McLoughlin
2019-09-16 11:01:48 -07:00
committed by GitHub
parent 0bcbe82731
commit c8004ba627
14 changed files with 161 additions and 1 deletions

View File

@@ -92,6 +92,11 @@ func (c *Context) Doc(lines ...string) {
c.activefunc().Doc = lines
}
// Pragma adds a compiler directive to the currently active function.
func (c *Context) Pragma(directive string, args ...string) {
c.activefunc().AddPragma(directive, args...)
}
// Attributes sets function attributes for the currently active function.
func (c *Context) Attributes(a attr.Attribute) {
c.activefunc().Attributes = a