Commit Graph

645 Commits

Author SHA1 Message Date
Alan Donovan cadb821a95 cmd/guru: don't panic on *ast.Bad{Decl,Stmt,Expr}
These nodes are common in incomplete programs.

Change-Id: Iff9750050c78762f0cb8bebc7739584c197d661e
Reviewed-on: https://go-review.googlesource.com/19509
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-15 21:39:56 +00:00
Robert Griesemer 7ed774bdc0 go/gcimporter15: interpret relative srcDir relative to cwd
This is a backport of the respective changes in golang.org/cl/19393.

For golang/go#14215.

Change-Id: I8d60dd6daa827a60597f3af925e6732914537319
Reviewed-on: https://go-review.googlesource.com/19394
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-10 17:55:37 +00:00
Alan Donovan 02f1928320 go/loader: ignore (*build.Package).Goroot flag when handling "unsafe"
For the default build.Context, the Package.Goroot flag indicates when a
package was loaded from the standard library.  Until now, the loader
used it to enable the typechecker's intrinsics for the "unsafe" package.
This seemed like a good check, but it is troublesome for clients that
use a nonstandard build.Context.  For example, if a client defines
nonstandard Context hooks that load all packages, whether standard or
user-defined, from a flat sstable, there is no way for those hooks to
indicate which packages should have this flag set and which not.  As a
result the contents of the "unsafe" package directory are treated as Go
source code when they are merely documentation.

Change-Id: Iea0a7cc9877507d73606391293971a28279c4e4b
Reviewed-on: https://go-review.googlesource.com/19188
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-02-05 00:45:20 +00:00
Brad Fitzpatrick b47dfd93e5 all: fix plan9 failures
Updates golang/go#11811

Change-Id: I6ed252eb3272354fce8084ec99f4777e41c3daa3
Reviewed-on: https://go-review.googlesource.com/18993
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-01-28 00:31:03 +00:00
Brad Fitzpatrick 2fd075ed02 all: skip slow tests in short mode
Updates golang/go#14113
Updates golang/go#11811

Change-Id: I61851de12ff474d3b738fc88f402742677973cae
Reviewed-on: https://go-review.googlesource.com/18992
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-28 00:14:01 +00:00
Mikio Hara 09dc3ef4c7 go/gcimporter15: fix build
This change prevents test code to slip into package gcimporter15 and
fixes a weird situation that the test passes but the package doesn't
exist.

For example, we can see the situation with Go 1.6 like the follwoing:

go build
./gcimporter_test16.go:20: undefined: MustHaveGoBuild
./gcimporter_test16.go:45: undefined: testPath

go test
PASS
ok  	golang.org/x/tools/go/gcimporter15	0.896s

Change-Id: I95550574ccd1b2273072c700c28a82c791c16c63
Reviewed-on: https://go-review.googlesource.com/18950
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-27 07:08:15 +00:00
Mikio Hara 7421583666 go/vcs: drop support for Google Code Project Hosting
The hosting service was shut down on January 25, 2016 and a few tests
started to fail like the following:

=== RUN   TestRepoRootForImportPath
--- FAIL: TestRepoRootForImportPath (2.47s)
	vcs_test.go:129: RepoRootForImport("code.google.com/p/go"):
unable to detect version control system for code.google.com/ path
FAIL

This change drops support for code.google.com and fixes test. See
http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
for further information.

Fixes golang/go#14105

Change-Id: I87cb9a3d666c2a1af0f8bf39a66ba0f669c99fd5
Reviewed-on: https://go-review.googlesource.com/18951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-27 00:23:28 +00:00
Alan Donovan f3a63969dd go/gcimporter15: fix build for go1.4
Change-Id: I0b2650bbb2bf35d7895e1a808cfb45f7f0194ea9
Reviewed-on: https://go-review.googlesource.com/18822
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-21 22:50:50 +00:00
Robert Griesemer d2e00652ba x/tools: fix build
Change-Id: I02b42abcc29ee04c8f54dc8ba2c6079b3e6c4153
Reviewed-on: https://go-review.googlesource.com/18816
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-21 22:29:25 +00:00
Robert Griesemer 7912bef4df go/gcimporter15: only test binary export when running against Go 1.6
Also: rename setname15.go to setname.go for consistency

Change-Id: I3f7e37ef4ade716ce64674edb4d53a543a1150c5
Reviewed-on: https://go-review.googlesource.com/18772
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-20 21:48:19 +00:00
Robert Griesemer e6d5370703 go/gcimporter15: implement types.Package.SetName for Go 1.5
This makes gcimporter15 build against Go 1.5.

