[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment.

I see what is going on here. The problem is not in this patch, but there is a 
problem in update_cc_test_checks.py.

I had all the other files in `clang/test/utils/update_cc_test_checks` still 
checked out as unix line endings from before I had updated the config, and that 
is why they were not failing.

Fixing `update_cc_test_checks.py` and restoring those other files makes every 
test pass.
Here is my diff:

  diff --git a/llvm/utils/update_cc_test_checks.py 
b/llvm/utils/update_cc_test_checks.py
  index b9e91f19461b..0e755d100760 100755
  --- a/llvm/utils/update_cc_test_checks.py
  +++ b/llvm/utils/update_cc_test_checks.py
  @@ -414,7 +414,7 @@ def main():
  output_lines, global_vars_seen_dict, True, 
False)
   common.debug('Writing %d lines to %s...' % (len(output_lines), ti.path))
   with open(ti.path, 'wb') as f:
  -  f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines])
  +  f.writelines(['{}{}'.format(l, os.linesep).encode('utf-8') for l in 
output_lines])
  
 return 0

I will submit a MR with this patch later today.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment.

In D130089#3668111 , @nhaehnle wrote:

> My version of `diff` has a `--strip-trailing-cr` flag. But I don't really see 
> that being used in many places at all.

What I see is that the sources are checked out with the expected windows (\r\n) 
line endings, but the file we generate 
(`build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c`)
 has unix (\n) line endings.
I am not sure yet what we would usually do here, but it makes more sense to 
generate the file with line endings expected for the native platform.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Nicolai Hähnle via Phabricator via cfe-commits
nhaehnle added a comment.

My version of `diff` has a `--strip-trailing-cr` flag. But I don't really see 
that being used in many places at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment.

In D130089#3668061 , @nhaehnle wrote:

> I've been staring at ifdef.test vs. basic-cplusplus.test for a while now and 
> don't see any relevant difference, including when I look at the line endings 
> in a hex editor (on Linux). So I guess there is a difference that appears 
> only on Windows somehow? Unfortunately, I simply have no idea at the moment 
> where it could come from.

Yeah it could be that there is some flag we should be passing to diff, or some 
other thing that we normally do on llvm to take care of this issue, so that 
diff ignores the line ending difference.
I haven't had time to look at what is the standard practice we have for that 
yet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Nicolai Hähnle via Phabricator via cfe-commits
nhaehnle added a comment.

I've been staring at ifdef.test vs. basic-cplusplus.test for a while now and 
don't see any relevant difference, including when I look at the line endings in 
a hex editor (on Linux). So I guess there is a difference that appears only on 
Windows somehow? Unfortunately, I simply have no idea at the moment where it 
could come from.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment.

In D130089#3668022 , @nhaehnle wrote:

> Aren't the before and after lines of the diff identical? Is this a Windows 
> new-lines issue?

Yeah it looks like it from a glance, but I haven't had time to take a harder 
look at this yet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-21 Thread Nicolai Hähnle via Phabricator via cfe-commits
nhaehnle added a comment.

In D130089#3666076 , @mizvekov wrote:

