X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fpretty-print.c;h=b611ec985167c629258d885d7741137b1233d963;hb=ec1936763426eda04e532df52fae10b7e3d01902;hp=8f55df29a24b8ca2c58d8372a7c4f1aa37435b81;hpb=e47a6f81edf98a062ad29cdb62590c1c7fdeb37a;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index 8f55df29a24..b611ec98516 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -1,5 +1,5 @@ /* Various declarations for language-independent pretty-print subroutines. - Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see break; \ \ case 2: \ - pp_scalar (PP, "%ll" F, va_arg (ARG, long long T)); \ + pp_scalar (PP, "%" HOST_LONG_LONG_FORMAT F, va_arg (ARG, long long T)); \ break; \ \ default: \ @@ -187,6 +187,7 @@ pp_base_indent (pretty_printer *pp) %Ns: likewise, but length specified as constant in the format string. %H: location_t. %J: a decl tree, from which DECL_SOURCE_LOCATION will be recorded. + %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded. Flag 'q': quote formatted text (must come immediately after '%'). Arguments can be used sequentially, or through %N$ resp. *N$ @@ -486,6 +487,35 @@ pp_base_format (pretty_printer *pp, text_info *text) } break; + case 'K': + { + tree t = va_arg (*text->args_ptr, tree), block; + gcc_assert (text->locus != NULL); + *text->locus = EXPR_LOCATION (t); + gcc_assert (text->abstract_origin != NULL); + block = TREE_BLOCK (t); + *text->abstract_origin = NULL; + while (block + && TREE_CODE (block) == BLOCK + && BLOCK_ABSTRACT_ORIGIN (block)) + { + tree ao = BLOCK_ABSTRACT_ORIGIN (block); + + while (TREE_CODE (ao) == BLOCK + && BLOCK_ABSTRACT_ORIGIN (ao) + && BLOCK_ABSTRACT_ORIGIN (ao) != ao) + ao = BLOCK_ABSTRACT_ORIGIN (ao); + + if (TREE_CODE (ao) == FUNCTION_DECL) + { + *text->abstract_origin = block; + break; + } + block = BLOCK_SUPERCONTEXT (block); + } + } + break; + case '.': { int n;