Descriptionexp/ssa: various features to facilitate source analysis tools.
NewBuilder now accepts a new extensible Client struct
specifying Builder options. (Naming suggestions?)
Client embeds a types.Context, permitting Builder clients to
control type-checking options such as word width.
Builder.{idents,constants.types} fields extracted into (new
type) TypeInfo. TypeInfo is embedded by Package. The smaller
per-package maps can be retained/discarded with finer
granularity (see below).
The builder options now include RetainAST, a predicate for
whether to retain or discard the type-checked ASTs
(Package.Files, now exposed) and type info (Package.TypeInfo)
for each package after it is built.
The results of type checking are now available to tools atop
exp/ssa via these exposed functions:
Builder.isType -> TypeInfo.IsType(Expr)
Builder.obj -> TypeInfo.ObjectOf(Ident)
Builder.exprType -> TypeInfo.TypeOf(Expr)
Builder.constants[x] -> TypeInfo.ValueOf(Expr)
Builder.isPackageRef -> TypeInfo.isPackageRef(Expr)
(Those methods never really belonged happily on Builder.)
ssa.CallCommon:
- Added StaticCallee method
- Added Description method
- Embedding in Call/Go/Defer is no longer anonymous, to avoid
promotion of inappropriate methods such as Description.
- Added explicit Operands methods to Call/Go/Defer.
ssa.Member now has a Posn() method. We use (new type)
Constant, not Literal, for package-level constants with a name
and position.
Added source position info to Make{Slice,Map,Chan}, Alloc, Global.
Add missing noparens() when handling calls to built-ins.
Refactor to avoid "// Subtle" code in compLit(Struct).
Added CreatePackageFromArgs utility to handle command-line
processing for ssadump and forthcoming tools.
Patch Set 1 #Patch Set 2 : diff -r 607e36ea774b https://code.google.com/p/go.exp #Patch Set 3 : diff -r 607e36ea774b https://code.google.com/p/go.exp #Patch Set 4 : diff -r 607e36ea774b https://code.google.com/p/go.exp #Patch Set 5 : diff -r 607e36ea774b https://code.google.com/p/go.exp #Patch Set 6 : code review 8734045: exp/ssa: various features to facilitate source analysis... #Patch Set 7 : diff -r 607e36ea774b https://code.google.com/p/go.exp #Patch Set 8 : diff -r 607e36ea774b https://code.google.com/p/go.exp #
Total comments: 10
Patch Set 9 : diff -r 450091856c40 https://code.google.com/p/go.exp #
MessagesTotal messages: 4
|