xref: /dflybsd-src/contrib/gcc-4.7/gcc/objc/objc-encoding.h (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* Routines dealing with ObjC encoding of types
2*e4b17023SJohn Marino    Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3*e4b17023SJohn Marino    2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
4*e4b17023SJohn Marino    Free Software Foundation, Inc.
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino This file is part of GCC.
7*e4b17023SJohn Marino 
8*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify
9*e4b17023SJohn Marino it under the terms of the GNU General Public License as published by
10*e4b17023SJohn Marino the Free Software Foundation; either version 3, or (at your option)
11*e4b17023SJohn Marino any later version.
12*e4b17023SJohn Marino 
13*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful,
14*e4b17023SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of
15*e4b17023SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*e4b17023SJohn Marino GNU General Public License for more details.
17*e4b17023SJohn Marino 
18*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
19*e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
20*e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
21*e4b17023SJohn Marino 
22*e4b17023SJohn Marino #ifndef GCC_OBJC_ENCODING_H
23*e4b17023SJohn Marino #define GCC_OBJC_ENCODING_H
24*e4b17023SJohn Marino 
25*e4b17023SJohn Marino /* This is used to initialize the obstacks used by encoding.  It
26*e4b17023SJohn Marino    should be called before any encoding function is used.  It is
27*e4b17023SJohn Marino    usually done in objc_init().  */
28*e4b17023SJohn Marino extern void objc_encoding_init (void);
29*e4b17023SJohn Marino 
30*e4b17023SJohn Marino /* Encode a method prototype.  The format is described in
31*e4b17023SJohn Marino    gcc/doc/objc.texi, section 'Method signatures'.  */
32*e4b17023SJohn Marino extern tree encode_method_prototype (tree method_decl);
33*e4b17023SJohn Marino 
34*e4b17023SJohn Marino /* This is used to implement @encode().  See gcc/doc/objc.texi,
35*e4b17023SJohn Marino    section '@encode'.  */
36*e4b17023SJohn Marino extern tree objc_build_encode_expr (tree type);
37*e4b17023SJohn Marino 
38*e4b17023SJohn Marino /* (Decide if these can ever be validly changed.)  */
39*e4b17023SJohn Marino #define OBJC_ENCODE_INLINE_DEFS		0
40*e4b17023SJohn Marino #define OBJC_ENCODE_DONT_INLINE_DEFS	1
41*e4b17023SJohn Marino 
42*e4b17023SJohn Marino /* Encode the attributes of a property.  */
43*e4b17023SJohn Marino extern tree objc_v2_encode_prop_attr (tree property);
44*e4b17023SJohn Marino 
45*e4b17023SJohn Marino /* Encode the type of a field.  Return an identifier with the type
46*e4b17023SJohn Marino    encoding for the field.  The type encoding is a null-terminated
47*e4b17023SJohn Marino    string.  */
48*e4b17023SJohn Marino extern tree encode_field_decl (tree field_decl);
49*e4b17023SJohn Marino 
50*e4b17023SJohn Marino /* Tells "encode_pointer/encode_aggregate" whether we are generating
51*e4b17023SJohn Marino    type descriptors for instance variables (as opposed to methods).
52*e4b17023SJohn Marino    Type descriptors for instance variables contain more information
53*e4b17023SJohn Marino    than methods (for static typing and embedded structures).
54*e4b17023SJohn Marino 
55*e4b17023SJohn Marino    TODO: Replace this global variable with an argument that is passed
56*e4b17023SJohn Marino    to the various encode() functions.
57*e4b17023SJohn Marino 
58*e4b17023SJohn Marino    TODO: Change it to a 'bool'.  */
59*e4b17023SJohn Marino extern int generating_instance_variables;
60*e4b17023SJohn Marino 
61*e4b17023SJohn Marino #endif /* GCC_OBJC_ENCODING_H */
62