]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: document more of the declaration context enumeration
authorCarl Shapiro <cshapiro@google.com>
Tue, 29 Jan 2013 00:57:36 +0000 (16:57 -0800)
committerCarl Shapiro <cshapiro@google.com>
Tue, 29 Jan 2013 00:57:36 +0000 (16:57 -0800)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7231051

src/cmd/gc/go.h

index 5e929d3c5bd5eb1581cddffb2d79a495e4b6f466..1afd1ca56e53fcf3f8c7dd02bdc34cda5b7f5e95 100644 (file)
@@ -645,20 +645,21 @@ enum
        Cboth = Crecv | Csend,
 };
 
+// declaration context
 enum
 {
        Pxxx,
 
-       PEXTERN,        // declaration context
-       PAUTO,
-       PPARAM,
-       PPARAMOUT,
-       PPARAMREF,      // param passed by reference
-       PFUNC,
+       PEXTERN,        // global variable
+       PAUTO,          // local variables
+       PPARAM,         // input arguments
+       PPARAMOUT,      // output results
+       PPARAMREF,      // closure variable reference
+       PFUNC,          // global function
 
        PDISCARD,       // discard during parse of duplicate import
 
-       PHEAP = 1<<7,
+       PHEAP = 1<<7,   // an extra bit to identify an escaped variable
 };
 
 enum