FAQ
LGTM



https://codereview.appspot.com/8734045/diff/12003/ssa/builder.go
File ssa/builder.go (right):

https://codereview.appspot.com/8734045/diff/12003/ssa/builder.go#newcode76
ssa/builder.go:76: type Client struct {
Context would be the name if you want to follow precedent (set by
go/build).

https://codereview.appspot.com/8734045/diff/12003/ssa/ssa.go
File ssa/ssa.go (right):

https://codereview.appspot.com/8734045/diff/12003/ssa/ssa.go#newcode986
ssa/ssa.go:986: // CallCommon is a contained by Go, Defer and Call to
hold the
a "contained" ?

https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go
File ssa/typeinfo.go (right):

https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode12
ssa/typeinfo.go:12: // TypeInfo containsinformation provided by the
typechecker about the
contains information

https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode32
ssa/typeinfo.go:32: // TODO(gri): Is this a typechecker bug? If so,
eliminate
probably - the typechecker should do a better job in these cases

https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode50
ssa/typeinfo.go:50: func (info *TypeInfo) ObjectOf(id *ast.Ident)
types.Object {
also accept selector expressions?

https://codereview.appspot.com/8734045/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Adonovan at Apr 24, 2013 at 2:06 pm
    Thanks!


    https://codereview.appspot.com/8734045/diff/12003/ssa/builder.go
    File ssa/builder.go (right):

    https://codereview.appspot.com/8734045/diff/12003/ssa/builder.go#newcode76
    ssa/builder.go:76: type Client struct {
    On 2013/04/23 23:35:15, gri wrote:
    Context would be the name if you want to follow precedent (set by
    go/build).

    Ok, done, in the interests of consistency (though I never really liked
    the name "Context").

    https://codereview.appspot.com/8734045/diff/12003/ssa/ssa.go
    File ssa/ssa.go (right):

    https://codereview.appspot.com/8734045/diff/12003/ssa/ssa.go#newcode986
    ssa/ssa.go:986: // CallCommon is a contained by Go, Defer and Call to
    hold the
    On 2013/04/23 23:35:15, gri wrote:
    a "contained" ?
    Done.

    https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go
    File ssa/typeinfo.go (right):

    https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode12
    ssa/typeinfo.go:12: // TypeInfo containsinformation provided by the
    typechecker about the
    On 2013/04/23 23:35:15, gri wrote:
    contains information
    Done.

    https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode32
    ssa/typeinfo.go:32: // TODO(gri): Is this a typechecker bug? If so,
    eliminate
    On 2013/04/23 23:35:15, gri wrote:
    probably - the typechecker should do a better job in these cases
    This isn't new, the code just moved from builder.go. IIRC this bug is
    already on your TODO list.

    https://codereview.appspot.com/8734045/diff/12003/ssa/typeinfo.go#newcode50
    ssa/typeinfo.go:50: func (info *TypeInfo) ObjectOf(id *ast.Ident)
    types.Object {
    On 2013/04/23 23:35:15, gri wrote:
    also accept selector expressions?
    It wouldn't actually simplify any other code in this package, and
    clients can build that abstraction atop this for the meantime. We can
    always generalize it later.

    https://codereview.appspot.com/8734045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adonovan at Apr 24, 2013 at 2:17 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=4059e8ecc5e2&repo=exp ***

    exp/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.

    R=gri
    CC=golang-dev
    https://codereview.appspot.com/8734045


    https://codereview.appspot.com/8734045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedApr 23, '13 at 11:35p
activeApr 24, '13 at 2:17p
posts3
users2
websitegolang.org

2 users in discussion

Adonovan: 2 posts Gri: 1 post

People

Translate

site design / logo © 2021 Grokbase