aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-16 14:19:32 +0000
committerandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-16 14:19:32 +0000
commit54253bbf7b25f3dbf5e93bc260343e7416c1ff42 (patch)
treec9a817b40dc60056a1c71cff1cb2502aab1418dd
parent8498c4d857f37041d1a003d3752191225db6bed0 (diff)
remove method cil_call_nargs_full
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/st/cli-be@149706 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/cil32/cil-stack.c2
-rw-r--r--gcc/config/cil32/cil-stmt-inline.h16
-rw-r--r--gcc/config/cil32/cil-stmt.c2
-rw-r--r--gcc/config/cil32/cil-stmt.h1
-rw-r--r--gcc/config/cil32/emit-cil.c17
-rw-r--r--gcc/config/cil32/remove-temps.c10
6 files changed, 19 insertions, 29 deletions
diff --git a/gcc/config/cil32/cil-stack.c b/gcc/config/cil32/cil-stack.c
index 6d171c19066..899feb293c1 100644
--- a/gcc/config/cil32/cil-stack.c
+++ b/gcc/config/cil32/cil-stack.c
@@ -344,7 +344,7 @@ cil_stack_after_stmt (cil_stack stack, cil_stmt stmt)
case CIL_JMP:
case CIL_NEWOBJ:
case CIL_CALLI:
- i = cil_call_nargs_full (stmt);
+ i = cil_call_nargs (stmt);
while (i-- != 0)
VEC_pop (cil_type_t, vstack);
diff --git a/gcc/config/cil32/cil-stmt-inline.h b/gcc/config/cil32/cil-stmt-inline.h
index ad319eeea7c..55a5cbda4f5 100644
--- a/gcc/config/cil32/cil-stmt-inline.h
+++ b/gcc/config/cil32/cil-stmt-inline.h
@@ -291,24 +291,12 @@ cil_call_fdecl (const_cil_stmt stmt)
return stmt->arg.fcall->fdecl;
}
-/* Return the number of arguments passed to the callee of a CIL CALL, CALLI,
- JMP or NEWOBJ statement. */
-
-static inline size_t
-cil_call_nargs (const_cil_stmt stmt)
-{
- gcc_assert (stmt->opcode == CIL_CALL || stmt->opcode == CIL_CALLI ||
- stmt->opcode == CIL_JMP || stmt->opcode == CIL_NEWOBJ);
-
- return stmt->arg.fcall->nargs;
-}
-
/* Return the total number of arguments passed to the callee of a CIL CALL,
- CALLI, JMP or NEWOBJ statement. Includes STatic_chain if present and
+ CALLI, JMP or NEWOBJ statement. Includes static_chain if present and
function pointer if indirect call */
static inline size_t
-cil_call_nargs_full (const_cil_stmt stmt)
+cil_call_nargs (const_cil_stmt stmt)
{
size_t result = 0;
gcc_assert (stmt->opcode == CIL_CALL || stmt->opcode == CIL_CALLI ||
diff --git a/gcc/config/cil32/cil-stmt.c b/gcc/config/cil32/cil-stmt.c
index 7a2f1886d1e..455c78276aa 100644
--- a/gcc/config/cil32/cil-stmt.c
+++ b/gcc/config/cil32/cil-stmt.c
@@ -867,7 +867,7 @@ cil_seq_stack_depth (cil_seq seq, bool ret, unsigned int init, bool max)
case CIL_JMP:
case CIL_NEWOBJ:
case CIL_CALLI:
- nargs = cil_call_nargs_full (cs);
+ nargs = cil_call_nargs (cs);
gcc_assert (depth >= nargs);
depth -= nargs;
diff --git a/gcc/config/cil32/cil-stmt.h b/gcc/config/cil32/cil-stmt.h
index b5e2d98f9ec..fa7e5dc0794 100644
--- a/gcc/config/cil32/cil-stmt.h
+++ b/gcc/config/cil32/cil-stmt.h
@@ -85,7 +85,6 @@ static inline cil_stmt cil_build_jmp_mp (tree, VEC (tree, heap) *);
static inline tree cil_call_ftype (const_cil_stmt);
static inline tree cil_call_fdecl (const_cil_stmt);
static inline size_t cil_call_nargs (const_cil_stmt);
-static inline size_t cil_call_nargs_full (const_cil_stmt);
static inline tree cil_call_arg_type (const_cil_stmt, size_t);
static inline void cil_call_set_static_chain (cil_stmt, tree);
static inline tree cil_call_static_chain (const_cil_stmt);
diff --git a/gcc/config/cil32/emit-cil.c b/gcc/config/cil32/emit-cil.c
index f23a5e97f5a..e913c4b71df 100644
--- a/gcc/config/cil32/emit-cil.c
+++ b/gcc/config/cil32/emit-cil.c
@@ -1535,12 +1535,17 @@ static void
emit_call_arg (FILE *file, const_cil_stmt call)
{
enum cil_opcode opcode = cil_opcode (call);
+ size_t nargs_base;
+ size_t nargs;
gcc_assert (opcode == CIL_CALL
|| opcode == CIL_CALLI
|| opcode == CIL_JMP
|| opcode == CIL_NEWOBJ);
+ nargs_base = cil_call_nargs_base (call);
+ nargs = cil_call_nargs (call);
+
/* Dump the return type. */
if (opcode == CIL_NEWOBJ)
fprintf (file, "instance void class");
@@ -1552,9 +1557,11 @@ emit_call_arg (FILE *file, const_cil_stmt call)
dump_type (file, TREE_TYPE (ftype), true, false);
}
- /* If Direct Call Dump the called method name. */
- if (opcode != CIL_CALLI)
+ if (opcode == CIL_CALLI)
+ --nargs;
+ else
{
+ /* If Direct Call Dump the called method name. */
fprintf (file, " ");
dump_method_name(file, cil_call_fdecl (call));
}
@@ -1562,16 +1569,12 @@ emit_call_arg (FILE *file, const_cil_stmt call)
/* Dump the call arguments. */
fprintf (file, " (");
{
- size_t nargs_base;
- size_t nargs;
size_t i;
- nargs_base = cil_call_nargs_base (call);
- nargs = cil_call_nargs (call);
-
if (cil_call_static_chain (call))
{
dump_type (file, cil_call_static_chain (call), true, true);
+ --nargs;
if (nargs_base > 0)
fprintf (file, ", ");
diff --git a/gcc/config/cil32/remove-temps.c b/gcc/config/cil32/remove-temps.c
index e9d2ba849e7..52bcc26db77 100644
--- a/gcc/config/cil32/remove-temps.c
+++ b/gcc/config/cil32/remove-temps.c
@@ -240,7 +240,7 @@ remove_matching_ldloc (cil_stmt_iterator csi, cil_stack stack, tree var,
if ((cil_opcode (stmt) == CIL_STLOC) && (cil_var (stmt) == var))
break;
else if ((cil_opcode (stmt) == CIL_LDLOC)
- && (cil_var (stmt) == var)
+ && (cil_var (stmt) == var)
&& (cil_stack_depth (stack) == min_depth))
{
csi_remove (&csi);
@@ -314,7 +314,7 @@ remove_matching_ldloc (cil_stmt_iterator csi, cil_stack stack, tree var,
case CIL_CALL:
case CIL_JMP:
case CIL_CALLI:
- nargs = cil_call_nargs_full (stmt);
+ nargs = cil_call_nargs (stmt);
if (cil_stack_depth (stack) - nargs < min_depth)
return false;
@@ -364,7 +364,7 @@ stloc_ldloc_to_dup (void)
for (csi = csi_start_bb (bb); !csi_end_p (csi); csi_next (&csi))
{
- stmt = csi_stmt (csi);
+ stmt = csi_stmt (csi);
if (cil_opcode (stmt) == CIL_STLOC)
{
@@ -402,10 +402,10 @@ stloc_ldloc_to_dup (void)
}
cil_stack_after_stmt (stack, stmt);
- }
+ }
/* We're done with this basic block. Copy the stack at the end of the
- block into the successors so that they will be able to access it and
+ block into the successors so that they will be able to access it and
then free the current stack as we're done with it. */
FOR_EACH_EDGE (e, ei, bb->succs)