[PATCH] D27765: Renumber testcase metadata nodes after D26769. [NFC]

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 10:39:59 PST 2016


aprantl created this revision.
aprantl added a reviewer: dblaikie.
aprantl added a subscriber: llvm-commits.
Herald added subscribers: nemanjai, mehdi_amini, dschuff, sanjoy, jfb.

This patch renumbers the metadata nodes in debug info testcases after https://reviews.llvm.org/D26769. This is a separate patch because it causes so much churn. This was implemented with a python script that pipes the testcases through  `llvm-as - | llvm-dis -` and then goes through the original and new output side-by side to insert all comments at a close-enough location.

Here's the script for reference:

  import re, sys, subprocess
  fn = sys.argv[1]
  stdout = subprocess.check_output('llvm-as %s -o - | llvm-dis -o -' % fn, shell=True)
  new = stdout.split('\n')
  
  out = []
  comment = re.compile(r'^([^;]*)(;.*)$')
  ws = re.compile(r'^ *$')
  empty = re.compile(r'^ *\n$')
  for line in open(fn):
      if new and new[0].startswith('; ModuleID ='):
          new = new[1:]
      # If there was a comment on this line, carry it over.
      m = comment.match(line)
      if m:
          if ws.match(m.group(1)):
              if m.group(2).startswith('; Function Attrs'):
                  continue
              out.append(line)
          else:
              cmnt = m.group(2)
              if cmnt.startswith('; preds =') or cmnt.count(r'#uses='):
                  cmnt = ''
              out.append(new[0]+' '+cmnt+'\n')
              new = new[1:]
      else:
          if empty.match(line):
              if out[-1] <> '\n':
                  out.append('\n')
              continue
          # Try to sync the original and the new output again by comparing the
          # first couple of characters.
          if new:
              if new[0] == '' and out and out[-1] == '\n':
                  new = new[1:]
                  continue
              out.append(new[0]+'\n')
              new = new[1:]
          if len(new) > 2 and new[2][:8] == line[:8]:
              out.append(new[0]+'\n')
              new = new[1:]
          if len(new) > 1 and new[1][:8] == line[:8]:
              out.append(new[0]+'\n')
              new = new[1:]
          if len(new) > 0 and new[0][:8] == line[:8]:
              out.append(new[0]+'\n')
              new = new[1:]
          
  f = open(fn, 'w')
  f.write(''.join(out+new)+'\n')


https://reviews.llvm.org/D27765

