Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gcc/jit/jit-playback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ playback::context::
new_compound_type (location *loc,
const char *name,
bool is_struct, /* else is union */
bool is_packed)
bool is_packed,
bool is_tree_addressable)
{
gcc_assert (name);

Expand All @@ -466,7 +467,7 @@ new_compound_type (location *loc,

if (is_packed)
TYPE_PACKED (t) = 1;

if (is_tree_addressable) TREE_ADDRESSABLE(t) = 1;
if (loc)
set_tree_location (t, loc);

Expand Down
3 changes: 2 additions & 1 deletion gcc/jit/jit-playback.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class context : public log_user
new_compound_type (location *loc,
const char *name,
bool is_struct, /* else is union */
bool is_packed);
bool is_packed,
bool is_tree_addressable);

type *
new_function_type (type *return_type,
Expand Down
12 changes: 9 additions & 3 deletions gcc/jit/jit-recording.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,11 @@ recording::type::set_packed ()
{
m_packed = true;
}

void
recording::type::set_tree_addressable ()
{
m_tree_addressable = true;
}
/* Given a type, get a vector version of the type.

Implements the post-error-checking part of
Expand Down Expand Up @@ -3901,7 +3905,8 @@ recording::struct_::replay_into (replayer *r)
r->new_compound_type (playback_location (r, get_loc ()),
get_name ()->c_str (),
true, /* is_struct */
m_packed));
m_packed,
m_tree_addressable));
}

const char *
Expand Down Expand Up @@ -3956,7 +3961,8 @@ recording::union_::replay_into (replayer *r)
r->new_compound_type (playback_location (r, get_loc ()),
get_name ()->c_str (),
false, /* is_struct */
m_packed));
m_packed,
m_tree_addressable));
}

/* Implementation of recording::memento::make_debug_string for
Expand Down
5 changes: 3 additions & 2 deletions gcc/jit/jit-recording.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ class type : public memento
type *get_vector (size_t num_units);

void set_packed ();

void set_tree_addressable();
/* Get the type obtained when dereferencing this type.

This will return NULL if it's not valid to dereference this type.
Expand Down Expand Up @@ -687,12 +687,13 @@ class type : public memento
type (context *ctxt)
: memento (ctxt),
m_packed (false),
m_tree_addressable (false),
m_pointer_to_this_type (NULL)
{}

public:
bool m_packed;

bool m_tree_addressable;
private:
type *m_pointer_to_this_type;
};
Expand Down
7 changes: 6 additions & 1 deletion gcc/jit/libgccjit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4430,7 +4430,12 @@ gcc_jit_type_set_packed (gcc_jit_type *type)

type->set_packed ();
}

void
gcc_jit_type_set_tree_addressable(gcc_jit_type *type)
{
RETURN_IF_FAIL (type, NULL, NULL, "NULL type");
type->set_tree_addressable();
}
/* Public entrypoint. See description in libgccjit.h.

After error-checking, the real work is done by the
Expand Down
5 changes: 4 additions & 1 deletion gcc/jit/libgccjit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,10 @@ gcc_jit_target_info_supports_target_dependent_type(gcc_jit_target_info *info, en
/* Given type "T", get type "T __attribute__ ((packed))". */
extern void
gcc_jit_type_set_packed (gcc_jit_type *type);

/* Sets TREE_ADDRESSABLE on a given type, forcing it to be
passed indirectly and not in registers*/
extern void
gcc_jit_type_set_tree_addressable(gcc_jit_type *type);
extern void
gcc_jit_field_set_location (gcc_jit_field *field,
gcc_jit_location *loc);
Expand Down
4 changes: 4 additions & 0 deletions gcc/jit/libgccjit.map
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,7 @@ LIBGCCJIT_ABI_42 {
global:
gcc_jit_lvalue_add_attribute;
} LIBGCCJIT_ABI_41;
LIBGCCJIT_ABI_43{
global:
gcc_jit_type_set_tree_addressable;
} LIBGCCJIT_ABI_42;