]> Cypherpunks repositories - gostls13.git/commitdiff
cgo: if value for constant did not parse, get it from DWARF info
authorIan Lance Taylor <iant@golang.org>
Mon, 9 Jan 2012 19:22:26 +0000 (11:22 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 9 Jan 2012 19:22:26 +0000 (11:22 -0800)
R=rsc, borman
CC=golang-dev
https://golang.org/cl/5525043

src/cmd/cgo/gcc.go

index 3c95d28be49d4a1351c9453558693bc4c7b03c1b..75ce1782a06d0976ef692c0a3189f2d6471b7fdd 100644 (file)
@@ -453,6 +453,11 @@ func (p *Package) guessKinds(f *File) []*Name {
        for i, b := range isConst {
                if b {
                        names[i].Kind = "const"
+                       if toSniff[i] != nil && names[i].Const == "" {
+                               j := len(needType)
+                               needType = needType[0 : j+1]
+                               needType[j] = names[i]
+                       }
                }
        }
        for _, n := range toSniff {