> This seems to have introduced a test which always fails on windows:
>
>   $ ":" "RUN: at line 4"
>   $ "cp" "clang\test\utils\update_cc_test_checks/Inputs/ifdef.c" 
> "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   $ "C:/Program Files (x86)/Microsoft Visual 
> Studio/Shared/Python39_64/python.exe" "llvm\utils\update_cc_test_checks.py" 
> "--clang" "build\llvm\RelWithDebInfo\bin\clang" "--opt" 
> "build\llvm\RelWithDebInfo\bin\opt" 
> "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   $ ":" "RUN: at line 5"
>   $ "diff" "-u" 
> "clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected" 
> "build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
>   # command output:
>   --- clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected
>   +++ 
> build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c
>   @@ -1,21 +1,21 @@
>   -// NOTE: Assertions have been autogenerated by 
> utils/update_cc_test_checks.py
>   -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | 
> FileCheck -check-prefixes=CHECK %s
>   -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s 
> -DFOO | FileCheck -check-prefixes=CHECK,FOO %s
>   -
>   -#ifdef FOO
>   -// FOO-LABEL: @foo(
>   -// FOO-NEXT:  entry:
>   -// FOO-NEXT:ret i32 1
>   -//
>   -int foo() {
>   -  return 1;
>   -}
>   -#endif
>   -
>   -// CHECK-LABEL: @bar(
>   -// CHECK-NEXT:  entry:
>   -// CHECK-NEXT:ret i32 2
>   -//
>   -int bar() {
>   -  return 2;
>   -}
>   +// NOTE: Assertions have been autogenerated by 
> utils/update_cc_test_checks.py
>   +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | 
> FileCheck -check-prefixes=CHECK %s
>   +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s 
> -DFOO | FileCheck -check-prefixes=CHECK,FOO %s
>   +
>   +#ifdef FOO
>   +// FOO-LABEL: @foo(
>   +// FOO-NEXT:  entry:
>   +// FOO-NEXT:ret i32 1
>   +//
>   +int foo() {
>   +  return 1;
>   +}
>   +#endif
>   +
>   +// CHECK-LABEL: @bar(
>   +// CHECK-NEXT:  entry:
>   +// CHECK-NEXT:ret i32 2
>   +//
>   +int bar() {
>   +  return 2;
>   +}
>   
>   error: command failed with exit status: 1
>   
>   --
>   
>   
>   Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
>   
>   Failed Tests (1):
> Clang :: utils/update_cc_test_checks/ifdef.test
>   
>   
>   Testing Time: 0.28s
> Failed: 1

Aren't the before and after lines of the diff identical? Is this a Windows 
new-lines issue?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-20 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment.

This seems to have introduced a test which always fails on windows:

  $ ":" "RUN: at line 4"
  $ "cp" "clang\test\utils\update_cc_test_checks/Inputs/ifdef.c" 
"build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
  $ "C:/Program Files (x86)/Microsoft Visual 
Studio/Shared/Python39_64/python.exe" "llvm\utils\update_cc_test_checks.py" 
"--clang" "build\llvm\RelWithDebInfo\bin\clang" "--opt" 
"build\llvm\RelWithDebInfo\bin\opt" 
"build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
  $ ":" "RUN: at line 5"
  $ "diff" "-u" 
"clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected" 
"build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c"
  # command output:
  --- clang\test\utils\update_cc_test_checks/Inputs/ifdef.c.expected
  +++ 
build\llvm\tools\clang\test\utils\update_cc_test_checks\Output\ifdef.test.tmp.c
  @@ -1,21 +1,21 @@
  -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
  -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | 
FileCheck -check-prefixes=CHECK %s
  -// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -DFOO 
| FileCheck -check-prefixes=CHECK,FOO %s
  -
  -#ifdef FOO
  -// FOO-LABEL: @foo(
  -// FOO-NEXT:  entry:
  -// FOO-NEXT:ret i32 1
  -//
  -int foo() {
  -  return 1;
  -}
  -#endif
  -
  -// CHECK-LABEL: @bar(
  -// CHECK-NEXT:  entry:
  -// CHECK-NEXT:ret i32 2
  -//
  -int bar() {
  -  return 2;
  -}
  +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
  +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | 
FileCheck -check-prefixes=CHECK %s
  +// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -DFOO 
| FileCheck -check-prefixes=CHECK,FOO %s
  +
  +#ifdef FOO
  +// FOO-LABEL: @foo(
  +// FOO-NEXT:  entry:
  +// FOO-NEXT:ret i32 1
  +//
  +int foo() {
  +  return 1;
  +}
  +#endif
  +
  +// CHECK-LABEL: @bar(
  +// CHECK-NEXT:  entry:
  +// CHECK-NEXT:ret i32 2
  +//
  +int bar() {
  +  return 2;
  +}
  
  error: command failed with exit status: 1
  
  --
  
  
  Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
  
  Failed Tests (1):
Clang :: utils/update_cc_test_checks/ifdef.test
  
  
  Testing Time: 0.28s
Failed: 1


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-20 Thread Nicolai Hähnle via Phabricator via cfe-commits
nhaehnle added inline comments.



Comment at: 
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll:2
 ; Check that we accept functions with '$' in the name.
 ; TODO: This is not handled correcly on 32bit ARM and needs to be fixed.
 

arichardson wrote:
> Remove this TODO?
Ok, will do before I commit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-20 Thread Nicolai Hähnle via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
nhaehnle marked an inline comment as done.
Closed by commit rG5a4033c36716: update-test-checks: safely handle tests with 
#if's (authored by nhaehnle).

