Skip to content

Commit

Permalink
[Docs] Remove old HTML related comment from Passes documentation
Browse files Browse the repository at this point in the history
This patch removes a comment at the top of the Passes.rst file which was
related to checking if the HTML documentation was up to date. It was
moved over as part of the original transition to restructured text and
never modified for some reason. Given that this comment has been
irrelevant for the past 10 years, it should be removed.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D157644
  • Loading branch information
boomanaiden154 committed Aug 10, 2023
1 parent f8a1913 commit b2c292c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions llvm/docs/Passes.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
..
If Passes.html is up to date, the following "one-liner" should print
an empty diff.
egrep -e '^<tr><td><a href="#.*">-.*</a></td><td>.*</td></tr>$' \
-e '^ <a name=".*">.*</a>$' < Passes.html >html; \
perl >help <<'EOT' && diff -u help html; rm -f help html
open HTML, "<Passes.html" or die "open: Passes.html: $!\n";
while (<HTML>) {
m:^<tr><td><a href="#(.*)">-.*</a></td><td>.*</td></tr>$: or next;
$order{$1} = sprintf("%03d", 1 + int %order);
}
open HELP, "../Release/bin/opt -help|" or die "open: opt -help: $!\n";
while (<HELP>) {
m:^ -([^ ]+) +- (.*)$: or next;
my $o = $order{$1};
$o = "000" unless defined $o;
push @x, "$o<tr><td><a href=\"#$1\">-$1</a></td><td>$2</td></tr>\n";
push @y, "$o <a name=\"$1\">-$1: $2</a>\n";
}
@x = map { s/^\d\d\d//; $_ } sort @x;
@y = map { s/^\d\d\d//; $_ } sort @y;
print @x, @y;
EOT

This (real) one-liner can also be helpful when converting comments to HTML:

perl -e '$/ = undef; for (split(/\n/, <>)) { s:^ *///? ?::; print " <p>\n" if !$on && $_ =~ /\S/; print " </p>\n" if $on && $_ =~ /^\s*$/; print " $_\n"; $on = ($_ =~ /\S/); } print " </p>\n" if $on'
====================================
LLVM's Analysis and Transform Passes
====================================
Expand Down

0 comments on commit b2c292c

Please sign in to comment.