PetScan::extract_argument: allow multiple implicit casts on arguments
PetScan::extract_argument would only strip off a single implicit cast,
making it fail to recognize some arguments that may be used for writing.
In particular, the second argument of
foo(n, A)
from
void bar(int n, float A[static const restrict n][n])
to
void foo(int n, float A[static const restrict n][n]);
is of the form
ImplicitCastExpr 0x65dc80 'float (*)[*]' <BitCast>
`-ImplicitCastExpr 0x65dc68 'float (*)[n]' <LValueToRValue>
`-DeclRefExpr 0x65db10 'float (*const restrict)[n]':'float (*const restrict)[n]' lvalue ParmVar 0x65d890 'A' 'float (*const restrict)[n]':'float (*const restrict)[n]'
such that two implicit casts would need to be stripped off.
Strip off all outer implicit casts.
Reported-by: Michael Kruse <MichaelKruse@meinersbur.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>