Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Dietrich
clang-hash
Commits
19a70510
Commit
19a70510
authored
Jan 30, 2017
by
Christian Dietrich
Browse files
plugin: record hits and misses to logfile
parent
02d86d3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/clang-hash.cc
View file @
19a70510
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment