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
e30d4c82
Commit
e30d4c82
authored
Sep 06, 2002
by
Nicola Pero
Committed by
Nicola Pero
Sep 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs in the ObjC -gen-decls option
From-SVN: r56884
parent
fcd53748
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
11 deletions
+46
-11
gcc/ChangeLog
+10
-0
gcc/objc/objc-act.c
+36
-11
No files found.
gcc/ChangeLog
View file @
e30d4c82
Fri
Sep
6
16
:
17
:
33
2002
Nicola
Pero
<
n
.
pero
@mi
.
flashnet
.
it
>
*
objc
/
objc
-
act
.
c
(
dump_interface
)
:
Enlarged
the
char
*
buffer
to
10
k
.
Fixed
category
dumping
-
print
out
category
names
with
the
proper
syntax
.
Print
'
@end
\
n
'
and
not
'\
n
@end
'
at
the
end
of
the
interface
.
(
finish_objc
)
:
Fixed
the
-
gen
-
decls
option
.
It
was
printing
out
only
the
last
class
.
Dump
an
interface
declaration
of
all
classes
being
compiled
instead
.
2002
-
09
-
06
Jason
Thorpe
<
thorpej
@wasabisystems
.
com
>
*
config
/
arm
/
arm
-
protos
.
h
(
arm_gen_return_addr_mask
)
:
New
...
...
gcc/objc/objc-act.c
View file @
e30d4c82
...
...
@@ -7836,12 +7836,21 @@ gen_method_decl (method, buf)
/* Debug info. */
/* Dump an @interface declaration of the supplied class CHAIN to the
supplied file FP. Used to implement the -gen-decls option (which
prints out an @interface declaration of all classes compiled in
this run); potentially useful for debugging the compiler too. */
static
void
dump_interface
(
fp
,
chain
)
FILE
*
fp
;
tree
chain
;
{
char
*
buf
=
(
char
*
)
xmalloc
(
256
);
/* FIXME: A heap overflow here whenever a method (or ivar)
declaration is so long that it doesn't fit in the buffer. The
code and all the related functions should be rewritten to avoid
using fixed size buffers. */
char
*
buf
=
(
char
*
)
xmalloc
(
1024
*
10
);
const
char
*
my_name
=
IDENTIFIER_POINTER
(
CLASS_NAME
(
chain
));
tree
ivar_decls
=
CLASS_RAW_IVARS
(
chain
);
tree
nst_methods
=
CLASS_NST_METHODS
(
chain
);
...
...
@@ -7849,14 +7858,26 @@ dump_interface (fp, chain)
fprintf
(
fp
,
"
\n
@interface %s"
,
my_name
);
/* CLASS_SUPER_NAME is used to store the superclass name for
classes, and the category name for categories. */
if
(
CLASS_SUPER_NAME
(
chain
))
{
const
char
*
super_name
=
IDENTIFIER_POINTER
(
CLASS_SUPER_NAME
(
chain
));
fprintf
(
fp
,
" : %s
\n
"
,
super_name
);
const
char
*
name
=
IDENTIFIER_POINTER
(
CLASS_SUPER_NAME
(
chain
));
if
(
TREE_CODE
(
chain
)
==
CATEGORY_IMPLEMENTATION_TYPE
||
TREE_CODE
(
chain
)
==
CATEGORY_INTERFACE_TYPE
)
{
fprintf
(
fp
,
" (%s)
\n
"
,
name
);
}
else
{
fprintf
(
fp
,
" : %s
\n
"
,
name
);
}
}
else
fprintf
(
fp
,
"
\n
"
);
/* FIXME - the following doesn't seem to work at the moment. */
if
(
ivar_decls
)
{
fprintf
(
fp
,
"{
\n
"
);
...
...
@@ -7880,7 +7901,8 @@ dump_interface (fp, chain)
fprintf
(
fp
,
"+ %s;
\n
"
,
gen_method_decl
(
cls_methods
,
buf
));
cls_methods
=
TREE_CHAIN
(
cls_methods
);
}
fprintf
(
fp
,
"
\n
@end"
);
fprintf
(
fp
,
"@end
\n
"
);
}
/* Demangle function for Objective-C */
...
...
@@ -8000,7 +8022,16 @@ finish_objc ()
UOBJC_CLASS_decl
=
impent
->
class_decl
;
UOBJC_METACLASS_decl
=
impent
->
meta_decl
;
/* Dump the @interface of each class as we compile it, if the
-gen-decls option is in use. TODO: Dump the classes in the
order they were found, rather than in reverse order as we
are doing now. */
if
(
flag_gen_declaration
)
{
dump_interface
(
gen_declaration_file
,
objc_implementation_context
);
}
if
(
TREE_CODE
(
objc_implementation_context
)
==
CLASS_IMPLEMENTATION_TYPE
)
{
/* all of the following reference the string pool... */
...
...
@@ -8051,12 +8082,6 @@ finish_objc ()
generate_strings
();
if
(
flag_gen_declaration
)
{
add_class
(
objc_implementation_context
);
dump_interface
(
gen_declaration_file
,
objc_implementation_context
);
}
if
(
warn_selector
)
{
int
slot
;
...
...
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