[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 46/57] Define and use `CONST_ATTR'
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 46/57] Define and use `CONST_ATTR' |
Date: |
Fri, 21 Sep 2012 14:11:47 +0300 |
---
include/compiler.h | 2 ++
src/arm/Gex_tables.c | 2 +-
src/dwarf/Gparser.c | 2 +-
src/ia64/Gparser.c | 2 +-
src/ia64/Gscript.c | 2 +-
5 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/compiler.h b/include/compiler.h
index ed5384c..312ac15 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -32,6 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#ifdef __GNUC__
# define ALIGNED(x) __attribute__((aligned(x)))
+# define CONST_ATTR __attribute__((__const__))
# define UNUSED __attribute__((unused))
# define NOINLINE __attribute__((noinline))
# define NORETURN __attribute__((noreturn))
@@ -56,6 +57,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#else
# define ALIGNED(x)
# define ALWAYS_INLINE
+# define CONST_ATTR
# define UNUSED
# define NOINLINE
# define NORETURN
diff --git a/src/arm/Gex_tables.c b/src/arm/Gex_tables.c
index d78fbaf..8004fb5 100644
--- a/src/arm/Gex_tables.c
+++ b/src/arm/Gex_tables.c
@@ -53,7 +53,7 @@ struct arm_cb_data
unw_dyn_info_t di; /* info about the ARM exidx segment */
};
-static inline uint32_t
+static inline uint32_t CONST_ATTR
prel31_read (uint32_t prel31)
{
return ((int32_t)prel31 << 1) >> 1;
diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c
index 5adbb9a..fd2bdae 100644
--- a/src/dwarf/Gparser.c
+++ b/src/dwarf/Gparser.c
@@ -551,7 +551,7 @@ put_rs_cache (unw_addr_space_t as, struct dwarf_rs_cache
*cache,
lock_release (&cache->lock, *saved_maskp);
}
-static inline unw_hash_index_t
+static inline unw_hash_index_t CONST_ATTR
hash (unw_word_t ip)
{
/* based on (sqrt(5)/2-1)*2^64 */
diff --git a/src/ia64/Gparser.c b/src/ia64/Gparser.c
index 88ea90f..ff36968 100644
--- a/src/ia64/Gparser.c
+++ b/src/ia64/Gparser.c
@@ -109,7 +109,7 @@ free_state_stack (struct ia64_reg_state *rs)
/* Unwind decoder routines */
-static enum ia64_pregnum __attribute__ ((const))
+static enum ia64_pregnum CONST_ATTR
decode_abreg (unsigned char abreg, int memory)
{
switch (abreg)
diff --git a/src/ia64/Gscript.c b/src/ia64/Gscript.c
index 13227b3..5d8f2e1 100644
--- a/src/ia64/Gscript.c
+++ b/src/ia64/Gscript.c
@@ -56,7 +56,7 @@ static __thread struct ia64_script_cache
ia64_per_thread_cache =
};
#endif
-static inline unw_hash_index_t
+static inline unw_hash_index_t CONST_ATTR
hash (unw_word_t ip)
{
/* based on (sqrt(5)/2-1)*2^64 */
--
1.7.9.5
- [Libunwind-devel] [PATCH 48/57] Use `UNUSED' in tests, (continued)
- [Libunwind-devel] [PATCH 48/57] Use `UNUSED' in tests, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 52/57] Apply `define_lock()', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 49/57] Use shared `ARRAY_SIZE' in IA64 tests, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 56/57] Add arguments to malloc and calloc prototypes in Ltest-nocalloc, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 55/57] Remove unused variable in Ltest-nocalloc, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 53/57] Prefer NULL over zero, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 35/57] SuperH port, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 47/57] Plug in `ALIAS' attribute, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 42/57] IA64: constify read only arrays in `tdep_init()', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 45/57] Define and use `WEAK', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 46/57] Define and use `CONST_ATTR',
Tommi Rantala <=
- [Libunwind-devel] [PATCH 43/57] Plug in `ARRAY_SIZE' in ptrace code, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 57/57] Assign `func' just once in Ltest-nocalloc glibc case, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 44/57] Define and use `NOINLINE', Tommi Rantala, 2012/09/21