Files:
  test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll
  test/CodeGen/ARM/2010-06-25-Thumb2ITInvalidIterator.ll
  test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
  test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
  test/CodeGen/ARM/coalesce-dbgvalue.ll
  test/CodeGen/BPF/dwarfdump.ll
  test/CodeGen/PowerPC/pr17168.ll
  test/CodeGen/WebAssembly/dbgvalue.ll
  test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
  test/CodeGen/X86/fp128-g.ll
  test/CodeGen/X86/fpstack-debuginstr-kill.ll
  test/CodeGen/X86/misched-code-difference-with-debug.ll
  test/CodeGen/X86/null-streamer.ll
  test/DebugInfo/AArch64/big-endian.ll
  test/DebugInfo/AArch64/bitfields.ll
  test/DebugInfo/AArch64/frameindices.ll
  test/DebugInfo/ARM/big-endian-bitfield.ll
  test/DebugInfo/ARM/bitfield.ll
  test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll
  test/DebugInfo/ARM/tls.ll
  test/DebugInfo/COFF/anonymous-struct.ll
  test/DebugInfo/COFF/big-type.ll
  test/DebugInfo/COFF/bitfields.ll
  test/DebugInfo/COFF/enum.ll
  test/DebugInfo/COFF/global-dllimport.ll
  test/DebugInfo/COFF/globals-discarded.ll
  test/DebugInfo/COFF/globals.ll
  test/DebugInfo/COFF/inheritance.ll
  test/DebugInfo/COFF/inlining-files.ll
  test/DebugInfo/COFF/inlining-header.ll
  test/DebugInfo/COFF/inlining-levels.ll
  test/DebugInfo/COFF/int8-char-type.ll
  test/DebugInfo/COFF/long-type-name.ll
  test/DebugInfo/COFF/register-variables.ll
  test/DebugInfo/COFF/scopes.ll
  test/DebugInfo/COFF/types-array-advanced.ll
  test/DebugInfo/COFF/types-nested-class.ll
  test/DebugInfo/COFF/types-ptr-to-member.ll
  test/DebugInfo/COFF/udts.ll
  test/DebugInfo/COFF/virtual-method-kinds.ll
  test/DebugInfo/COFF/vtable-optzn-array.ll
  test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll
  test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll
  test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
  test/DebugInfo/Generic/accel-table-hash-collisions.ll
  test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
  test/DebugInfo/Generic/cross-cu-linkonce.ll
  test/DebugInfo/Generic/dbg-at-specficiation.ll
  test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll
  test/DebugInfo/Generic/dwarf-public-names.ll
  test/DebugInfo/Generic/enum.ll
  test/DebugInfo/Generic/global.ll
  test/DebugInfo/Generic/gvn.ll
  test/DebugInfo/Generic/member-pointers.ll
  test/DebugInfo/Generic/recursive_inlining.ll
  test/DebugInfo/Generic/template-recursive-void.ll
  test/DebugInfo/Generic/tu-member-pointer.ll
  test/DebugInfo/Generic/typedef.ll
  test/DebugInfo/Mips/InlinedFnLocalVar.ll
  test/DebugInfo/PowerPC/tls-fission.ll
  test/DebugInfo/PowerPC/tls.ll
  test/DebugInfo/WebAssembly/dbg-declare.ll
  test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
  test/DebugInfo/X86/DIModuleContext.ll
  test/DebugInfo/X86/DW_AT_calling-convention.ll
  test/DebugInfo/X86/DW_AT_specification.ll
  test/DebugInfo/X86/DW_TAG_friend.ll
  test/DebugInfo/X86/InlinedFnLocalVar.ll
  test/DebugInfo/X86/PR26148.ll
  test/DebugInfo/X86/align_c11.ll
  test/DebugInfo/X86/align_cpp11.ll
  test/DebugInfo/X86/align_objc.ll
  test/DebugInfo/X86/arange-and-stub.ll
  test/DebugInfo/X86/arange.ll
  test/DebugInfo/X86/atomic-c11-dwarf-4.ll
  test/DebugInfo/X86/atomic-c11-dwarf-5.ll
  test/DebugInfo/X86/bitfields-dwarf4.ll
  test/DebugInfo/X86/bitfields.ll
  test/DebugInfo/X86/c-type-units.ll
  test/DebugInfo/X86/concrete_out_of_line.ll
  test/DebugInfo/X86/cu-ranges-odr.ll
  test/DebugInfo/X86/data_member_location.ll
  test/DebugInfo/X86/dbg-subrange.ll
  test/DebugInfo/X86/dbg-value-inlined-parameter.ll
  test/DebugInfo/X86/dbg-value-regmask-clobber.ll
  test/DebugInfo/X86/debug-info-access.ll
  test/DebugInfo/X86/debug-info-packed-struct.ll
  test/DebugInfo/X86/debug-info-static-member.ll
  test/DebugInfo/X86/debug-loc-frame.ll
  test/DebugInfo/X86/debugger-tune.ll
  test/DebugInfo/X86/decl-derived-member.ll
  test/DebugInfo/X86/dllimport.ll
  test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
  test/DebugInfo/X86/dwarf-aranges.ll
  test/DebugInfo/X86/dwarf-linkage-names.ll
  test/DebugInfo/X86/dwarf-public-names.ll
  test/DebugInfo/X86/empty-array.ll
  test/DebugInfo/X86/enum-class.ll
  test/DebugInfo/X86/enum-fwd-decl.ll
  test/DebugInfo/X86/externaltyperef.ll
  test/DebugInfo/X86/fission-cu.ll
  test/DebugInfo/X86/generate-odr-hash.ll
  test/DebugInfo/X86/gnu-public-names.ll
  test/DebugInfo/X86/inline-member-function.ll
  test/DebugInfo/X86/inline-namespace.ll
  test/DebugInfo/X86/inlined-indirect-value.ll
  test/DebugInfo/X86/isel-cse-line.ll
  test/DebugInfo/X86/linkage-name.ll
  test/DebugInfo/X86/live-debug-values.ll
  test/DebugInfo/X86/memberfnptr.ll
  test/DebugInfo/X86/misched-dbg-value.ll
  test/DebugInfo/X86/multiple-aranges.ll
  test/DebugInfo/X86/nondefault-subrange-array.ll
  test/DebugInfo/X86/objc-fwd-decl.ll
  test/DebugInfo/X86/pointer-type-size.ll
  test/DebugInfo/X86/ref_addr_relocation.ll
  test/DebugInfo/X86/static_member_array.ll
  test/DebugInfo/X86/stringpool.ll
  test/DebugInfo/X86/struct-loc.ll
  test/DebugInfo/X86/template.ll
  test/DebugInfo/X86/tls.ll
  test/DebugInfo/X86/type_units_with_addresses.ll
  test/DebugInfo/X86/union-template.ll
  test/DebugInfo/X86/vector.ll
  test/Instrumentation/AddressSanitizer/debug-info-global-var.ll
  test/LTO/X86/Inputs/type-mapping-src.ll
  test/LTO/X86/type-mapping-bug.ll
  test/Linker/2011-08-04-Metadata.ll
  test/Linker/2011-08-04-Metadata2.ll
  test/Linker/odr.ll
  test/Linker/only-needed-debug-metadata.ll
  test/ThinLTO/X86/Inputs/crash_debuginfo.ll
  test/ThinLTO/X86/crash_debuginfo.ll
  test/ThinLTO/X86/debuginfo-cu-import.ll
  test/Transforms/GlobalMerge/debug-info.ll
  test/Transforms/GlobalOpt/2009-03-05-dbg.ll
  test/Transforms/Inline/alloca-dbgdeclare.ll
  test/Transforms/LoopVectorize/dbg.value.ll
  test/Transforms/SampleProfile/cov-zero-samples.ll
  test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll
  test/Transforms/StripSymbols/2010-08-25-crash.ll
  test/Transforms/StripSymbols/strip-dead-debug-info.ll
  test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27765.81417.patch
Type: text/x-patch
Size: 2269104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161214/e05645c4/attachment-0001.bin>


More information about the llvm-commits mailing list