r204379 changed the way the profile runtime gets pulled in, but missed
updating non-Darwin targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204939
91177308-0d34-0410-b5e6-
96231b3b80d8
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");