OLD | NEW |
1 Name: The LLVM/Clang compiler modified to intercept allocated type | 1 Name: The LLVM/Clang compiler modified to intercept allocated type |
2 Short Name: llvm-allocated-type | 2 Short Name: llvm-allocated-type |
3 URL: http://llvm.org/ | 3 URL: http://llvm.org/ |
4 Version: 0 | 4 Version: 0 |
5 Revision: 167488 | 5 Revision: 167488 |
6 License: University of Illinois Open Source License | 6 License: University of Illinois Open Source License |
7 License File: LICENSE.TXT | 7 License File: LICENSE.TXT |
8 Security Critical: no | 8 Security Critical: no |
9 | 9 |
10 Description: | 10 Description: |
11 LLVM is a compiler infrastructure. | 11 LLVM is a compiler infrastructure. |
12 Clang is a C, C++, Objective C and Objective C++ front-end for LLVM. | 12 Clang is a C, C++, Objective C and Objective C++ front-end for LLVM. |
13 | 13 |
14 Local Modifications: | 14 Local Modifications: |
15 This package consists of a locally modified version of Clang. It instruments | 15 This package consists of a locally modified version of Clang. It instruments |
16 code around 'new' and 'delete' expressions to skim allocated types and sizes. | 16 code around 'new' and 'delete' expressions to skim allocated types and sizes. |
17 | 17 |
18 The difference from the original Clang is in allocated-type.patch. | 18 The difference from the original Clang is in allocated-type.patch. |
19 | 19 |
20 Usage: | 20 Usage: |
21 The feature is enabled by a compiler option "-fintercept-allocation-function". | 21 The feature is enabled by a compiler option "-fintercept-allocation-function". |
22 With the option, Clang automatically includes <typeinfo> and declares following | 22 With the option, Clang automatically includes <typeinfo> and declares following |
23 two functions in each compiled source file: | 23 two functions in each compiled source file: |
24 - void* __op_new_intercept__(void*, size_t, const std::type_info&) | 24 - void* __op_new_intercept__(void*, size_t, const std::type_info&) |
25 - void* __op_delete_intercept__(void*, size_t, const std::type_info&) | 25 - void* __op_delete_intercept__(void*, size_t, const std::type_info&) |
26 | 26 |
27 Then, Clang inserts a call for one of these functions in every new/delete | 27 Then, Clang inserts a call for one of these functions in every new/delete |
28 expressions as below. | 28 expressions as below. |
29 | 29 |
30 operator new(...) calls are replaced to | 30 operator new(...) calls are replaced to |
31 => __op_new_intercept__(operator new(...), size, type) | 31 => __op_new_intercept__(operator new(...), size, type) |
32 | 32 |
33 operator delete(ptr [, size]) calls are replaced to | 33 operator delete(ptr [, size]) calls are replaced to |
34 => operator delete(__op_delete_intercept__(ptr, size, type) [, size]) | 34 => operator delete(__op_delete_intercept__(ptr, size, type) [, size]) |
| 35 |
| 36 Note: |
| 37 32-bit Clang is officially unsupported. The 32-bit Clang in Linux_ia32/ is |
| 38 specially prepared only for comparing 32-bit and 64-bit memory usage. Any |
| 39 failure by this compiler should not close the tree. |
OLD | NEW |