summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-target.def
blob: 40287b63a9d1669b8ce1ee1893212db98d42bd34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/* Target hook definitions for C-family front ends.
   Copyright (C) 2001-2015 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3, or (at your option) any
   later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.  */

/* See target-hooks-macros.h for details of macros that should be
   provided by the including file, and how to use them here.  */
#include "target-hooks-macros.h"

#undef HOOK_TYPE
#define HOOK_TYPE "C Target Hook"

HOOK_VECTOR (TARGETCM_INITIALIZER, gcc_targetcm)

#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_"

/* Handle target switch CODE (an OPT_* value).  ARG is the argument
   passed to the switch; it is NULL if no argument was.  VALUE is the
   value of ARG if CODE specifies a UInteger option, otherwise it is
   1 if the positive form of the switch was used and 0 if the negative
   form was.  Return true if the switch was valid.  */
DEFHOOK
(handle_c_option,
 "",
 bool, (size_t code, const char *arg, int value),
 default_handle_c_option)

/* Targets may provide a string object type that can be used within
   and between C, C++, and Objective-C dialects.  */

DEFHOOK
(objc_construct_string_object,
 "Targets may provide a string object type that can be used within\
 and between C, C++ and their respective Objective-C dialects.\
 A string object might, for example, embed encoding and length information.\
 These objects are considered opaque to the compiler and handled as references.\
 An ideal implementation makes the composition of the string object\
 match that of the Objective-C @code{NSString} (@code{NXString} for GNUStep),\
 allowing efficient interworking between C-only and Objective-C code.\
 If a target implements string objects then this hook should return a\
 reference to such an object constructed from the normal `C' string\
 representation provided in @var{string}.\
 At present, the hook is used by Objective-C only, to obtain a\
 common-format string object when the target provides one.",
 tree, (tree string),
 NULL)

DEFHOOK
(objc_declare_unresolved_class_reference,
 "Declare that Objective C class @var{classname} is referenced\
  by the current TU.",
 void, (const char *classname),
 NULL)

DEFHOOK
(objc_declare_class_definition,
 "Declare that Objective C class @var{classname} is defined\
  by the current TU.",
 void, (const char *classname),
 NULL)

DEFHOOK
(string_object_ref_type_p,
 "If a target implements string objects then this hook should return\
 @code{true} if @var{stringref} is a valid reference to such an object.",
 bool, (const_tree stringref),
 hook_bool_const_tree_false)

DEFHOOK
(check_string_object_format_arg,
 "If a target implements string objects then this hook should should\
  provide a facility to check the function arguments in @var{args_list}\
  against the format specifiers in @var{format_arg} where the type of\
  @var{format_arg} is one recognized as a valid string reference type.",
 void, (tree format_arg, tree args_list),
 NULL)

DEFHOOK
(c_preinclude,
 "Define this hook to return the name of a header file to be included at\
 the start of all compilations, as if it had been included with\
 @code{#include <@var{file}>}.  If this hook returns @code{NULL}, or is\
 not defined, or the header is not found, or if the user specifies\
 @option{-ffreestanding} or @option{-nostdinc}, no header is included.\n\
\n\
 This hook can be used together with a header provided by the system C\
 library to implement ISO C requirements for certain macros to be\
 predefined that describe properties of the whole implementation rather\
 than just the compiler.",
 const char *, (void),
 hook_constcharptr_void_null)

DEFHOOK
(cxx_implicit_extern_c,
 "Define this hook to add target-specific C++ implicit extern C functions.\
 If this function returns true for the name of a file-scope function, that\
 function implicitly gets extern \"C\" linkage rather than whatever language\
 linkage the declaration would normally have.  An example of such function\
 is WinMain on Win32 targets.",
 bool, (const char*),
 NULL)
 
HOOK_VECTOR_END (C90_EMPTY_HACK)