annotate clang/test/make_test_dirs.pl @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 #!/usr/bin/env perl
150
anatofuz
parents:
diff changeset
2 #
anatofuz
parents:
diff changeset
3 # Simple little Perl script that takes the cxx-sections.data file as
anatofuz
parents:
diff changeset
4 # input and generates a directory structure that mimics the standard's
anatofuz
parents:
diff changeset
5 # structure.
anatofuz
parents:
diff changeset
6 use English;
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 use warnings;
150
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 $current_indent_level = -4;
anatofuz
parents:
diff changeset
10 while ($line = <STDIN>) {
anatofuz
parents:
diff changeset
11 $line =~ /^\s*/;
anatofuz
parents:
diff changeset
12 $next_indent_level = length($MATCH);
anatofuz
parents:
diff changeset
13 if ($line =~ /\[([^\]]*)\]/) {
anatofuz
parents:
diff changeset
14 my $section = $1;
anatofuz
parents:
diff changeset
15 while ($next_indent_level < $current_indent_level) {
anatofuz
parents:
diff changeset
16 chdir("..");
anatofuz
parents:
diff changeset
17 $current_indent_level -= 4;
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 if ($next_indent_level == $current_indent_level) {
anatofuz
parents:
diff changeset
21 chdir("..");
anatofuz
parents:
diff changeset
22 } else {
anatofuz
parents:
diff changeset
23 $current_indent_level = $next_indent_level;
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25 mkdir($section);
anatofuz
parents:
diff changeset
26 chdir($section);
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28 }