File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,13 @@ extern "C" {
12
12
13
13
static int RegisterRuntime () {
14
14
__llvm_profile_initialize ();
15
+ #ifdef _AIX
16
+ extern COMPILER_RT_VISIBILITY void *__llvm_profile_keep[];
17
+ (void )*(void *volatile *)__llvm_profile_keep;
18
+ #endif
15
19
return 0 ;
16
20
}
17
21
18
- #ifndef _AIX
19
22
/* int __llvm_profile_runtime */
20
- COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR;
21
-
22
- static int Registration = RegisterRuntime();
23
- #else
24
- extern COMPILER_RT_VISIBILITY void *__llvm_profile_keep[];
25
- /* On AIX, when linking with -bcdtors:csect, the variable whose constructor does
26
- * the registration needs to be explicitly kept, hence we reuse the runtime hook
27
- * variable to do the registration since it'll be kept via the -u linker flag.
28
- * Create a volatile reference to __llvm_profile_keep to keep the array alive.*/
29
- COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR =
30
- ((void )*(void *volatile *)__llvm_profile_keep, RegisterRuntime());
31
- #endif
23
+ COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR = RegisterRuntime();
32
24
}
You can’t perform that action at this time.
0 commit comments