[polly] a54f160 - Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk
Raphael Isemann via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 02:32:50 PST 2021
Author: Harmen Stoppels
Date: 2021-02-25T11:32:27+01:00
New Revision: a54f160b3a98b91cd241a555d904a6b6453affc4
URL: https://github.com/llvm/llvm-project/commit/a54f160b3a98b91cd241a555d904a6b6453affc4
DIFF: https://github.com/llvm/llvm-project/commit/a54f160b3a98b91cd241a555d904a6b6453affc4.diff
LOG: Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk
Allow users to use a non-system version of perl, python and awk, which is useful
in certain package managers.
Reviewed By: JDevlieghere, MaskRay
Differential Revision: https://reviews.llvm.org/D95119
Added:
Modified:
clang/test/make_test_dirs.pl
clang/tools/scan-build/bin/set-xcode-analyzer
clang/utils/TestUtils/pch-test.pl
clang/utils/analyzer/reducer.pl
clang/utils/analyzer/update_plist_test.pl
clang/www/demo/index.cgi
debuginfo-tests/llgdb-tests/test_debuginfo.pl
lldb/docs/use/python-reference.rst
lldb/scripts/disasm-gdb-remote.pl
llvm/utils/GenLibDeps.pl
llvm/utils/codegen-diff
llvm/utils/findsym.pl
llvm/utils/llvm-compilers-check
llvm/utils/llvm-native-gxx
openmp/runtime/tools/check-execstack.pl
openmp/runtime/tools/check-instruction-set.pl
openmp/runtime/tools/message-converter.pl
polly/lib/External/isl/doc/mypod2latex
Removed:
################################################################################
diff --git a/clang/test/make_test_dirs.pl b/clang/test/make_test_dirs.pl
index 3a524d2adb1b..c2af9c485f93 100755
--- a/clang/test/make_test_dirs.pl
+++ b/clang/test/make_test_dirs.pl
@@ -1,9 +1,10 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# Simple little Perl script that takes the cxx-sections.data file as
# input and generates a directory structure that mimics the standard's
# structure.
use English;
+use warnings;
$current_indent_level = -4;
while ($line = <STDIN>) {
diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer b/clang/tools/scan-build/bin/set-xcode-analyzer
index 9faaec1e8e6e..f8c3f775ef7d 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# [PR 11661] Note that we hardwire to /usr/bin/python because we
# want to the use the system version of Python on Mac OS X.
diff --git a/clang/utils/TestUtils/pch-test.pl b/clang/utils/TestUtils/pch-test.pl
index e4311e965bb7..cff8255b85a3 100755
--- a/clang/utils/TestUtils/pch-test.pl
+++ b/clang/utils/TestUtils/pch-test.pl
@@ -1,10 +1,11 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# This tiny little script, which should be run from the clang
# directory (with clang in your patch), tries to take each
# compilable Clang test and build a PCH file from that test, then read
# and dump the contents of the PCH file just created.
use POSIX;
+use warnings;
$exitcode = 0;
sub testfiles($$) {
diff --git a/clang/utils/analyzer/reducer.pl b/clang/utils/analyzer/reducer.pl
index 872f61b33a77..75c0bf6ce7a6 100755
--- a/clang/utils/analyzer/reducer.pl
+++ b/clang/utils/analyzer/reducer.pl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use File::Temp qw/ tempdir /;
my $prog = "reducer";
@@ -31,8 +32,9 @@
my $commandStr = "@$command";
print OUT <<ENDTEXT;
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
my \$BAD = 1;
my \$GOOD = 0;
`rm -f $reduceOut`;
diff --git a/clang/utils/analyzer/update_plist_test.pl b/clang/utils/analyzer/update_plist_test.pl
index abb74a57c3c1..e142c477d57a 100755
--- a/clang/utils/analyzer/update_plist_test.pl
+++ b/clang/utils/analyzer/update_plist_test.pl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
require File::Temp;
use File::Temp ();
diff --git a/clang/www/demo/index.cgi b/clang/www/demo/index.cgi
index 8ea9cc7196af..0fded355b67c 100644
--- a/clang/www/demo/index.cgi
+++ b/clang/www/demo/index.cgi
@@ -1,4 +1,4 @@
-#!/usr/dcs/software/supported/bin/perl -w
+#!/usr/dcs/software/supported/bin/perl
# LLVM Web Demo script
#
@@ -6,6 +6,7 @@ use strict;
use CGI;
use POSIX;
use Mail::Send;
+use warnings;
$| = 1;
diff --git a/debuginfo-tests/llgdb-tests/test_debuginfo.pl b/debuginfo-tests/llgdb-tests/test_debuginfo.pl
index e4c2a5ea24c1..23d2304be7aa 100755
--- a/debuginfo-tests/llgdb-tests/test_debuginfo.pl
+++ b/debuginfo-tests/llgdb-tests/test_debuginfo.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# This script tests debugging information generated by a compiler.
# Input arguments
diff --git a/lldb/docs/use/python-reference.rst b/lldb/docs/use/python-reference.rst
index a1bdc87ab912..85a7b152f8aa 100644
--- a/lldb/docs/use/python-reference.rst
+++ b/lldb/docs/use/python-reference.rst
@@ -607,7 +607,7 @@ a function that can be used by LLDB's python command code:
::
- #!/usr/bin/python
+ #!/usr/bin/env python
import lldb
import commands
@@ -715,7 +715,7 @@ print the process, thread and frame objects if the process stopped:
::
- #!/usr/bin/python
+ #!/usr/bin/env python
import lldb
import os
diff --git a/lldb/scripts/disasm-gdb-remote.pl b/lldb/scripts/disasm-gdb-remote.pl
index e4c7066ff21f..c0e7665cc726 100755
--- a/lldb/scripts/disasm-gdb-remote.pl
+++ b/lldb/scripts/disasm-gdb-remote.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/llvm/utils/GenLibDeps.pl b/llvm/utils/GenLibDeps.pl
index 42afa6a11fc0..e283465cedad 100755
--- a/llvm/utils/GenLibDeps.pl
+++ b/llvm/utils/GenLibDeps.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# Program: GenLibDeps.pl
#
diff --git a/llvm/utils/codegen-
diff b/llvm/utils/codegen-
diff
index 2c3ac4c6dfa8..16c6e956af52 100755
--- a/llvm/utils/codegen-
diff
+++ b/llvm/utils/codegen-
diff
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use Getopt::Std;
$DEBUG = 0;
diff --git a/llvm/utils/findsym.pl b/llvm/utils/findsym.pl
index 92346572fe01..f03e1231c256 100755
--- a/llvm/utils/findsym.pl
+++ b/llvm/utils/findsym.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# Program: findsym.pl
#
@@ -8,6 +8,8 @@
# Syntax: findsym.pl <directory_with_libraries_in_it> <symbol>
#
+use warnings;
+
# Give first option a name.
my $Directory = $ARGV[0];
my $Symbol = $ARGV[1];
diff --git a/llvm/utils/llvm-compilers-check b/llvm/utils/llvm-compilers-check
index 33331fd0b93b..3b132454d20b 100755
--- a/llvm/utils/llvm-compilers-check
+++ b/llvm/utils/llvm-compilers-check
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
##===- utils/llvmbuild - Build the LLVM project ----------------*-python-*-===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/llvm/utils/llvm-native-gxx b/llvm/utils/llvm-native-gxx
index db547f654e2f..3c8a703b5b63 100755
--- a/llvm/utils/llvm-native-gxx
+++ b/llvm/utils/llvm-native-gxx
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
# Wrapper around LLVM tools to generate a native .o from llvm-gxx using an
# LLVM back-end (CBE by default).
diff --git a/openmp/runtime/tools/check-execstack.pl b/openmp/runtime/tools/check-execstack.pl
index e4a8e7c883ab..7a710072f972 100755
--- a/openmp/runtime/tools/check-execstack.pl
+++ b/openmp/runtime/tools/check-execstack.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
#//===----------------------------------------------------------------------===//
diff --git a/openmp/runtime/tools/check-instruction-set.pl b/openmp/runtime/tools/check-instruction-set.pl
index 65c315d59236..6edfb55e99ff 100755
--- a/openmp/runtime/tools/check-instruction-set.pl
+++ b/openmp/runtime/tools/check-instruction-set.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
#//===----------------------------------------------------------------------===//
diff --git a/openmp/runtime/tools/message-converter.pl b/openmp/runtime/tools/message-converter.pl
index b3efb706e59b..22b87c043f78 100755
--- a/openmp/runtime/tools/message-converter.pl
+++ b/openmp/runtime/tools/message-converter.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
#//===----------------------------------------------------------------------===//
diff --git a/polly/lib/External/isl/doc/mypod2latex b/polly/lib/External/isl/doc/mypod2latex
index b11c0593d015..4583bd772d26 100755
--- a/polly/lib/External/isl/doc/mypod2latex
+++ b/polly/lib/External/isl/doc/mypod2latex
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
use Pod::LaTeX;
More information about the llvm-commits
mailing list