[UpdateTestChecks] Moved core functionality of add_asm_checks into add_checks

As discussed on D45272

llvm-svn: 329270
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index aa7e245..0e93b19 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -218,26 +218,4 @@
 def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, func_name):
   # Label format is based on ASM string.
   check_label_format = '{} %s-LABEL: %s:'.format(comment_marker)
-
-  printed_prefixes = []
-  for p in prefix_list:
-    checkprefixes = p[0]
-    for checkprefix in checkprefixes:
-      if checkprefix in printed_prefixes:
-        break
-      # TODO func_dict[checkprefix] may be None, '' or not exist.
-      # Fix the call sites.
-      if func_name not in func_dict[checkprefix] or not func_dict[checkprefix][func_name]:
-        continue
-      # Add some space between different check prefixes.
-      if len(printed_prefixes) != 0:
-        output_lines.append(comment_marker)
-      printed_prefixes.append(checkprefix)
-      output_lines.append(check_label_format % (checkprefix, func_name))
-      func_body = func_dict[checkprefix][func_name].splitlines()
-
-      output_lines.append('%s %s:       %s' % (comment_marker, checkprefix, func_body[0]))
-      for func_line in func_body[1:]:
-        output_lines.append('%s %s-NEXT:  %s' % (comment_marker, checkprefix, func_line))
-
-      break
+  common.add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, check_label_format, True)