]> gcc.gnu.org Git - gcc.git/blame - gcc/objcp/objcp-decl.h
Update copyright years in gcc/
[gcc.git] / gcc / objcp / objcp-decl.h
CommitLineData
b2e61dde
MS
1/* Process the ObjC-specific declarations and variables for
2 the Objective-C++ compiler.
23a5b65a 3 Copyright (C) 2005-2014 Free Software Foundation, Inc.
b2e61dde
MS
4 Contributed by Ziemowit Laski <zlaski@apple.com>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
af84f9c5 10Software Foundation; either version 3, or (at your option) any later
b2e61dde
MS
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
af84f9c5
NC
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
b2e61dde
MS
22
23#ifndef GCC_OBJCP_DECL_H
24#define GCC_OBJCP_DECL_H
25
c2255bc4
AH
26extern tree objcp_start_struct (location_t, enum tree_code, tree);
27extern tree objcp_finish_struct (location_t, tree, tree, tree);
b2e61dde 28extern void objcp_finish_function (void);
b2e61dde
MS
29extern tree objcp_build_function_call (tree, tree);
30extern tree objcp_xref_tag (enum tree_code, tree);
b2e61dde 31extern int objcp_comptypes (tree, tree);
b2e61dde
MS
32extern tree objcp_begin_compound_stmt (int);
33extern tree objcp_end_compound_stmt (tree, int);
34
35/* Now "cover up" the corresponding C++ functions if required (NB: the
36 OBJCP_ORIGINAL_FUNCTION macro, shown below, can still be used to
37 invoke the original C++ functions if needed). */
38#ifdef OBJCP_REMAP_FUNCTIONS
39
dc491a25 40#define start_struct(loc, code, name, struct_info) \
4b29c5e5 41 objcp_start_struct (loc, code, name)
dc491a25 42#define finish_struct(loc, t, fieldlist, attributes, struct_info) \
4b29c5e5 43 objcp_finish_struct (loc, t, fieldlist, attributes)
b2e61dde
MS
44#define finish_function() \
45 objcp_finish_function ()
4b29c5e5
AH
46#define finish_decl(decl, loc, init, origtype, asmspec) \
47 cp_finish_decl (decl, init, false, asmspec, 0)
b2e61dde
MS
48#define xref_tag(code, name) \
49 objcp_xref_tag (code, name)
b2e61dde
MS
50#define comptypes(type1, type2) \
51 objcp_comptypes (type1, type2)
52#define c_begin_compound_stmt(flags) \
53 objcp_begin_compound_stmt (flags)
c2255bc4 54#define c_end_compound_stmt(loc, stmt, flags) \
b2e61dde
MS
55 objcp_end_compound_stmt (stmt, flags)
56
57#undef OBJC_TYPE_NAME
58#define OBJC_TYPE_NAME(type) \
59 (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL \
60 ? DECL_NAME (TYPE_NAME (type)) \
61 : TYPE_NAME (type))
62#undef OBJC_SET_TYPE_NAME
63#define OBJC_SET_TYPE_NAME(type, name) \
64 if(TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) \
65 DECL_NAME (TYPE_NAME (type)) = name; \
66 else \
67 TYPE_NAME (type) = name;
68
69#undef TYPE_OBJC_INFO
70#define TYPE_OBJC_INFO(TYPE) LANG_TYPE_CLASS_CHECK (TYPE)->objc_info
71#undef SIZEOF_OBJC_TYPE_LANG_SPECIFIC
72#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type_class)
73#undef ALLOC_OBJC_TYPE_LANG_SPECIFIC
74#define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE) \
75 do { \
a9429e29
LB
76 TYPE_LANG_SPECIFIC (NODE) = ggc_alloc_cleared_lang_type \
77 (sizeof (struct lang_type_class)); \
b2e61dde
MS
78 TYPE_LANG_SPECIFIC (NODE)->u.c.h.is_lang_type_class = 1; \
79 } while (0)
80
81#define OBJCP_ORIGINAL_FUNCTION(name, args) (name)args
82
83/* C++ marks ellipsis-free function parameters differently from C. */
84#undef OBJC_VOID_AT_END
85#define OBJC_VOID_AT_END void_list_node
86
87#endif /* OBJCP_REMAP_FUNCTIONS */
88
89#endif /* ! GCC_OBJCP_DECL_H */
This page took 3.156592 seconds and 5 git commands to generate.