diff options
| author | Andrew Wilkins <axwalk@gmail.com> | 2016-03-15 05:36:43 +0000 |
|---|---|---|
| committer | Andrew Wilkins <axwalk@gmail.com> | 2016-03-15 05:36:43 +0000 |
| commit | 6436a4abd7a2f3a60b230453295dba199d8a59c3 (patch) | |
| tree | 125aef80fc2cf46c5d1758a8ece1fde14e7b13fd /llgo/third_party/gofrontend/libgo/go/path/filepath/path.go | |
| parent | 36761bf92427846ce40fdd849615732c852e44dd (diff) | |
| download | bcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.tar.gz bcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.zip | |
[llgo] Roll gofrontend forward
Switch gofrontend to using go.googlesource.com, and
update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be.
There are various changes required to update to the
go 1.5 runtime:
typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type.
CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found.
various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly".
minor cleanups in ssa.go while investigating issues with unwinding/panic handling.
Differential Revisision: http://reviews.llvm.org/D15188
llvm-svn: 263536
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/path/filepath/path.go')
| -rw-r--r-- | llgo/third_party/gofrontend/libgo/go/path/filepath/path.go | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/path/filepath/path.go b/llgo/third_party/gofrontend/libgo/go/path/filepath/path.go index d37fc9dfc89..5dc5cfd49e7 100644 --- a/llgo/third_party/gofrontend/libgo/go/path/filepath/path.go +++ b/llgo/third_party/gofrontend/libgo/go/path/filepath/path.go @@ -4,6 +4,9 @@ // Package filepath implements utility routines for manipulating filename paths // in a way compatible with the target operating system-defined file paths. +// +// Functions in this package replace any occurrences of the slash ('/') character +// with os.PathSeparator when returning paths unless otherwise specified. package filepath import ( @@ -174,7 +177,8 @@ func FromSlash(path string) string { // SplitList splits a list of paths joined by the OS-specific ListSeparator, // usually found in PATH or GOPATH environment variables. -// Unlike strings.Split, SplitList returns an empty slice when passed an empty string. +// Unlike strings.Split, SplitList returns an empty slice when passed an empty +// string. SplitList does not replace slash characters in the returned paths. func SplitList(path string) []string { return splitList(path) } @@ -196,13 +200,10 @@ func Split(path string) (dir, file string) { // Join joins any number of path elements into a single path, adding // a Separator if necessary. The result is Cleaned, in particular // all empty strings are ignored. +// On Windows, the result is a UNC path if and only if the first path +// element is a UNC path. func Join(elem ...string) string { - for i, e := range elem { - if e != "" { - return Clean(strings.Join(elem[i:], string(Separator))) - } - } - return "" + return join(elem) } // Ext returns the file name extension used by path. @@ -334,10 +335,11 @@ var SkipDir = errors.New("skip this directory") // If there was a problem walking to the file or directory named by path, the // incoming error will describe the problem and the function can decide how // to handle that error (and Walk will not descend into that directory). If -// an error is returned, processing stops. The sole exception is that if path -// is a directory and the function returns the special value SkipDir, the -// contents of the directory are skipped and processing continues as usual on -// the next file. +// an error is returned, processing stops. The sole exception is when the function +// returns the special value SkipDir. If the function returns SkipDir when invoked +// on a directory, Walk skips the directory's contents entirely. +// If the function returns SkipDir when invoked on a non-directory file, +// Walk skips the remaining files in the containing directory. type WalkFunc func(path string, info os.FileInfo, err error) error var lstat = os.Lstat // for testing @@ -456,9 +458,9 @@ func Dir(path string) string { } // VolumeName returns leading volume name. -// Given "C:\foo\bar" it returns "C:" under windows. +// Given "C:\foo\bar" it returns "C:" on Windows. // Given "\\host\share\foo" it returns "\\host\share". // On other platforms it returns "". -func VolumeName(path string) (v string) { +func VolumeName(path string) string { return path[:volumeNameLen(path)] } |

