flag.BoolVar(&Ctxt.Flag_locationlists, "dwarflocationlists", true, "add location lists to DWARF in optimized mode")
flag.IntVar(&genDwarfInline, "gendwarfinl", 2, "generate DWARF inline info records")
objabi.Flagcount("e", "no limit on number of errors reported", &Debug['e'])
- objabi.Flagcount("f", "debug stack frames", &Debug['f'])
objabi.Flagcount("h", "halt on error", &Debug['h'])
objabi.Flagfn1("importmap", "add `definition` of the form source=actual to import map", addImportMap)
objabi.Flagfn1("importcfg", "read import configuration from `file`", readImportCfg)
finishUniverse()
typecheckok = true
- if Debug['f'] != 0 {
- frame(1)
- }
// Process top-level declarations in phases.
return binary.LittleEndian.Uint32(h[:4])
}
-func frame(context int) {
- if context != 0 {
- fmt.Printf("--- external frame ---\n")
- for _, n := range externdcl {
- printframenode(n)
- }
- return
- }
-
- if Curfn != nil {
- fmt.Printf("--- %v frame ---\n", Curfn.Func.Nname.Sym)
- for _, ln := range Curfn.Func.Dcl {
- printframenode(ln)
- }
- }
-}
-
-func printframenode(n *Node) {
- w := int64(-1)
- if n.Type != nil {
- w = n.Type.Width
- }
- switch n.Op {
- case ONAME:
- fmt.Printf("%v %v G%d %v width=%d\n", n.Op, n.Sym, n.Name.Vargen, n.Type, w)
- case OTYPE:
- fmt.Printf("%v %v width=%d\n", n.Op, n.Type, w)
- }
-}
-
// updateHasCall checks whether expression n contains any function
// calls and sets the n.HasCall flag if so.
func updateHasCall(n *Node) {