[PATCH] D53593: [GCOV] Flush counters before to avoid counting the execution before fork twice and for exec** functions we must flush before the call

Marco Castelluccio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 01:37:45 PST 2018


marco-c added inline comments.


================
Comment at: include/llvm/Analysis/TargetLibraryInfo.def:588
+TLI_DEFINE_ENUM_INTERNAL(execvpe)
+TLI_DEFINE_STRING_INTERNAL("execvpe")
 /// double exp(double x);
----------------
There's also execve.


================
Comment at: lib/Transforms/Instrumentation/GCOVProfiling.cpp:473
 
+#if !(defined(_WIN32))
+  AddFlushBeforeForkAndExec();
----------------
We should do the flushing before fork/exec when we are cross-compiling from Windows to a target that supports fork/exec.
We have two options:
1) Instead of using _WIN32, check that the target of the compilation isn't Windows;
2) Just add the flush always, as it's effect is not important if we are on Windows and the function is defined by a user.


Repository:
  rL LLVM

https://reviews.llvm.org/D53593





More information about the llvm-commits mailing list