Message ID | 1322131357.23412.76.camel@e102549-lin.cambridge.arm.com |
---|---|
State | New |
Headers | show |
On 11/24/2011 05:42 AM, Sameera Deshpande wrote: > - if (TREE_CODE (fn) == ADDR_EXPR) > + if (fn != NULL && TREE_CODE (fn) == ADDR_EXPR) > fn = TREE_OPERAND (fn, 0); > - if (TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) > + if (fn != NULL && TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) > pp_string (buffer, " [tm-clone]"); > - if (TREE_CODE (fn) == FUNCTION_DECL > + if (fn != NULL I'd rather not add the null check so many times. How about just returning if fn is null? Jason
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index f0e7c50..6d96868 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -699,11 +699,12 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags) pp_string (buffer, " [tail call]"); /* Dump the arguments of _ITM_beginTransaction sanely. */ - if (TREE_CODE (fn) == ADDR_EXPR) + if (fn != NULL && TREE_CODE (fn) == ADDR_EXPR) fn = TREE_OPERAND (fn, 0); - if (TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) + if (fn != NULL && TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) pp_string (buffer, " [tm-clone]"); - if (TREE_CODE (fn) == FUNCTION_DECL + if (fn != NULL + && TREE_CODE (fn) == FUNCTION_DECL && DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (fn) == BUILT_IN_TM_START && gimple_call_num_args (gs) > 0)