diff mbox

Tiny cleanup for protected_set_expr_location

Message ID 20140912205214.GB23226@redhat.com
State New
Headers show

Commit Message

Marek Polacek Sept. 12, 2014, 8:52 p.m. UTC
This is rather obvious.  CAN_HAVE_LOCATION_P checks that the node is
non-null, so no need to check for it in protected_set_expr_location too.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2014-09-12  Marek Polacek  <polacek@redhat.com>

	* tree.c (protected_set_expr_location): Don't check whether T is
	non-null here.


	Marek

Comments

Jeff Law Sept. 12, 2014, 8:58 p.m. UTC | #1
On 09/12/14 14:52, Marek Polacek wrote:
> This is rather obvious.  CAN_HAVE_LOCATION_P checks that the node is
> non-null, so no need to check for it in protected_set_expr_location too.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2014-09-12  Marek Polacek  <polacek@redhat.com>
>
> 	* tree.c (protected_set_expr_location): Don't check whether T is
> 	non-null here.
OK.
Jeff
diff mbox

Patch

diff --git gcc/tree.c gcc/tree.c
index 6ad0575..f999a3b 100644
--- gcc/tree.c
+++ gcc/tree.c
@@ -4585,7 +4585,7 @@  build_block (tree vars, tree subblocks, tree supercontext, tree chain)
 void
 protected_set_expr_location (tree t, location_t loc)
 {
-  if (t && CAN_HAVE_LOCATION_P (t))
+  if (CAN_HAVE_LOCATION_P (t))
     SET_EXPR_LOCATION (t, loc);
 }