mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Add new version identifiers if a sanitizer is specified.
This commit is contained in:
parent
7f017608a8
commit
d7d0ebb65c
1 changed files with 15 additions and 0 deletions
|
@ -636,6 +636,21 @@ static void registerPredefinedVersions() {
|
|||
|
||||
registerPredefinedTargetVersions();
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
// Pass sanitizer arguments to linker. Requires clang.
|
||||
if (opts::sanitize == opts::AddressSanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_AddressSanitizer");
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::MemorySanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_MemorySanitizer");
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::ThreadSanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_ThreadSanitizer");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Expose LLVM version to runtime
|
||||
#define STR(x) #x
|
||||
#define XSTR(x) STR(x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue