diff options
author | Rong Xu <xur@google.com> | 2014-07-21 16:47:22 -0700 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2014-07-29 15:31:03 -0700 |
commit | 38a8aecfb882072900434499696b5c32a2274515 (patch) | |
tree | 2aac97f0ae24b03cd98c1a06e989c031c173f889 /gcc-4.9/gcc/function.h | |
parent | c231900e5dcc14d8296bd9f62b45997a49d4d5e7 (diff) | |
download | toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.zip toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.gz toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.bz2 |
[4.9] Switch gcc-4.9 to use google/gcc-4_9 branch.
This source drop uses svn version r212828 of google/gcc-4.9 branch.
We also cherry-picked r213062, r213063 and r213064 to fix windows
build issues.
All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9.
The following prior commits has not been merged to google branch yet.
(They are included in this commit).
e7af147f979e657fe2df00808e5b4319b0e088c6,
baf87df3cb2683649ba7e9872362a7e721117c23, and
c231900e5dcc14d8296bd9f62b45997a49d4d5e7.
Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b
Diffstat (limited to 'gcc-4.9/gcc/function.h')
-rw-r--r-- | gcc-4.9/gcc/function.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/function.h b/gcc-4.9/gcc/function.h index 38a0fc4..23ac150 100644 --- a/gcc-4.9/gcc/function.h +++ b/gcc-4.9/gcc/function.h @@ -574,6 +574,9 @@ struct GTY(()) function { /* Last statement uid. */ int last_stmt_uid; + /* Function's module id. */ + unsigned module_id; + /* Function sequence number for profiling, debugging, etc. */ int funcdef_no; @@ -672,6 +675,46 @@ struct GTY(()) function { unsigned int tail_call_marked : 1; }; +#if 0 +#define EXTRACT_MODULE_ID_FROM_GLOBAL_ID(gid) (unsigned)(((gid) >> FUNC_ID_WIDTH) & FUNC_ID_MASK) +#define EXTRACT_FUNC_ID_FROM_GLOBAL_ID(gid) (unsigned)((gid) & FUNC_ID_MASK) +#define FUNC_DECL_MODULE_ID(func) EXTRACT_MODULE_ID_FROM_GLOBAL_ID ((func)->funcdef_no + 1) +#define FUNC_DECL_FUNC_ID(func) EXTRACT_FUNC_ID_FROM_GLOBAL_ID ((func)->funcdef_no + 1) +#define FUNC_DECL_GLOBAL_ID(func) ((func)->funcdef_no + 1) +#define GEN_FUNC_GLOBAL_ID(m,f) ((((HOST_WIDE_INT) (m)) << FUNC_ID_WIDTH) | (f)) +#endif + +/* The bit width of function id in the global function id used + in LIPO. */ +#define FUNC_ID_WIDTH HOST_BITS_PER_WIDEST_INT / 2 +/* The mask to extract function id from the global function id. */ +#define FUNC_ID_MASK ((1ll << FUNC_ID_WIDTH) - 1) +/* Macro to extract module id from global function id GID. */ +#define EXTRACT_MODULE_ID_FROM_GLOBAL_ID(gid) (unsigned)(((gid) >>\ + FUNC_ID_WIDTH) & FUNC_ID_MASK) +/* Macro to extract function id from global function id GID. */ +#define EXTRACT_FUNC_ID_FROM_GLOBAL_ID(gid) (unsigned)((gid) & FUNC_ID_MASK) +/* Macro to generate a global function id from module id M and + function id F. */ +#define GEN_FUNC_GLOBAL_ID(m,f) ((((HOST_WIDEST_INT) (m)) << FUNC_ID_WIDTH)\ + | (f)) +/* Access macro for module_id field of function FUNC. */ +#define FUNC_DECL_MODULE_ID(func) ((func)->module_id) +/* Access macro for funcdef_no field of function FUNC. */ +#define FUNC_DECL_FUNC_ID(func) ((func)->funcdef_no + 1) +/* Macro to compute global function id for FUNC. */ +#define FUNC_DECL_GLOBAL_ID(func) \ + GEN_FUNC_GLOBAL_ID (FUNC_DECL_MODULE_ID (func), FUNC_DECL_FUNC_ID (func)) +#if FUNC_ID_WIDTH == 16 +/* 32 bit wide unique id used for asm label (limit: 30k modules, + 128k funcs per module. */ +#define FUNC_LABEL_ID(func) ((FUNC_DECL_MODULE_ID (func) << 18) +\ + (func)->funcdef_no) +#else +#define FUNC_LABEL_ID(func) (((unsigned long)(FUNC_DECL_MODULE_ID (func)) << 32) +\ + (func)->funcdef_no) +#endif + /* Add the decl D to the local_decls list of FUN. */ static inline void @@ -809,6 +852,9 @@ extern void used_types_insert (tree); extern int get_next_funcdef_no (void); extern int get_last_funcdef_no (void); +extern void reset_funcdef_no (void); +extern void set_funcdef_no (int); + #ifdef HAVE_simple_return extern bool requires_stack_frame_p (rtx, HARD_REG_SET, HARD_REG_SET); #endif |