InstrProf: Pull in runtime on non-Darwin

r204379 changed the way the profile runtime gets pulled in, but missed
updating non-Darwin targets.

llvm-svn: 204939
This commit is contained in:
Duncan P. N. Exon Smith 2014-03-27 16:20:02 +00:00
parent abfa261a63
commit a19ffae1b0
1 changed files with 7 additions and 0 deletions

View File

@ -1807,6 +1807,13 @@ static void addProfileRT(
Args.hasArg(options::OPT_coverage)))
return;
// Pull in runtime for -fprofile-inst-generate. This is required since there
// are no calls to the runtime in the code.
if (Args.hasArg(options::OPT_fprofile_instr_generate)) {
CmdArgs.push_back("-u");
CmdArgs.push_back("___llvm_profile_runtime");
}
SmallString<128> LibProfile = getCompilerRTLibDir(TC);
llvm::sys::path::append(LibProfile,
Twine("libclang_rt.profile-") + getArchNameForCompilerRTLib(TC) + ".a");