Changed prior to commit:
  https://reviews.llvm.org/D130089?vs=445817&id=446085#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

Files:
  clang/test/utils/update_cc_test_checks/Inputs/ifdef.c
  clang/test/utils/update_cc_test_checks/Inputs/ifdef.c.expected
  clang/test/utils/update_cc_test_checks/ifdef.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected
  llvm/utils/UpdateTestChecks/asm.py
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_analyze_test_checks.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_llc_test_checks.py
  llvm/utils/update_test_checks.py

Index: llvm/utils/update_test_checks.py
===
--- llvm/utils/update_test_checks.py
+++ llvm/utils/update_test_checks.py
@@ -120,6 +120,7 @@
verbose=ti.args.verbose)
   builder.process_run_line(common.OPT_FUNCTION_RE, common.scrub_body,
   raw_tool_output, prefixes, False)
+  builder.processed_prefixes(prefixes)
 
 func_dict = builder.finish_and_get_func_dict()
 is_in_function = False
Index: llvm/utils/update_llc_test_checks.py
===
--- llvm/utils/update_llc_test_checks.py
+++ llvm/utils/update_llc_test_checks.py
@@ -137,6 +137,7 @@
 
   scrubber, function_re = output_type.get_run_handler(triple)
   builder.process_run_line(function_re, scrubber, raw_tool_output, prefixes, True)
+  builder.processed_prefixes(prefixes)
 
 func_dict = builder.finish_and_get_func_dict()
 global_vars_seen_dict = {}
Index: llvm/utils/update_cc_test_checks.py
===
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -214,6 +214,7 @@
 builder.process_run_line(
 common.OPT_FUNCTION_RE, common.scrub_body, raw_tool_output,
 prefixes, False)
+builder.processed_prefixes(prefixes)
   else:
 print('The clang command line should include -emit-llvm as asm tests '
   'are discouraged in Clang testsuite.', file=sys.stderr)
Index: llvm/utils/update_analyze_test_checks.py
===
--- llvm/utils/update_analyze_test_checks.py
+++ llvm/utils/update_analyze_test_checks.py
@@ -124,6 +124,8 @@
 common.warn('Don\'t know how to deal with this output')
 continue
 
+  builder.processed_prefixes(prefixes)
+
 func_dict = builder.finish_and_get_func_dict()
 is_in_function = False
 is_in_function_start = False
Index: llvm/utils/UpdateTestChecks/common.py
===
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -496,6 +496,7 @@
 self._func_dict = {}
 self._func_order = {}
 self._global_var_dict = {}
+self._processed_prefixes = set()
 for tuple in run_list:
   for prefix in tuple[0]:
 self._func_dict.update({prefix:dict()})
@@ -584,30 +585,43 @@
scrubbed_body)
 
 if func in self._func_dict[prefix]:
-  if (self._func_dict[prefix][func] is None or
-  str(self._func_dict[prefix][func]) != scrubbed_body or
-  self._func_dict[prefix][func].args_and_sig != args_and_sig or
-  self._func_dict[prefix][func].attrs != attrs):
-if (self._func_dict[prefix][func] is not None and
-self._func_dict[prefix][func].is_same_except_arg_names(
+  if (self._func_dict[prefix][func] is not None and
+  (str(self._func_dict[prefix][func]) != scrubbed_body or
+   self._func_dict[prefix][func].args_and_sig != args_and_sig or
+   self._func_dict[prefix][func].attrs != attrs)):
+if self._func_dict[prefix][func].is_same_except_arg_names(
 scrubbed_extra,
 args_and_sig,
 attrs,
-is_backend)):
+is_backend):
   self._func_dict[prefix][func].scrub = scrubbed_extra
   self._func_dict[prefix][func].args_and_sig = args_and_sig
-  continue
 else:
   # This means a previous RUN line produced a body for this function
   # that is different from the one produced by this current RUN line,
   # so the body can't be common a

