Skip to content

Commit

Permalink
[InitPreprocessor] Add compile-time interpositioning of call_once and…
Browse files Browse the repository at this point in the history
… pthread_once for Cilksan.
  • Loading branch information
neboat committed Feb 25, 2021
1 parent 6f4c853 commit 917569e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Frontend/InitPreprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("pthread_mutex_trylock",
"__csan_pthread_mutex_trylock");
Builder.defineMacro("pthread_mutex_unlock", "__csan_pthread_mutex_unlock");
Builder.defineMacro("pthread_once", "__csan_pthread_once");

// C11 locking routines
Builder.defineMacro("mtx_init", "__csan_mtx_init");
Expand All @@ -1117,6 +1118,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("mtx_trylock", "__csan_mtx_trylock");
Builder.defineMacro("mtx_timedlock", "__csan_mtx_timedlock");
Builder.defineMacro("mtx_unlock", "__csan_mtx_unlock");
Builder.defineMacro("call_once", "__csan_call_once");
}

// Add macros to indicate that the program is compiled with different Cilk
Expand Down

0 comments on commit 917569e

Please sign in to comment.