update_cc_test_checks.py and function declarations

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

update_cc_test_checks.py and function declarations

Hans Wennborg via cfe-dev
Hi Alex and all,

Did something change with update_cc_test_checks.py when moving from
c-index-test to the JSON AST for getting function line numbers?  Before
this change, a test like this had the checks put on the function
definitions:

void foo();

int main() {
  foo();
  return 0;
}

void foo() {
  ...
}

The checks for foo were put in front of the definition of foo.  Now I am
seeing the checks put in front of the declaration of foo, which messes
up the CHECK-LABEL ordering.

I don't see anything in the JSON parsing code that distinguishes a
function declaration from a function definition.  I don't know how the
old c-index-test code worked though.  The only thing I know is that I
used to get checks on the function definition and now I get them on the
function declaration.

I can't say for sure it is the use of the JSON AST that caused the
change in behavior I'm seeing as I have made some of my own
soon-to-be-upstreamed changes but it seems most likely since those other
changes shouldn't have affected the line2spell_and_mangled_list.

Thanks for your help!

                    -David
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: update_cc_test_checks.py and function declarations

Hans Wennborg via cfe-dev
David Greene <[hidden email]> writes:

> void foo();
>
> int main() {
>   foo();
>   return 0;
> }
>
> void foo() {
>   ...
> }
>
> The checks for foo were put in front of the definition of foo.  Now I am
> seeing the checks put in front of the declaration of foo, which messes
> up the CHECK-LABEL ordering.

Actually, I see the checks place *both* before the declaration *and*
before the definition.

                      -David
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: update_cc_test_checks.py and function declarations

Hans Wennborg via cfe-dev
Hi David,

This looks like a regression from when I added the JSON AST dump parsing code.
I never tried using it on a file with both definition and declaration for the same function. I've posted https://reviews.llvm.org/D73708 which should fix this issue.

Alex

On Wed, 29 Jan 2020 at 17:56, David Greene <[hidden email]> wrote:
David Greene <[hidden email]> writes:

> void foo();
>
> int main() {
>   foo();
>   return 0;
> }
>
> void foo() {
>   ...
> }
>
> The checks for foo were put in front of the definition of foo.  Now I am
> seeing the checks put in front of the declaration of foo, which messes
> up the CHECK-LABEL ordering.

Actually, I see the checks place *both* before the declaration *and*
before the definition.

                      -David

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: update_cc_test_checks.py and function declarations

Hans Wennborg via cfe-dev
Alexander Richardson via cfe-dev <[hidden email]> writes:

> Hi David,
>
> This looks like a regression from when I added the JSON AST dump parsing
> code.
> I never tried using it on a file with both definition and declaration for
> the same function. I've posted https://reviews.llvm.org/D73708 which should
> fix this issue.

Looks great, thank you!

                 -David

> On Wed, 29 Jan 2020 at 17:56, David Greene <[hidden email]> wrote:
>
>> David Greene <[hidden email]> writes:
>>
>> > void foo();
>> >
>> > int main() {
>> >   foo();
>> >   return 0;
>> > }
>> >
>> > void foo() {
>> >   ...
>> > }
>> >
>> > The checks for foo were put in front of the definition of foo.  Now I am
>> > seeing the checks put in front of the declaration of foo, which messes
>> > up the CHECK-LABEL ordering.
>>
>> Actually, I see the checks place *both* before the declaration *and*
>> before the definition.
>>
>>                       -David
>>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev