appllvm

package
v0.8.0-test2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdNative = &cli.Command{
	Hidden: true,
	Name:   "native",
	Usage:  "compile Wa source code to native executable",
	Flags: []cli.Flag{
		appbase.MakeFlag_output(),
		appbase.MakeFlag_target(),
		appbase.MakeFlag_tags(),

		&cli.BoolFlag{
			Name:  "debug",
			Usage: "dump orginal intermediate representation",
		},
		&cli.StringFlag{
			Name:  "clang",
			Usage: "set llvm/clang path",
		},
		&cli.StringFlag{
			Name:  "llc",
			Usage: "set llvm/llc path",
		},
	},
	Action: func(c *cli.Context) error {
		outfile := c.String("output")
		target := c.String("target")
		debug := c.Bool("debug")
		infile := ""

		if c.NArg() == 0 {
			fmt.Fprintf(os.Stderr, "no input file")
			os.Exit(1)
		}
		infile = c.Args().First()

		opt := appbase.BuildOptions(c, config.WaBackend_llvm)
		if err := LLVMRun(opt, infile, outfile, target, debug); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		return nil
	},
}

Functions

func LLVMRun

func LLVMRun(opt *appbase.Option, infile string, outfile string, target string, debug bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL