如果我使用clang 5.0.0编译,并向它传递-fprofile-instr-generate和-fcoverage-mapping标志,它确实可以工作,并且运行编译后的测试会导致它输出一个.profraw文件,我可以使用llvm-cov处理它,并将其转换为覆盖报告。然而,它似乎跟踪的唯一覆盖范围是测试工具和通过#include直接包含的任何代码,完全忽略了链接的代码。例如,如...
I can't seem to control the generation of this flag. I tried turning off the Profile switch in the Scheme editor for the driver, but is makes no difference. When I directly build the driver target, no-fprofile-instr-generateis set and it compiles and links. When i build the driver a...
}+if (const auto *A = Args.getLastArg(options::OPT_fprofile_continuous)) {+if (!PGOGenerateArg && !CSPGOGenerateArg && !ProfileGenerateArg)+D.Diag(clang::diag::err_drv_argument_only_allowed_with)+<< A->getSpelling()+<< "-fprofile-generate, -fprofile-instr-generate, or "+"-fcs...
解决方案1: 已经解决,Other Linker Flags中添加-fprofile-instr-generate就可以了。
+ ``-fprofile-instr-generate``. When given a directory name, it generates the + profile file ``default.profraw`` in the directory named ``dirname``. If + ``dirname`` does not exist, it will be created at runtime. The environment ...
>> variants. As is, it isn't last wins - it uses -fprofile-instr-generate=, >> and if there isn't one of those then it uses -fprofile-generate=, etc. > > I'm a goof. I was convinced I had done this before sending the patch. ...
这些文件包含可用于执行基于配置文件的优化的分支结果,如下所示: gcc-fprofile-usemain.cpp Run Code Online (Sandbox Code Playgroud) Clang 中是否有我忽略的类似功能? 谢谢! 5 和,-fprofile-instr-use其含义几乎相同。