[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-19 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson accepted this revision.
arichardson added inline comments.
This revision is now accepted and ready to land.



Comment at: 
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll:2
 ; Check that we accept functions with '$' in the name.
 ; TODO: This is not handled correcly on 32bit ARM and needs to be fixed.
 

Remove this TODO?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130089/new/

https://reviews.llvm.org/D130089

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D130089: update-test-checks: safely handle tests with #if's

2022-07-19 Thread Nicolai Hähnle via Phabricator via cfe-commits
nhaehnle created this revision.
nhaehnle added reviewers: MaskRay, arsenm, aemerson, arichardson.
Herald added subscribers: StephenFan, kristof.beyls.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added subscribers: cfe-commits, wdng.
Herald added projects: clang, LLVM.

There is at least one Clang test (clang/test/CodeGen/arm_acle.c) which
has functions guarded by #if's that cause those functions to be compiled
only for a subset of RUN lines.

This results in a case where one RUN line has a body for the function
and another doesn't. Treat this case as a conflict for any prefixes that
the two RUN lines have in common.

This change exposed a bug where functions with '$' in the name weren't
properly recognized in ARM assembly (despite there being a test case
that was supposed to catch the problem!). This bug is fixed as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130089

Files:
  clang/test/utils/update_cc_test_checks/Inputs/ifdef.c
  clang/test/utils/update_cc_test_checks/Inputs/ifdef.c.expected
  clang/test/utils/update_cc_test_checks/ifdef.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected
  llvm/utils/UpdateTestChecks/asm.py
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_analyze_test_checks.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_llc_test_checks.py
  llvm/utils/update_test_checks.py

Index: llvm/utils/update_test_checks.py
===
--- llvm/utils/update_test_checks.py
+++ llvm/utils/update_test_checks.py
@@ -120,6 +120,7 @@
verbose=ti.args.verbose)
   builder.process_run_line(common.OPT_FUNCTION_RE, common.scrub_body,
   raw_tool_output, prefixes, False)
+  builder.processed_prefixes(prefixes)
 
 func_dict = builder.finish_and_get_func_dict()
 is_in_function = False
Index: llvm/utils/update_llc_test_checks.py
===
--- llvm/utils/update_llc_test_checks.py
+++ llvm/utils/update_llc_test_checks.py
@@ -137,6 +137,7 @@
 
   scrubber, function_re = output_type.get_run_handler(triple)
   builder.process_run_line(function_re, scrubber, raw_tool_output, prefixes, True)
+  builder.processed_prefixes(prefixes)
 
 func_dict = builder.finish_and_get_func_dict()
 global_vars_seen_dict = {}
Index: llvm/utils/update_cc_test_checks.py
===
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -214,6 +214,7 @@
 builder.process_run_line(
 common.OPT_FUNCTION_RE, common.scrub_body, raw_tool_output,
 prefixes, False)
+builder.processed_prefixes(prefixes)
   else:
 print('The clang command line should include -emit-llvm as asm tests '
   'are discouraged in Clang testsuite.', file=sys.stderr)
Index: llvm/utils/update_analyze_test_checks.py
===
--- llvm/utils/update_analyze_test_checks.py
+++ llvm/utils/update_analyze_test_checks.py
@@ -124,6 +124,8 @@
 common.warn('Don\'t know how to deal with this output')
 continue
 
+  builder.processed_prefixes(prefixes)
+
 func_dict = builder.finish_and_get_func_dict()
 is_in_function = False
 is_in_function_start = False
Index: llvm/utils/UpdateTestChecks/common.py
===
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -496,6 +496,7 @@
 self._func_dict = {}
 self._func_order = {}
 self._global_var_dict = {}
+self._processed_prefixes = set()
 for tuple in run_list:
   for prefix in tuple[0]:
 self._func_dict.update({prefix:dict()})
@@ -584,30 +585,43 @@
scrubbed_body)
 
 if func in self._func_dict[prefix]:
-  if (self._func_dict[prefix][func] is None or
-  str(self._func_dict[prefix][func]) != scrubbed_body or
-  self._func_dict[prefix][func].args_and_sig != args_and_sig or
-  self._func_dict[prefix][func].attrs != attrs):
-if (self._func_dict[prefix][func] is not None and
-self._func_dict[prefix][func].is_same_except_arg_names(
+  if (self._func_dict[prefix][func] is not None and
+  (str(self._func_dict[prefix][func]) != scrubbed_body or
+   self._func_dict[prefix][func].args_and_sig != args_and_sig or
+   self._func_dict[prefix][func].attrs != attrs)):
+if self._func_dict[prefix][func].is_same_except_arg_names(
 scrubbed_extra,
 args_and_sig,
 attrs,
-is