Lines Matching defs:thunk

78 /* Return a this or result adjusting thunk to FUNCTION.  THIS_ADJUSTING
79 indicates whether it is a this or result adjusting thunk.
85 the returned thunk with finish_thunk. */
92 tree thunk;
109 /* See if we already have the thunk in question. For this_adjusting
112 for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk))
113 if (DECL_THIS_THUNK_P (thunk) == this_adjusting
114 && THUNK_FIXED_OFFSET (thunk) == d
115 && !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk)
118 ? tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk),
120 : THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset)))
121 return thunk;
132 thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function));
133 DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
134 cxx_dup_lang_specific_decl (thunk);
135 DECL_THUNKS (thunk) = NULL_TREE;
137 DECL_CONTEXT (thunk) = DECL_CONTEXT (function);
138 TREE_READONLY (thunk) = TREE_READONLY (function);
139 TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function);
140 TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
141 SET_DECL_THUNK_P (thunk, this_adjusting);
142 THUNK_TARGET (thunk) = function;
143 THUNK_FIXED_OFFSET (thunk) = d;
144 THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
145 THUNK_ALIAS (thunk) = NULL_TREE;
147 /* The thunk itself is not a constructor or destructor, even if
149 DECL_INTERFACE_KNOWN (thunk) = 1;
150 DECL_NOT_REALLY_EXTERN (thunk) = 1;
151 DECL_SAVED_FUNCTION_DATA (thunk) = NULL;
152 DECL_DESTRUCTOR_P (thunk) = 0;
153 DECL_CONSTRUCTOR_P (thunk) = 0;
154 DECL_EXTERNAL (thunk) = 1;
155 DECL_ARTIFICIAL (thunk) = 1;
156 /* Even if this thunk is a member of a local class, we don't
158 DECL_NO_STATIC_CHAIN (thunk) = 1;
160 DECL_PENDING_INLINE_P (thunk) = 0;
161 DECL_INLINE (thunk) = 0;
162 DECL_DECLARED_INLINE_P (thunk) = 0;
164 DECL_DEFERRED_FN (thunk) = 0;
166 DECL_USE_TEMPLATE (thunk) = 0;
167 DECL_TEMPLATE_INFO (thunk) = NULL;
170 TREE_CHAIN (thunk) = DECL_THUNKS (function);
171 DECL_THUNKS (function) = thunk;
173 return thunk;
176 /* Finish THUNK, a thunk decl. */
179 finish_thunk (tree thunk)
182 tree fixed_offset = ssize_int (THUNK_FIXED_OFFSET (thunk));
183 tree virtual_offset = THUNK_VIRTUAL_OFFSET (thunk);
185 gcc_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk));
186 if (virtual_offset && DECL_RESULT_THUNK_P (thunk))
188 function = THUNK_TARGET (thunk);
189 name = mangle_thunk (function, DECL_THIS_THUNK_P (thunk),
197 if (DECL_RESULT_THUNK_P (thunk))
205 gcc_assert (!DECL_THUNKS (thunk));
206 THUNK_ALIAS (thunk) = (THUNK_ALIAS (cov_probe)
212 DECL_NAME (thunk) = name;
213 SET_DECL_ASSEMBLER_NAME (thunk, name);
218 non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and
219 zero for a result adjusting thunk. */
317 return vtable thunk. If EMIT_P is nonzero, the thunk is emitted
332 aliased thunk. */
340 /* We already turned this thunk into an ordinary function.
341 There's no need to process this thunk again. */
345 /* The target is itself a thunk, process it now. */
376 /* And, if we need to emit the thunk, it's used. */
378 /* This thunk is actually defined. */
406 /* Output the thunk into the same section as function. */
411 /* Set up cloned argument trees for the thunk. */
456 /* If this is a covariant thunk, or we don't have the necessary
457 code for efficient thunks, generate a thunk function that
462 error ("generic thunk code fails for method %q#D which uses %<...%>",
470 /* There's no need to check accessibility inside the thunk body. */
499 thunk. */
515 /* Since we want to emit the thunk, we explicitly mark its name as