Skip to content
Snippets Groups Projects
Commit 19a70510 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

plugin: record hits and misses to logfile

parent 02d86d3e
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <utime.h> #include <utime.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h>
using namespace clang; using namespace clang;
...@@ -48,6 +50,15 @@ static void link_object_file() { ...@@ -48,6 +50,15 @@ static void link_object_file() {
dst = objectfile_copy; dst = objectfile_copy;
} }
// Record Events
if (getenv("CLANG_HASH_LOGFILE")) {
int fd = open(getenv("CLANG_HASH_LOGFILE"),
O_APPEND | O_WRONLY | O_CREAT,
0644);
write(fd, atexit_mode == ATEXIT_FROM_CACHE ? "H" : "M", 1);
close(fd);
}
/* If destination exists, we have to unlink it. */ /* If destination exists, we have to unlink it. */
struct stat dummy; struct stat dummy;
if (stat(dst, &dummy) == 0) { // exists if (stat(dst, &dummy) == 0) { // exists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment