r204939 - InstrProf: Pull in runtime on non-Darwin
Duncan P. N. Exon Smith
dexonsmith at apple.com
Thu Mar 27 09:20:02 PDT 2014
Author: dexonsmith
Date: Thu Mar 27 11:20:02 2014
New Revision: 204939
URL: http://llvm.org/viewvc/llvm-project?rev=204939&view=rev
Log:
InstrProf: Pull in runtime on non-Darwin
r204379 changed the way the profile runtime gets pulled in, but missed
updating non-Darwin targets.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=204939&r1=204938&r2=204939&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Mar 27 11:20:02 2014
@@ -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");
More information about the cfe-commits
mailing list