NNT: Add -nouname option, so machine uniquing can occur across physical machines.
[oota-llvm.git] / utils / profile.pl
index 20810fab9a0964f15e8ebf60272d4f15cdaed7d6..f9950f97fea82179c1e22a23b820db1ef18211ac 100755 (executable)
@@ -62,11 +62,10 @@ my $BytecodeFile = $ARGV[0];
 
 shift @ARGV;
 
-my $LLIPath = `which lli`;
-$LLIPath = `dirname $LLIPath`;
-chomp $LLIPath;
+my $libdir = `llvm-config --libdir`;
+chomp $libdir;
 
-my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so";
+my $LibProfPath = $libdir . "/profile_rt.so";
 
 system "opt -q -f $ProfilePass $BytecodeFile -o $BytecodeFile.inst";
 system "lli -fake-argv0 '$BytecodeFile' -load $LibProfPath " .