Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
39113df1
Commit
39113df1
authored
Feb 26, 2011
by
Nicola Pero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented encoding property types for new ObjC ABIs
From-SVN: r170516
parent
509d65dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
21 deletions
+58
-21
gcc/objc/ChangeLog
+6
-1
gcc/objc/objc-act.c
+52
-20
No files found.
gcc/objc/ChangeLog
View file @
39113df1
2011
-
02
-
26
Nicola
Pero
<
nicola
.
pero
@meta
-
innovation
.
com
>
*
objc
-
act
.
c
(
objc_v2_encode_prop_attr
)
:
Rewritten
.
2011
-
02
-
23
Nicola
Pero
<
nicola
.
pero
@meta
-
innovation
.
com
>
*
objc
-
act
.
c
(
build_private_template
)
:
Do
not
copy
the
...
...
@@ -16,7 +20,8 @@
2011
-
02
-
21
Mike
Stump
<
mikestump
@comcast
.
net
>
*
Make
-
lang
.
in
(
check_objc_parallelize
)
:
Refine
for
4
processor
machines
.
*
Make
-
lang
.
in
(
check_objc_parallelize
)
:
Refine
for
4
processor
machines
.
2011
-
02
-
20
Nicola
Pero
<
nicola
.
pero
@meta
-
innovation
.
com
>
...
...
gcc/objc/objc-act.c
View file @
39113df1
...
...
@@ -10495,47 +10495,79 @@ encode_field_decl (tree field_decl, int curtype, int format)
kPropertyGetter = 'G',
kPropertySetter = 'S',
kPropertyInstanceVariable = 'V',
kPropertyType = '
t
',
kPropertyType = '
T
',
kPropertyWeak = 'W',
kPropertyStrong = '
S
',
kPropertyStrong = '
P
',
kPropertyNonAtomic = 'N'
};
FIXME: Update the implementation to match. */
}; */
tree
objc_v2_encode_prop_attr
(
tree
property
)
{
const
char
*
string
;
tree
type
=
TREE_TYPE
(
property
);
obstack_1grow
(
&
util_obstack
,
't'
);
obstack_1grow
(
&
util_obstack
,
'T'
);
encode_type
(
type
,
obstack_object_size
(
&
util_obstack
),
OBJC_ENCODE_INLINE_DEFS
);
if
(
PROPERTY_READONLY
(
property
))
obstack_grow
(
&
util_obstack
,
",r"
,
2
);
obstack_grow
(
&
util_obstack
,
",R"
,
2
);
switch
(
PROPERTY_ASSIGN_SEMANTICS
(
property
))
{
case
OBJC_PROPERTY_COPY
:
obstack_grow
(
&
util_obstack
,
",C"
,
2
);
break
;
case
OBJC_PROPERTY_RETAIN
:
obstack_grow
(
&
util_obstack
,
",&"
,
2
);
break
;
case
OBJC_PROPERTY_ASSIGN
:
default
:
break
;
}
if
(
PROPERTY_
ASSIGN_SEMANTICS
(
property
)
==
OBJC_PROPERTY_COPY
)
obstack_grow
(
&
util_obstack
,
",
c"
,
2
);
if
(
PROPERTY_
DYNAMIC
(
property
)
)
obstack_grow
(
&
util_obstack
,
",
D"
,
2
);
if
(
PROPERTY_GETTER_NAME
(
property
))
if
(
PROPERTY_NONATOMIC
(
property
))
obstack_grow
(
&
util_obstack
,
",N"
,
2
);
/* Here we want to encode the getter name, but only if it's not the
standard one. */
if
(
PROPERTY_GETTER_NAME
(
property
)
!=
PROPERTY_NAME
(
property
))
{
obstack_grow
(
&
util_obstack
,
",
g
"
,
2
);
obstack_grow
(
&
util_obstack
,
",
G
"
,
2
);
string
=
IDENTIFIER_POINTER
(
PROPERTY_GETTER_NAME
(
property
));
obstack_grow
(
&
util_obstack
,
string
,
strlen
(
string
));
}
if
(
PROPERTY_SETTER_NAME
(
property
))
if
(
!
PROPERTY_READONLY
(
property
))
{
obstack_grow
(
&
util_obstack
,
",s"
,
2
);
string
=
IDENTIFIER_POINTER
(
PROPERTY_SETTER_NAME
(
property
));
obstack_grow
(
&
util_obstack
,
string
,
strlen
(
string
));
/* Here we want to encode the setter name, but only if it's not
the standard one. */
tree
standard_setter
=
get_identifier
(
objc_build_property_setter_name
(
PROPERTY_NAME
(
property
)));
if
(
PROPERTY_SETTER_NAME
(
property
)
!=
standard_setter
)
{
obstack_grow
(
&
util_obstack
,
",S"
,
2
);
string
=
IDENTIFIER_POINTER
(
PROPERTY_SETTER_NAME
(
property
));
obstack_grow
(
&
util_obstack
,
string
,
strlen
(
string
));
}
}
if
(
PROPERTY_IVAR_NAME
(
property
))
/* TODO: Encode strong ('P'), weak ('W') for garbage collection. */
if
(
!
PROPERTY_DYNAMIC
(
property
))
{
obstack_grow
(
&
util_obstack
,
",i"
,
2
);
string
=
IDENTIFIER_POINTER
(
PROPERTY_IVAR_NAME
(
property
));
obstack_grow
(
&
util_obstack
,
",V"
,
2
);
if
(
PROPERTY_IVAR_NAME
(
property
))
string
=
IDENTIFIER_POINTER
(
PROPERTY_IVAR_NAME
(
property
));
else
string
=
IDENTIFIER_POINTER
(
PROPERTY_NAME
(
property
));
obstack_grow
(
&
util_obstack
,
string
,
strlen
(
string
));
}
obstack_1grow
(
&
util_obstack
,
0
);
/* null terminate string */
/* NULL-terminate string. */
obstack_1grow
(
&
util_obstack
,
0
);
string
=
XOBFINISH
(
&
util_obstack
,
char
*
);
obstack_free
(
&
util_obstack
,
util_firstobj
);
return
get_identifier
(
string
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment