From c2b64ceab2ae2e0b86271248a5c31690a1604984 Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Thu, 11 May 2017 09:27:55 +0000 Subject: [PATCH] tree-ssa-address.c (struct mem_address): Move to header file. * tree-ssa-address.c (struct mem_address): Move to header file. (valid_mem_ref_p, move_fixed_address_to_symbol): Make it global. * tree-ssa-address.h (struct mem_address): Move from C file. (valid_mem_ref_p, move_fixed_address_to_symbol): Declare. From-SVN: r247884 --- gcc/ChangeLog | 7 +++++++ gcc/tree-ssa-address.c | 11 ++--------- gcc/tree-ssa-address.h | 10 ++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bfd958ab95..09096ece083 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-05-11 Bin Cheng + + * tree-ssa-address.c (struct mem_address): Move to header file. + (valid_mem_ref_p, move_fixed_address_to_symbol): Make it global. + * tree-ssa-address.h (struct mem_address): Move from C file. + (valid_mem_ref_p, move_fixed_address_to_symbol): Declare. + 2017-05-11 Bin Cheng * tree-affine.h (aff_combination_type): New interface. diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index 8d46a3e6733..e35d3235e04 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -178,13 +178,6 @@ gen_addr_rtx (machine_mode address_mode, *addr = const0_rtx; } -/* Description of a memory address. */ - -struct mem_address -{ - tree symbol, base, index, step, offset; -}; - /* Returns address for TARGET_MEM_REF with parameters given by ADDR in address space AS. If REALLY_EXPAND is false, just make fake registers instead @@ -330,7 +323,7 @@ tree_mem_ref_addr (tree type, tree mem_ref) /* Returns true if a memory reference in MODE and with parameters given by ADDR is valid on the current target. */ -static bool +bool valid_mem_ref_p (machine_mode mode, addr_space_t as, struct mem_address *addr) { @@ -408,7 +401,7 @@ fixed_address_object_p (tree obj) /* If ADDR contains an address of object that is a link time constant, move it to PARTS->symbol. */ -static void +void move_fixed_address_to_symbol (struct mem_address *parts, aff_tree *addr) { unsigned i; diff --git a/gcc/tree-ssa-address.h b/gcc/tree-ssa-address.h index 311348ea298..cd62ed95716 100644 --- a/gcc/tree-ssa-address.h +++ b/gcc/tree-ssa-address.h @@ -20,10 +20,20 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_TREE_SSA_ADDRESS_H #define GCC_TREE_SSA_ADDRESS_H +/* Description of a memory address. */ + +struct mem_address +{ + tree symbol, base, index, step, offset; +}; + extern rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool); extern rtx addr_for_mem_ref (tree exp, addr_space_t as, bool really_expand); extern void get_address_description (tree, struct mem_address *); extern tree tree_mem_ref_addr (tree, tree); +extern bool valid_mem_ref_p (machine_mode, addr_space_t, struct mem_address *); +extern void move_fixed_address_to_symbol (struct mem_address *, + struct aff_tree *); tree create_mem_ref (gimple_stmt_iterator *, tree, struct aff_tree *, tree, tree, tree, bool); extern void copy_ref_info (tree, tree); -- 2.30.2