aboutsummaryrefslogtreecommitdiffstats
path: root/utils/profile.pl
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-29 21:51:00 +0000
committerChris Lattner <sabre@nondot.org>2003-10-29 21:51:00 +0000
commit0faadf2e589b7bbeb740899429a659f576f29683 (patch)
treea98d585a4340e01bf60e79b50a527771d033fa92 /utils/profile.pl
parent750ba3d6eb1144caa3ba2bec1de3a1a4c9b970eb (diff)
downloadexternal_llvm-0faadf2e589b7bbeb740899429a659f576f29683.zip
external_llvm-0faadf2e589b7bbeb740899429a659f576f29683.tar.gz
external_llvm-0faadf2e589b7bbeb740899429a659f576f29683.tar.bz2
Pass unrecognized options into llvmprof
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9596 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/profile.pl')
-rwxr-xr-xutils/profile.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/profile.pl b/utils/profile.pl
index c91ac1a..d7c7ef3 100755
--- a/utils/profile.pl
+++ b/utils/profile.pl
@@ -10,9 +10,13 @@
# OPTIONS may include one or more of the following:
# -block - Enable basic block level profiling
#
+# Any unrecognized options are passed into the invocation of llvm-prof
+#
my $ProfilePass = "-insert-function-profiling";
+my $LLVMProfOpts = "";
+
# Parse arguments...
while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
shift;
@@ -21,7 +25,8 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
# List command line options here...
if (/^-block$/) { $ProfilePass = "-insert-block-profiling"; next; }
- print "Unknown option: $_ : ignoring!\n";
+ # Otherwise, pass the option on to llvm-prof
+ $LLVMProfOpts .= " " . $_;
}
die "Must specify LLVM bytecode file as first argument!" if (@ARGV == 0);
@@ -39,4 +44,4 @@ my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so";
system "opt $ProfilePass < $BytecodeFile | lli -fake-argv0 '$BytecodeFile'" .
" -load $LibProfPath - " . (join ' ', @ARGV);
-system "llvm-prof $BytecodeFile";
+system "llvm-prof $LLVMProfOpts $BytecodeFile";