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
97d17ac2
Commit
97d17ac2
authored
Jan 27, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(declare_function_name): If char_array_type_node isn't large enough
for the name, make a larger type. From-SVN: r3368
parent
e15762df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
gcc/c-common.c
+24
-9
No files found.
gcc/c-common.c
View file @
97d17ac2
...
@@ -29,8 +29,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -29,8 +29,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
void
void
declare_function_name
()
declare_function_name
()
{
{
tree
decl
,
init
;
tree
decl
,
type
,
init
;
char
*
name
,
*
printable_name
;
char
*
name
,
*
printable_name
;
int
len
;
if
(
current_function_decl
==
NULL
)
if
(
current_function_decl
==
NULL
)
{
{
...
@@ -50,29 +51,43 @@ declare_function_name ()
...
@@ -50,29 +51,43 @@ declare_function_name ()
printable_name
=
(
*
decl_printable_name
)
(
current_function_decl
,
&
kind
);
printable_name
=
(
*
decl_printable_name
)
(
current_function_decl
,
&
kind
);
}
}
/* If the default size of char arrays isn't big enough for the name,
make a bigger one. */
len
=
strlen
(
name
)
+
1
;
type
=
char_array_type_node
;
if
(
TREE_INT_CST_LOW
(
TYPE_MAX_VALUE
(
TREE_TYPE
(
char_array_type_node
)))
<
len
)
type
=
build_array_type
(
char_type_node
,
build_index_type
(
build_int_2
(
len
,
0
)));
push_obstacks_nochange
();
push_obstacks_nochange
();
decl
=
build_decl
(
VAR_DECL
,
get_identifier
(
"__FUNCTION__"
),
decl
=
build_decl
(
VAR_DECL
,
get_identifier
(
"__FUNCTION__"
),
type
);
char_array_type_node
);
TREE_STATIC
(
decl
)
=
1
;
TREE_STATIC
(
decl
)
=
1
;
TREE_READONLY
(
decl
)
=
1
;
TREE_READONLY
(
decl
)
=
1
;
DECL_SOURCE_LINE
(
decl
)
=
0
;
DECL_SOURCE_LINE
(
decl
)
=
0
;
DECL_IN_SYSTEM_HEADER
(
decl
)
=
1
;
DECL_IN_SYSTEM_HEADER
(
decl
)
=
1
;
DECL_IGNORED_P
(
decl
)
=
1
;
DECL_IGNORED_P
(
decl
)
=
1
;
init
=
build_string
(
strlen
(
name
)
+
1
,
name
);
init
=
build_string
(
len
,
name
);
TREE_TYPE
(
init
)
=
char_array_type_nod
e
;
TREE_TYPE
(
init
)
=
typ
e
;
DECL_INITIAL
(
decl
)
=
init
;
DECL_INITIAL
(
decl
)
=
init
;
finish_decl
(
pushdecl
(
decl
),
init
,
NULL_TREE
);
finish_decl
(
pushdecl
(
decl
),
init
,
NULL_TREE
);
len
=
strlen
(
printable_name
)
+
1
;
type
=
char_array_type_node
;
if
(
TREE_INT_CST_LOW
(
TYPE_MAX_VALUE
(
TREE_TYPE
(
char_array_type_node
)))
<
len
)
type
=
build_array_type
(
char_type_node
,
build_index_type
(
build_int_2
(
len
,
0
)));
push_obstacks_nochange
();
push_obstacks_nochange
();
decl
=
build_decl
(
VAR_DECL
,
get_identifier
(
"__PRETTY_FUNCTION__"
),
decl
=
build_decl
(
VAR_DECL
,
get_identifier
(
"__PRETTY_FUNCTION__"
),
type
);
char_array_type_node
);
TREE_STATIC
(
decl
)
=
1
;
TREE_STATIC
(
decl
)
=
1
;
TREE_READONLY
(
decl
)
=
1
;
TREE_READONLY
(
decl
)
=
1
;
DECL_SOURCE_LINE
(
decl
)
=
0
;
DECL_SOURCE_LINE
(
decl
)
=
0
;
DECL_IN_SYSTEM_HEADER
(
decl
)
=
1
;
DECL_IN_SYSTEM_HEADER
(
decl
)
=
1
;
DECL_IGNORED_P
(
decl
)
=
1
;
DECL_IGNORED_P
(
decl
)
=
1
;
init
=
build_string
(
strlen
(
printable_name
)
+
1
,
printable_name
);
init
=
build_string
(
len
,
printable_name
);
TREE_TYPE
(
init
)
=
char_array_type_nod
e
;
TREE_TYPE
(
init
)
=
typ
e
;
DECL_INITIAL
(
decl
)
=
init
;
DECL_INITIAL
(
decl
)
=
init
;
finish_decl
(
pushdecl
(
decl
),
init
,
NULL_TREE
);
finish_decl
(
pushdecl
(
decl
),
init
,
NULL_TREE
);
}
}
...
...
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