github.com/tardisgo/tardisgo@v0.0.0-20161119180838-e0dd9a7e46b5/pogo/compilation.go (about)

     1  package pogo
     2  
     3  import (
     4  	"golang.org/x/tools/go/ssa"
     5  	"golang.org/x/tools/go/types/typeutil"
     6  )
     7  
     8  // Compilation contains global variables for an individual pogo run
     9  type Compilation struct {
    10  	rootProgram *ssa.Program // pointer to the root datastructure
    11  	mainPackage *ssa.Package // pointer to the "main" package
    12  	TargetLang  int          // TargetLang holds the language currently being targeted, offset into LanguageList.
    13  
    14  	hxPkgName, headerText string
    15  	LibListNoDCE          []string
    16  
    17  	warnings           []string            // Warnings are collected up and added to the end of the output code.
    18  	messagesGiven      map[string]bool     // This map de-dups error messages
    19  	PosHashFileList    []PosHashFileStruct // PosHashFileList holds the list of input go files with their posHash information
    20  	LatestValidPosHash PosHash             // LatestValidPosHash holds the latest valid PosHash value seen, for use when an invalid one requires a "near" reference.
    21  
    22  	fnMap, grMap map[*ssa.Function]bool // which functions are used and if the functions use goroutines/channels
    23  
    24  	inlineMap map[string]string
    25  	keysSeen  map[string]int
    26  
    27  	previousErrorInfo string // used to give some indication of the error's location, even if it is not given
    28  
    29  	TypesEncountered         typeutil.Map // TypesEncountered keeps track of the types we encounter using the excellent go.tools/go/types/typesmap package.
    30  	NextTypeID               int          // NextTypeID is used to give each type we come across its own ID - entry zero is invalid
    31  	catchReferencedTypesSeen map[string]bool
    32  
    33  	// flags
    34  	DebugFlag              bool // DebugFlag is used to signal if we are emitting debug information
    35  	TraceFlag              bool // TraceFlag is used to signal if we are emitting trace information (big)
    36  	hadErrors, stopOnError bool // TODO make stopOnError soft and default true
    37  }