+ if (/^-?-block$/) { $ProfilePass = "-insert-block-profiling"; next; }
+ if (/^-?-edge$/) { $ProfilePass = "-insert-edge-profiling"; next; }
+ if (/^-?-function$/) { $ProfilePass = "-insert-function-profiling"; next; }
+ if (/^-?-o$/) { # Read -o filename...
+ die "-o option requires a filename argument!" if (!scalar(@ARGV));
+ $ProgramOpts .= " -llvmprof-output $ARGV[0]";
+ $ProfileFile = $ARGV[0];
+ shift;
+ next;
+ }
+ if (/^-?-help$/) {
+ print "OVERVIEW: profile.pl - Instrumentation and profile printer.\n\n";
+ print "USAGE: profile.pl [options] program.bc <program args>\n\n";
+ print "OPTIONS:\n";
+ print " -block - Enable basicblock profiling\n";
+ print " -edge - Enable edge profiling\n";
+ print " -function - Enable function profiling\n";
+ print " -o <file> - Specify an output file other than llvm-prof.out.\n";
+ print " -help - Print this usage information\n";
+ print "\nAll other options are passed into llvm-prof.\n";
+ exit 1;
+ }