FAQ
Reviewers: gri,

Message:
Hello gri@golang.org (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go.tools


Description:
go.tools/ssa: doc tweaks + a sanity check.

Please review this at https://codereview.appspot.com/14454053/

Affected files (+13, -5 lines):
    M ssa/doc.go
    M ssa/func.go
    M ssa/sanity.go
    M ssa/ssa.go


Index: ssa/doc.go
===================================================================
--- a/ssa/doc.go
+++ b/ssa/doc.go
@@ -16,7 +16,7 @@
   //
   // The level of abstraction of the SSA form is intentionally close to
   // the source language to facilitate construction of source analysis
-// tools. It is not primarily intended for machine code generation.
+// tools. It is not intended for machine code generation.
   //
   // All looping, branching and switching constructs are replaced with
   // unstructured control flow. We may add higher-level control flow
Index: ssa/func.go
===================================================================
--- a/ssa/func.go
+++ b/ssa/func.go
@@ -368,8 +368,9 @@
   }

   // SetDebugMode sets the debug mode for package pkg. If true, all its
-// functions will include full debug info. This greatly increases
-// the size of the instruction stream.
+// functions will include full debug info. This greatly increases the
+// size of the instruction stream, and causes Functions to depend upon
+// the ASTs, potentially keeping them live in memory for longer.
   //
   func (pkg *Package) SetDebugMode(debug bool) {
    // TODO(adonovan): do we want ast.File granularity?
Index: ssa/sanity.go
===================================================================
--- a/ssa/sanity.go
+++ b/ssa/sanity.go
@@ -368,6 +368,11 @@
     s.checkBlock(b, i)
    }
    s.block = nil
+ for i, anon := range fn.AnonFuncs {
+ if anon.Enclosing != fn {
+ s.errorf("AnonFuncs[%d]=%s but %s.Enclosing=%s", i, anon, anon,
anon.Enclosing)
+ }
+ }
    s.fn = nil
    return !s.insane
   }
Index: ssa/ssa.go
===================================================================
--- a/ssa/ssa.go
+++ b/ssa/ssa.go
@@ -1147,8 +1147,10 @@
   //
   // DebugRef is a pseudo-instruction: it has no dynamic effect.
   //
-// Pos() returns Expr.Pos(), the position of the source-level
-// expression.
+// Pos() returns Expr.Pos(), the start position of the source-level
+// expression. This is not the same as the "designated" token as
+// documented at Value.Pos(). e.g. CallExpr.Pos() does not return the
+// position of the ("designated") LParen token.
   //
   // Object() returns the source-level (var/const/func) object denoted
   // by Expr if it is an *ast.Ident; otherwise it is nil.


--

---
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

  • Gri at Oct 9, 2013 at 4:45 pm
    LGTM

    https://codereview.appspot.com/14454053/

    --

    ---
    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 Oct 9, 2013 at 4:47 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=415c26b62c8c&repo=tools ***

    go.tools/ssa: doc tweaks + a sanity check.

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


    https://codereview.appspot.com/14454053/

    --

    ---
    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
postedOct 9, '13 at 4:44p
activeOct 9, '13 at 4:47p
posts3
users2
websitegolang.org

2 users in discussion

Adonovan: 2 posts Gri: 1 post

People

Translate

site design / logo © 2021 Grokbase