#include "objcp-decl.h"
#endif /* OBJCPLUS */
-#include "obstack.h"
-
-/* These are only used for encoding ivars. */
-extern struct obstack util_obstack;
-extern char *util_firstobj;
-
/* Hooks for string decls etc. */
#include "objc-runtime-hooks.h"
#include "objc-runtime-shared-support.h"
+#include "objc-encoding.h"
/* rt_trees identifiers - shared between NeXT implementations. These allow
the FE to tag meta-data in a manner that survives LTO and can be used when
/* struct _objc_super {
struct _objc_object *self;
- struct _objc_class *super_class;
- [or Class cls; for the abi v2]
+ struct _objc_class *super_class;
+ [or Class cls; for the abi v2]
}; */
void
{
tree *chain, decl, type;
char buf[BUFSIZE];
-
+
switch (section)
{
case class_names:
}
type = build_sized_array_type (char_type_node, IDENTIFIER_LENGTH (ident) + 1);
- /* Get a runtime-specific string decl which will be finish_var()'ed in
+ /* Get a runtime-specific string decl which will be finish_var()'ed in
generate_strings (). */
decl = (*runtime.string_decl) (type, buf, section);
TREE_CONSTANT (decl) = 1;
*chain = tree_cons (decl, ident, NULL_TREE);
- return convert (string_type_node,
+ return convert (string_type_node,
build_unary_op (input_location, ADDR_EXPR, decl, 1));
}
/* No really useful place to point to. */
loc = UNKNOWN_LOCATION;
-
+
/* version = { 1, ... } */
expr = build_int_cst (long_integer_type_node, vers);
/* symtab = { ..., _OBJC_SYMBOLS, ... } */
ltyp = build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_SYMTAB)));
+ get_identifier (UTAG_SYMTAB)));
if (UOBJC_SYMBOLS_decl)
expr = convert (ltyp, build_unary_op (loc,
ADDR_EXPR, UOBJC_SYMBOLS_decl, 0));
/* Allow the runtime to mark meta-data such that it can be assigned to target
specific sections by the back-end. */
if (attr)
- DECL_ATTRIBUTES (UOBJC_MODULES_decl) = attr;
+ DECL_ATTRIBUTES (UOBJC_MODULES_decl) = attr;
finish_var_decl (UOBJC_MODULES_decl,
init_module_descriptor (TREE_TYPE (UOBJC_MODULES_decl),
CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, build_int_cst (NULL_TREE, 0));
/* Set type. */
- encode_field_decl (field_decl,
- obstack_object_size (&util_obstack),
- OBJC_ENCODE_DONT_INLINE_DEFS);
-
- /* Null terminate string. */
- obstack_1grow (&util_obstack, 0);
- id = add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
+ id = add_objc_string (encode_field_decl (field_decl),
meth_var_types);
CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, id);
- obstack_free (&util_obstack, util_firstobj);
/* Set offset. */
CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, byte_position (field_decl));
if (warn_selector)
{
location_t loc;
- if (decl)
+ if (decl)
loc = DECL_SOURCE_LOCATION (decl);
else
loc = UNKNOWN_LOCATION;
if (decl)
{
/* Entries of this form are used for references to methods.
- The runtime re-writes these on start-up, but the compiler can't see
+ The runtime re-writes these on start-up, but the compiler can't see
that and optimizes it away unless we force it. */
DECL_PRESERVE_P (decl) = 1;
finish_var_decl (decl, expr);