[PATCH] D90345: [DebugInfo] Fix ICE in DwarfCompileUnit::constructSubprogramScopeDIE

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 10:29:02 PDT 2021


scott.linder requested review of this revision.
scott.linder added a comment.

I also ended up writing a script to make updating the tests easier and I'm wondering if anyone sees merit in putting it in `llvm/utils`. It (crudely) inserts MDNodes at given indices in IR, updating all references to the old IDs:

  #!/usr/bin/perl
  use strict;
  use warnings;
  
  # Make room in LLVM IR for new MDNode IDs by incrementing references to MDNode
  # IDs in stdin, writing the result to stdout. The list of new MDNode IDs is
  # read from argv, one ID per argument.
  #
  # Note: Just uses a regex which matches on an exclamation point followed by a
  # sequence of digits. This may be incorrect in some cases, so always make sure
  # the result looks how you intend.
  
  my @ids = sort grep /^\d+$/, @ARGV;
  
  while (<STDIN>) {
      foreach my $id (@ids) {
          print "!$id = \n" if /^!$id = /;
          s/!(\d+)/if ($1 < $id) {"!" . $1} else {"!" . ($1 + 1)}/eg;
      }
      print;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90345



More information about the llvm-commits mailing list