1/* Definitions of Objective-C front-end entry points used for C and C++.
2 Copyright (C) 1987-2017 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_C_COMMON_OBJC_H
21#define GCC_C_COMMON_OBJC_H
22
23/* ObjC ivar visibility types. */
24enum GTY(()) objc_ivar_visibility_kind {
25 OBJC_IVAR_VIS_PROTECTED = 0,
26 OBJC_IVAR_VIS_PUBLIC = 1,
27 OBJC_IVAR_VIS_PRIVATE = 2,
28 OBJC_IVAR_VIS_PACKAGE = 3
29};
30
31/* Objective-C / Objective-C++ entry points. */
32
33/* The following ObjC/ObjC++ functions are called by the C and/or C++
34 front-ends; they all must have corresponding stubs in stub-objc.c. */
35extern void objc_write_global_declarations (void);
36extern tree objc_is_class_name (tree);
37extern tree objc_is_object_ptr (tree);
38extern void objc_check_decl (tree);
39extern void objc_check_global_decl (tree);
40extern tree objc_common_type (tree, tree);
41extern bool objc_compare_types (tree, tree, int, tree);
42extern bool objc_have_common_type (tree, tree, int, tree);
43extern bool objc_diagnose_private_ivar (tree);
44extern void objc_volatilize_decl (tree);
45extern tree objc_rewrite_function_call (tree, tree);
46extern tree objc_message_selector (void);
47extern tree objc_lookup_ivar (tree, tree);
48extern void objc_clear_super_receiver (void);
49extern int objc_is_public (tree, tree);
50extern tree objc_is_id (tree);
51extern void objc_declare_alias (tree, tree);
52extern void objc_declare_class (tree);
53extern void objc_declare_protocol (tree, tree);
54extern tree objc_build_message_expr (tree, tree);
55extern tree objc_finish_message_expr (tree, tree, tree, tree*);
56extern tree objc_build_selector_expr (location_t, tree);
57extern tree objc_build_protocol_expr (tree);
58extern tree objc_build_encode_expr (tree);
59extern tree objc_build_string_object (tree);
60extern tree objc_get_protocol_qualified_type (tree, tree);
61extern tree objc_get_class_reference (tree);
62extern tree objc_get_class_ivars (tree);
63extern bool objc_detect_field_duplicates (bool);
64extern void objc_start_class_interface (tree, tree, tree, tree);
65extern void objc_start_category_interface (tree, tree, tree, tree);
66extern void objc_start_protocol (tree, tree, tree);
67extern void objc_continue_interface (void);
68extern void objc_finish_interface (void);
69extern void objc_start_class_implementation (tree, tree);
70extern void objc_start_category_implementation (tree, tree);
71extern void objc_continue_implementation (void);
72extern void objc_finish_implementation (void);
73extern void objc_set_visibility (objc_ivar_visibility_kind);
74extern tree objc_build_method_signature (bool, tree, tree, tree, bool);
75extern void objc_add_method_declaration (bool, tree, tree);
76extern bool objc_start_method_definition (bool, tree, tree, tree);
77extern void objc_finish_method_definition (tree);
78extern void objc_add_instance_variable (tree);
79extern tree objc_build_keyword_decl (tree, tree, tree, tree);
80extern tree objc_build_throw_stmt (location_t, tree);
81extern void objc_begin_try_stmt (location_t, tree);
82extern tree objc_finish_try_stmt (void);
83extern void objc_begin_catch_clause (tree);
84extern void objc_finish_catch_clause (void);
85extern void objc_build_finally_clause (location_t, tree);
86extern tree objc_build_synchronized (location_t, tree, tree);
87extern int objc_static_init_needed_p (void);
88extern tree objc_generate_static_init_call (tree);
89extern tree objc_generate_write_barrier (tree, enum tree_code, tree);
90extern void objc_set_method_opt (bool);
91extern void objc_finish_foreach_loop (location_t, tree, tree, tree, tree, tree);
92extern bool objc_method_decl (enum tree_code);
93extern void objc_add_property_declaration (location_t, tree, bool, bool, bool,
94 bool, bool, bool, tree, tree);
95extern tree objc_maybe_build_component_ref (tree, tree);
96extern tree objc_build_class_component_ref (tree, tree);
97extern tree objc_maybe_build_modify_expr (tree, tree);
98extern tree objc_build_incr_expr_for_property_ref (location_t, enum tree_code,
99 tree, tree);
100extern void objc_add_synthesize_declaration (location_t, tree);
101extern void objc_add_dynamic_declaration (location_t, tree);
102extern const char * objc_maybe_printable_name (tree, int);
103extern bool objc_is_property_ref (tree);
104extern bool objc_string_ref_type_p (tree);
105extern void objc_check_format_arg (tree, tree);
106extern void objc_finish_function (void);
107extern void objc_maybe_warn_exceptions (location_t);
108
109/* The following are provided by the C and C++ front-ends, and called by
110 ObjC/ObjC++. */
111extern void *objc_get_current_scope (void);
112extern void objc_mark_locals_volatile (void *);
113
114#endif /* ! GCC_C_COMMON_OBJC_H */
115