Commit 9dbe0d83 by Aditya Kumar Committed by Richard Biener

gimple.h (gimple_expr_type): Refactor to make it concise.

2015-05-22  hiraditya  <hiraditya@msn.com>

        * gimple.h (gimple_expr_type): Refactor to make it concise.
        Remove redundant if.

From-SVN: r223529
parent 476c1280
2015-05-22 hiraditya <hiraditya@msn.com>
* gimple.h (gimple_expr_type): Refactor to make it concise. Remove
redundant if.
2015-05-22 Richard Biener <rguenther@suse.de> 2015-05-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/65701 PR tree-optimization/65701
......
...@@ -5717,10 +5717,6 @@ static inline tree ...@@ -5717,10 +5717,6 @@ static inline tree
gimple_expr_type (const_gimple stmt) gimple_expr_type (const_gimple stmt)
{ {
enum gimple_code code = gimple_code (stmt); enum gimple_code code = gimple_code (stmt);
if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
{
tree type;
/* In general we want to pass out a type that can be substituted /* In general we want to pass out a type that can be substituted
for both the RHS and the LHS types if there is a possibly for both the RHS and the LHS types if there is a possibly
useless conversion involved. That means returning the useless conversion involved. That means returning the
...@@ -5730,23 +5726,17 @@ gimple_expr_type (const_gimple stmt) ...@@ -5730,23 +5726,17 @@ gimple_expr_type (const_gimple stmt)
const gcall *call_stmt = as_a <const gcall *> (stmt); const gcall *call_stmt = as_a <const gcall *> (stmt);
if (gimple_call_internal_p (call_stmt) if (gimple_call_internal_p (call_stmt)
&& gimple_call_internal_fn (call_stmt) == IFN_MASK_STORE) && gimple_call_internal_fn (call_stmt) == IFN_MASK_STORE)
type = TREE_TYPE (gimple_call_arg (call_stmt, 3)); return TREE_TYPE (gimple_call_arg (call_stmt, 3));
else else
type = gimple_call_return_type (call_stmt); return gimple_call_return_type (call_stmt);
} }
else else if (code == GIMPLE_ASSIGN)
switch (gimple_assign_rhs_code (stmt))
{ {
case POINTER_PLUS_EXPR: if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
type = TREE_TYPE (gimple_assign_rhs1 (stmt)); return TREE_TYPE (gimple_assign_rhs1 (stmt));
break; else
default:
/* As fallback use the type of the LHS. */ /* As fallback use the type of the LHS. */
type = TREE_TYPE (gimple_get_lhs (stmt)); return TREE_TYPE (gimple_get_lhs (stmt));
break;
}
return type;
} }
else if (code == GIMPLE_COND) else if (code == GIMPLE_COND)
return boolean_type_node; return boolean_type_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment