Commit 19a70510 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

plugin: record hits and misses to logfile

parent 02d86d3e
......@@ -10,6 +10,8 @@
#include <utime.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
using namespace clang;
......@@ -48,6 +50,15 @@ static void link_object_file() {
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. */
struct stat dummy;
if (stat(dst, &dummy) == 0) { // exists
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment