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
df69b598
Commit
df69b598
authored
Jan 17, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Provide location for initialization function.
From-SVN: r195259
parent
6b514c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
gcc/go/gofrontend/gogo-tree.cc
+7
-5
No files found.
gcc/go/gofrontend/gogo-tree.cc
View file @
df69b598
...
...
@@ -438,15 +438,15 @@ Gogo::initialization_function_decl()
// The tedious details of building your own function. There doesn't
// seem to be a helper function for this.
std
::
string
name
=
this
->
package_name
()
+
".init"
;
tree
fndecl
=
build_decl
(
BUILTINS_LOCATION
,
FUNCTION_DECL
,
get_identifier_from_string
(
name
),
tree
fndecl
=
build_decl
(
this
->
package_
->
location
().
gcc_location
()
,
FUNCTION_DECL
,
get_identifier_from_string
(
name
),
build_function_type
(
void_type_node
,
void_list_node
));
const
std
::
string
&
asm_name
(
this
->
get_init_fn_name
());
SET_DECL_ASSEMBLER_NAME
(
fndecl
,
get_identifier_from_string
(
asm_name
));
tree
resdecl
=
build_decl
(
BUILTINS_LOCATION
,
RESULT_DECL
,
NULL_TREE
,
void_type_node
);
tree
resdecl
=
build_decl
(
this
->
package_
->
location
().
gcc_location
()
,
RESULT_DECL
,
NULL_TREE
,
void_type_node
);
DECL_ARTIFICIAL
(
resdecl
)
=
1
;
DECL_CONTEXT
(
resdecl
)
=
fndecl
;
DECL_RESULT
(
fndecl
)
=
resdecl
;
...
...
@@ -481,7 +481,8 @@ Gogo::write_initialization_function(tree fndecl, tree init_stmt_list)
push_struct_function
(
fndecl
);
else
push_cfun
(
DECL_STRUCT_FUNCTION
(
fndecl
));
cfun
->
function_end_locus
=
BUILTINS_LOCATION
;
cfun
->
function_start_locus
=
this
->
package_
->
location
().
gcc_location
();
cfun
->
function_end_locus
=
cfun
->
function_start_locus
;
gimplify_function_tree
(
fndecl
);
...
...
@@ -1118,6 +1119,7 @@ Named_object::get_tree(Gogo* gogo, Named_object* function)
else
push_cfun
(
DECL_STRUCT_FUNCTION
(
decl
));
cfun
->
function_start_locus
=
func
->
location
().
gcc_location
();
cfun
->
function_end_locus
=
func
->
block
()
->
end_location
().
gcc_location
();
...
...
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