examples: adapt to new const types

This commit is contained in:
Michael McLoughlin
2018-12-26 17:08:58 -08:00
parent abd300c0e9
commit 662ae52758
8 changed files with 1274 additions and 1272 deletions

View File

@@ -23,6 +23,7 @@ func (c *ctors) Generate(is []inst.Instruction) ([]byte, error) {
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
c.Printf("package x86\n\n")
c.Printf("import (\n")
c.Printf("\t\"errors\"\n")
c.Printf("\t\"%s\"\n", pkg)
c.Printf("\t\"%s/reg\"\n", pkg)
c.Printf("\t\"%s/operand\"\n", pkg)
@@ -76,7 +77,7 @@ func (c *ctors) forms(i inst.Instruction, s signature) {
}
c.Printf("}\n")
c.Printf("return nil, ErrBadOperandTypes\n")
c.Printf("return nil, errors.New(\"%s: bad operands\")\n", i.Opcode)
}
func construct(i inst.Instruction, f inst.Form, s signature) string {