| @@ -10,26 +10,30 @@ | | | @@ -10,26 +10,30 @@ |
10 | |* This file implements the call back routines for the gcov profiling | | 10 | |* This file implements the call back routines for the gcov profiling |
11 | |* instrumentation pass. Link against this library when running code through | | 11 | |* instrumentation pass. Link against this library when running code through |
12 | |* the -insert-gcov-profiling LLVM pass. | | 12 | |* the -insert-gcov-profiling LLVM pass. |
13 | |* | | 13 | |* |
14 | |* We emit files in a corrupt version of GCOV's "gcda" file format. These files | | 14 | |* We emit files in a corrupt version of GCOV's "gcda" file format. These files |
15 | |* are only close enough that LCOV will happily parse them. Anything that lcov | | 15 | |* are only close enough that LCOV will happily parse them. Anything that lcov |
16 | |* ignores is missing. | | 16 | |* ignores is missing. |
17 | |* | | 17 | |* |
18 | |* TODO: gcov is multi-process safe by having each exit open the existing file | | 18 | |* TODO: gcov is multi-process safe by having each exit open the existing file |
19 | |* and append to it. We'd like to achieve that and be thread-safe too. | | 19 | |* and append to it. We'd like to achieve that and be thread-safe too. |
20 | |* | | 20 | |* |
21 | \*===----------------------------------------------------------------------===*/ | | 21 | \*===----------------------------------------------------------------------===*/ |
22 | | | 22 | |
| | | 23 | #ifdef _LIBC |
| | | 24 | #include "namespace.h" |
| | | 25 | #endif |
| | | 26 | |
23 | #include "InstrProfilingUtil.h" | | 27 | #include "InstrProfilingUtil.h" |
24 | | | 28 | |
25 | #include <errno.h> | | 29 | #include <errno.h> |
26 | #include <fcntl.h> | | 30 | #include <fcntl.h> |
27 | #include <stdio.h> | | 31 | #include <stdio.h> |
28 | #include <stdlib.h> | | 32 | #include <stdlib.h> |
29 | #include <string.h> | | 33 | #include <string.h> |
30 | | | 34 | |
31 | #if defined(_WIN32) | | 35 | #if defined(_WIN32) |
32 | #include "WindowsMMap.h" | | 36 | #include "WindowsMMap.h" |
33 | #else | | 37 | #else |
34 | #include <sys/mman.h> | | 38 | #include <sys/mman.h> |
35 | #include <sys/file.h> | | 39 | #include <sys/file.h> |