Change-Id: I14e7ff80b28d99f996abc19a0a74b08e5e1bbd75
Reviewed-on: https://go-review.googlesource.com/18771
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-20 21:18:18 +00:00
Robert Griesemer 2fb4b8bc95 go/gcimporter15: use latest std/lib gcimporter code
Change-Id: Ia497e56084cf262510461b7e94296570ca8e2049
Reviewed-on: https://go-review.googlesource.com/18770
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-20 20:18:03 +00:00
Dmitri Shuralyov 5804fef4c0 x/tools/go/vcs: fix FromDir returning bad root on Windows
Import path is a '/'-separated path. FromDir documentation says
on return, root is the import path corresponding to the root of
the repository. On Windows and other OSes where os.PathSeparator
is not '/', that wasn't true since root would contain characters
other than '/', and therefore it wasn't a valid import path
corresponding to the root of the repository. Fix that by using
filepath.ToSlash.

Add test coverage for root value returned from FromDir, it was
previously not tested.

Additionally, remove a dubious statement from the documentation
"(thus root is a prefix of importPath)". There is no variable
importPath that is being referred to. It's also redundant and
confusing. Without it, the description of root value matches
the documentation of RepoRoot.Root struct field:

	// Root is the import path corresponding to the root of the
	// repository.
	Root string

Fixes golang/go#7723.

Change-Id: If9f5f55b5751e01a7f88b79d9b039402af3e9312
Reviewed-on: https://go-review.googlesource.com/18461
Reviewed-by: Chris Manghane <cmang@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-19 15:45:24 +00:00
Kenji Kaneda 3c782264fb go/types: fix a comment of Named.Obj
// TypeName returns ...
-> // Obj returns ...

Change-Id: I2ac6133a703ec2c4b2045d4bdf9acc70049f0e1e
Reviewed-on: https://go-review.googlesource.com/18704
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-16 17:31:34 +00:00
Alan Donovan 5a2875abe7 go/loader: reduce contention for findPackage mutex
...by making the cache non-blocking and duplicate-suppressing.

(The bottleneck was introduced while adding vendoring support.)
This reduces the 95th percentile map shard time for type-checking 120K
packages to 8min from 20min.

Also: move the I/O-limiting counting semaphore and the NoGoError check
from FindPackage to findPackage so that all implementations benefit.

Change-Id: I43527122262cf80475dd3212d78c340e1c71e36c
Reviewed-on: https://go-review.googlesource.com/18580
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-13 18:09:25 +00:00
Alan Donovan ae186f56a2 go/loader: don't treat unsafe specially wrt vendoring
The loader treats GOROOT's "unsafe" package specially,
with no source files and a Package of types.Unsafe.

Tested on Go 1.4.1, 1.5, and ~1.6 (tip).

Fixes issue #13882

Change-Id: I86c4e394665d86a50ec3852d6d702f0e9c5d2276
Reviewed-on: https://go-review.googlesource.com/18457
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-08 20:29:04 +00:00
Alan Donovan 1fb1f857ac go/loader: use Skipf in test
(late response to comment in review of CL 18452)

Change-Id: I1fa80fd1c7fd22cec752c839d20a483e0732337c
Reviewed-on: https://go-review.googlesource.com/18454
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-08 19:32:38 +00:00
Alan Donovan 10712091e1 tools: fallout from flipped sense of build.IgnoreVendor flag
(See https://go-review.googlesource.com/#/c/18450)

Details:
- delete buildutil.AllowVendor flag.
  Instead use unexported 'go16' var in each package that needs it.
- delete buildutil.StripVendor; was never needed.
- remove inapplicable vendoring comments from loader14.go
- importgraph: go1.5: don't bother checking for 1.6 before calling
  absolutize (minor simplifiication and deoptimization).

Tested on 1.4.1, 1.5, and ~1.6 (tip).

Change-Id: If692b0df2eb6c120a9c09d7b1ed99f1b4c6b0826
Reviewed-on: https://go-review.googlesource.com/18452
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-08 18:54:48 +00:00
Alan Donovan 4747062949 go/gcimporter15: a copy of go/gcimporter using go1.5 std go/types
Because the std go/importer's Lookup functionality is incomplete,
clients have no way to create a Go 1.5 types.Package from an io.Reader
reading from gc export data.  This package provides a stopgap until
the standard library is complete.

The go/gcimporter package remains unchanged, and uses only the
golang.org/x/tools/go/types package.

Change-Id: I47a817f4b6a52ddab26c6b01de6e28099301faf5
Reviewed-on: https://go-review.googlesource.com/18382
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-07 18:06:54 +00:00
Alan Donovan 542ffc7e75 tools: switch to standard go/types at tip
A few files have been forked and tagged "go1.5,!go1.6" to work around
minor API changes between the two types packages:
- constant.Value.String() in oracle/describe.go and its tests;
- constant.ToInt must now be called before constant.Int64Val.
- types.Config{Importer: importer.Default()} in a number of places
- go/types/typeutil/import_test.go uses lowercase names to avoid 'import "C"'.

Files in go/types/typesutil, missing from my previous CL, have been
tagged !go1.5; these files will be deleted in February.

All affected packages were tested using 1.4.1, 1.5, and ~1.6 (tip).

Change-Id: Iec7fd370e1434508149b378438fb37f65b8d2ba8
Reviewed-on: https://go-review.googlesource.com/18207
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 22:15:26 +00:00
Alan Donovan 2477c0d578 x/tools/...: fork and tag !1.5 all files that use go/types et al
This change will ensure that the tree continues to work with go1.4.1.

All files continue to depend on golang.org/x/tools/go/types, but in a
follow-up change, I will switch the primary files to depend on the
standard go/types package.  Another (smaller) set of files will be
forked and tagged, this time !1.6, due to API differences between the
two packages.

All tests pass using 1.4.1, 1.5, and ~1.6 (tip).

Change-Id: Ifd75a6330e120957d646be91693daaba1ce0e8c9
Reviewed-on: https://go-review.googlesource.com/18333
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 20:40:09 +00:00
Alan Donovan 8f90b5e560 go/ssa/interp: remove stale TODO
Followup to TBR'd change https://go-review.googlesource.com/#/c/18191/.

Change-Id: I7d6957a46aea00cfe0b734576b5392d578ee06d9
Reviewed-on: https://go-review.googlesource.com/18326
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-01-06 19:24:01 +00:00
Alan Donovan c49318f04a go/ssa/interp: make os.Pipe intrinsic POSIX-portable; disable on Windows
Change-Id: I6c2f495c7c75f86590a0d79f86423ca67d695347
Reviewed-on: https://go-review.googlesource.com/18325
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 19:21:02 +00:00
Alan Donovan 0f870d4d86 go/loader: fix interaction of cwd and vendor
Packages specified on the command line should be interpreted relative to
cwd iff they are local (e.g. ./http within $GOROOT/src/net), otherwise a
request for, say, "golang.org/x/net/http2/hpack" might return the vendored
package depending on the working directory.

The FindPackage hook function now takes a build.ImportMode parameter, so
it matches the signature of (*build.Context).Import.  The AllowVendor
flag is enabled only for imports within source files, but not for the
initial packages.

+ test.

Change-Id: I756dc46b70928d2fd9f824e6670092d8169e0d64
Reviewed-on: https://go-review.googlesource.com/18318
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-01-06 18:28:16 +00:00
Alan Donovan 3a85b8da38 refactor/importgraph: reduce I/O concurrency to avoid EMFILE
Use an concurrency-limiting semaphore to reduce I/O parallelism in Import.

Also, start the producer in a new goroutine so that it runs in parallel
with the consumer.  Paradoxically, this reduces the peak number of
goroutines.

Also, in buildutil.ForEachPackage, make the concurrency limiting
semaphore global, since I/O parallelism is a process-wide resource.

Change-Id: I282b717c50603361826e5675077c9f464c874132
Reviewed-on: https://go-review.googlesource.com/18215
Reviewed-by: Michael Matloob <matloob@golang.org>
2015-12-30 22:01:03 +00:00
Alan Donovan b2a7698651 go/loader: in stdlib_test, remove workaround for lack of vendoring
Change-Id: I058081ef596e8b5231321ef05d5256ec44cc58c6
Reviewed-on: https://go-review.googlesource.com/18214
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-30 16:37:28 +00:00
Alan Donovan a09dffbb6c go/vcs: workaround EOF bug in token-based XML decoder
...using same logic as in $GOROOT/go/src/cmd/go/discovery.go

See issue #13757

Change-Id: I2ace0abed0743f4a8675fa8780e190d640b57e6c
Reviewed-on: https://go-review.googlesource.com/18196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-29 20:27:04 +00:00
Dmitri Shuralyov 157f8abbbd go/vcs: accept domain.root in RepoRootForImportDynamic
This is the same change as in https://golang.org/cl/12193.

Fixes golang/go#13506.

Related to golang/go#9357.

Change-Id: I9c7d956008641b1907e14bcb08198235f5f9552f
Reviewed-on: https://go-review.googlesource.com/18152
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-29 15:00:21 +00:00
Alan Donovan 2b78567943 go/loader: fix tests to work at go1.5 and tip
Change-Id: Icc80f112a7ec4b64519220c57b6ccb2612166656
Reviewed-on: https://go-review.googlesource.com/18197
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 22:42:32 +00:00
Alan Donovan b14dd1a5b7 go/importer: in TestImportStdLib, skip 2 packages that use vendoring
(See issue #13756)

Change-Id: Icda14c34f3460e941ae092f147432c795465a077
Reviewed-on: https://go-review.googlesource.com/18195
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 21:28:10 +00:00
Alan Donovan 9b7a39c6be go/loader: fix brittle example test
We need a better approach for tests such as these.

Change-Id: I6fb608acc096088fe377f6f2c40ff6124cf3d09c
Reviewed-on: https://go-review.googlesource.com/18194
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 21:24:47 +00:00
Alan Donovan 8463610142 go/ssa/interp: enable support for Example tests
1. Added intrinsic for os.Pipe to avoid use of "unsafe".  This makes
   Example tests work in the interpreter, fixing the broken "unicode"
   package (which recently sprouted some Examples) and allowing us to
   enable tests for:

      encoding/csv
      flag
      path
      text/scanner
      unicode/utf8

   The implementation of os.Pipe may require tweaking for non-Linux platforms.

2. Added intrinsic for strings.Index to avoid assembly dependency.

3. Added dumb intrinsic for testing۰runExample to work around a bug in
   go/ssa/testmain.go that requires an invasive fix
   (Until then, the output of Example functions will not be checked.)

Change-Id: I6374c9c47aa802275b7cdc98525e057f5db0615a
Reviewed-on: https://go-review.googlesource.com/18191
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 21:19:28 +00:00
Alan Donovan e3e5aae018 go/types: in TestStdlib, skip 2 packages that use vendoring
(gcimporter does not support vendoring---see issue #13756)

Change-Id: Ief4101e4f33007d497ed1519845febfcffdded38
Reviewed-on: https://go-review.googlesource.com/18193
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-28 21:04:49 +00:00
Alan Donovan f75338cbc6 go/types: skip two failing $GOROOT/test/fixedbugs tests
Change-Id: I7dfb95f34ae23c0b7905714b32068dc336a05656
Reviewed-on: https://go-review.googlesource.com/18192
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-28 19:40:50 +00:00
Alan Donovan d6e83e534d go/loader: changes for vendor support
Prior to this change, the loader made the simplifying assumption
that an import path is equal to a package path, that is, a
subdirectory of src/.  (This assumption was already false because
relative imports "../foo" are possible, though discouraged.)
Now, an import "foo" may denote "a/vendor/foo" or "b/vendor/foo"
depending on whether it appears beneath a/ or b/.  Thus import
paths and package paths are no longer the same, and the directory
containing an import declaration is a necessary input to the
import resolution function.

This change makes the loader hygienic w.r.t. the directory of
each import declaration, and cleans up the terminology.
The only API change is to the FindPackage hook, which most
clients never use.

Details:
- Add a 'fromDir string' parameter to the FindPackage hook function.
- Add a dir field to each PackageInfo.
- doImport (called by go/types) now consists of two steps:
  use FindPackage(dir, importPath) to locate the package,
  then consult the import map using the canonical package path.
  Only the first step can fail.
- Memoize FindPackage.
- Simplify importInfo now that it no longer has to deal with errors.
  Replace a condition variable with a channel.
- Use a separate type to report importErrors.
- Rename loadAll to importAll
- Delete the importMode constant.
- Test.

Change-Id: I3defab51bfa12b48b1511a2172fb48dc8e9150e6
Reviewed-on: https://go-review.googlesource.com/18053
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-12-22 18:31:24 +00:00
Alan Donovan 27534aa951 go/buildutil: changes for vendor support
Add AllowVendor constant for convenience across x/tools.
 (Will delete go/loader's importMode later)
Add StripVendor utility function + test.

Change-Id: I885076cb4ea67588996d85b749b85f49cd619f0d
Reviewed-on: https://go-review.googlesource.com/18049
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-12-18 20:00:43 +00:00
Alan Donovan 42bc1282f3 go/loader: update example_test for Go1.6
Change-Id: Ib3bf913e3c8f3cf06ba855f8dda855453e0a1aa2
Reviewed-on: https://go-review.googlesource.com/18048
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-18 18:15:14 +00:00
Russ Cox 34ae141ecc go/loader: use build.AllowVendor during Import on Go 1.6 and later
Makes programs like ssadump work on packages using vendored code,
for example net/http.

For golang/go#12278.
Depends on CL 17726 in main repository.

Change-Id: Ibabf564e397044a0f449087124dd96161081baaf
Reviewed-on: https://go-review.googlesource.com/17727
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-12-17 20:34:07 +00:00
Brad Fitzpatrick 1cdaff4a02 go/types: fix build
Fixes golang/go#13603

Change-Id: Ie35094e9fd9976317340fae19425bffa307d7c8a
Reviewed-on: https://go-review.googlesource.com/17753
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-14 01:42:23 +00:00
David Symonds e842f6af3a go/types: Remove ancient Go 1.1 compatibility indirections.
Change-Id: Ie16cc01ea2bd4806eaa7bd77cfbd2fa90f11ea36
Reviewed-on: https://go-review.googlesource.com/17792
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-14 00:47:24 +00:00
Alex Brainman fff8fd7b19 go/buildutil: ignore path letters case in ContainingPackage on windows
Fixes golang/go#13368

Change-Id: I4cee2078bc64b6f175f206daa9609246cc1b1f85
Reviewed-on: https://go-review.googlesource.com/17211
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-11-25 03:21:30 +00:00
Alan Donovan 977844c7af go/ssa: fix crash when building map[*struct{}]bool{{}: true}
Since Go 1.5, if a key expression in a map literal is itself a composite
literal, the type may be omitted.  An & operation may be implied,
but was not generated, resulting in a type mismatch crash.

Added regression test.
Also, added missing intrinsic math.hasSSE4 to interpreter.

Fixes issue 13341

Change-Id: I6a5e560460cdcac295a500a3fc3738cbe8aa5853
Reviewed-on: https://go-review.googlesource.com/17123
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-11-23 19:08:17 +00:00
Dmitri Shuralyov 747ae2594e go/buildutil: Fix example code for TagsFlag.
The example incorrectly used buildutil.TagsDoc identifier which does not
exist. It should be buildutil.TagsFlagDoc instead.

The issue was introduced in https://golang.org/cl/9172 when this code was
first written.

Also use more idiomatic style for Go comments, '//' followed by a space,
then tab (instead of skipping the space). Although both render correctly
in godoc, this form is more correct and consistent.

Change-Id: I3b3c9767fe313106a8ff81e7887f3241c5806b59
Reviewed-on: https://go-review.googlesource.com/16743
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-11-09 14:36:24 +00:00
Alan Donovan 0f9d71c428 go/pointer: fix bug in constraint generation of "for _, v := range map"
+ regression test

Change-Id: I9ec28f222e14af0cb737494e3c48e5423cdcf236
Reviewed-on: https://go-review.googlesource.com/16294
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-10-26 16:28:05 +00:00
Daniel Morsing b6b32a4fbf go/ssa: emit DebugRefs for x, y = z() assignments
This would cause oracle callee lookup failures when the RHS is an
invoke-style call.

Fixes golang/go#12999

Change-Id: Ifd561c4e7bf26f57ace5f62afac746b926c70993
Reviewed-on: https://go-review.googlesource.com/16210
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-10-23 10:25:05 +00:00
Brad Fitzpatrick 4caddfa68c go/vcs: fix doc typos
Change-Id: Ife1f9534d08d3bd9beeb4e6e798733d71e6f72b5
Reviewed-on: https://go-review.googlesource.com/15750
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-10-10 23:46:02 +00:00
Alan Donovan 9d2ff756b7 go/loader: document cgo limitation
Change-Id: I8ce744d204fe2850d322b3095d04e8a399984983
Reviewed-on: https://go-review.googlesource.com/15391
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-10-05 16:43:58 +00:00
Alan Donovan 8049553ca8 go/ssa: use sync.Once instead of sync.atomic
This adds a missing memory barrier at the end of Package.Build.

Change-Id: Ife35d5ad5a48ba121f35656fef682863d4f2aef6
Reviewed-on: https://go-review.googlesource.com/14761
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-09-18 15:11:51 +00:00
Alan Donovan afcda55b39 go/ssa: rename some API features (incompatible change)
Rename the following exported names:
	(*Program).BuildAll → Build
	(*Program).Method   → MethodValue
	Package.Object      → Pkg
Also:
	(*Function).pkgobj  → pkg

Change-Id: Iff7e6c240ebe6786ba759278ac0daa3d66698013
Reviewed-on: https://go-review.googlesource.com/14134
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-08-31 22:20:12 +00:00
Alan Donovan b9f1f6a3c1 go/loader: in stdlib_test, skip packages that depend on vendoring
until vendoring support is added (soon).

Change-Id: I954514b5c6b82622c0c831a289ccdcc16dbd37f8
Reviewed-on: https://go-review.googlesource.com/14130
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-08-31 20:55:27 +00:00