diff mbox

[2/2] target-cris/translate.c: Remove _t_gen_mov_TN_env and _t_gen_mov_env_TN

Message ID 1402160582-13994-3-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 37654d9e6af84003982f8b9a5d59a4aef28e0a79
Headers show

Commit Message

Peter Maydell June 7, 2014, 5:03 p.m. UTC
The wrapper functions _t_gen_mov_TN_env and _t_gen_mov_env_TN are only
used via their accompanying non-underscore macros. The check they add
on offset is thus pointless, since the compiler will complain if the
struct field passed to the macro is not part of the struct. Remove the
functions and make the macros directly expand to the appropriate
tcg_gen_{ld,st}_tl calls.

This conveniently avoids a warning due to _t_gen_mov_TN_env() being
unused.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-cris/translate.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
diff mbox

Patch

diff --git a/target-cris/translate.c b/target-cris/translate.c
index eaea633..a10d972 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -159,24 +159,9 @@  static int preg_sizes[] = {
 };
 
 #define t_gen_mov_TN_env(tn, member) \
- _t_gen_mov_TN_env((tn), offsetof(CPUCRISState, member))
+    tcg_gen_ld_tl(tn, cpu_env, offsetof(CPUCRISState, member))
 #define t_gen_mov_env_TN(member, tn) \
- _t_gen_mov_env_TN(offsetof(CPUCRISState, member), (tn))
-
-static inline void _t_gen_mov_TN_env(TCGv tn, int offset)
-{
-    if (offset > sizeof(CPUCRISState)) {
-        fprintf(stderr, "wrong load from env from off=%d\n", offset);
-    }
-    tcg_gen_ld_tl(tn, cpu_env, offset);
-}
-static inline void _t_gen_mov_env_TN(int offset, TCGv tn)
-{
-    if (offset > sizeof(CPUCRISState)) {
-        fprintf(stderr, "wrong store to env at off=%d\n", offset);
-    }
-    tcg_gen_st_tl(tn, cpu_env, offset);
-}
+    tcg_gen_st_tl(tn, cpu_env, offsetof(CPUCRISState, member))
 
 static inline void t_gen_mov_TN_preg(TCGv tn, int r)
 {