[Utils] Allow update_test_checks to check function information

Summary:
This adds a switch to the update_test_checks that triggers arguments and
other function annotations, e.g., personality, to be present in the
check line. If not set, the behavior should be the same as before.
If arguments are recorded, their names are scrubbed from the IR to allow
merging.

This patch includes D68153.

Reviewers: lebedev.ri, greened, spatel, xbolva00, RKSimon, mehdi_amini

Subscribers: bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68819
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index ec02602..6cb302b 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -66,6 +66,8 @@
                       help='Only update test if it was already autogened')
   parser.add_argument('-p', '--preserve-names', action='store_true',
                       help='Do not scrub IR names')
+  parser.add_argument('--function-signature', action='store_true',
+                      help='Keep function signature information around for the check line')
   parser.add_argument('tests', nargs='+')
   args = parser.parse_args()
 
@@ -155,7 +157,8 @@
       raw_tool_output = common.invoke_tool(args.opt_binary, opt_args, test)
       common.build_function_body_dictionary(
               common.OPT_FUNCTION_RE, common.scrub_body, [],
-              raw_tool_output, prefixes, func_dict, args.verbose)
+              raw_tool_output, prefixes, func_dict, args.verbose,
+              args.function_signature)
 
     is_in_function = False
     is_in_function_start = False