mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-15 04:13:14 +01:00
Merge branch 'master' into merge-2.064
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "gen/llvmhelpers.h"
|
||||
#include "gen/logger.h"
|
||||
#include "gen/nested.h"
|
||||
#include "gen/optimizer.h"
|
||||
#include "gen/pragma.h"
|
||||
#include "gen/runtime.h"
|
||||
#include "gen/tollvm.h"
|
||||
@@ -1034,6 +1035,22 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
||||
{
|
||||
func->addFnAttr(llvm::Attribute::UWTable);
|
||||
}
|
||||
#if LDC_LLVM_VER >= 303
|
||||
if (opts::sanitize != opts::None) {
|
||||
// Set the required sanitizer attribute.
|
||||
if (opts::sanitize == opts::AddressSanitizer) {
|
||||
func->addFnAttr(llvm::Attribute::SanitizeAddress);
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::MemorySanitizer) {
|
||||
func->addFnAttr(llvm::Attribute::SanitizeMemory);
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::ThreadSanitizer) {
|
||||
func->addFnAttr(llvm::Attribute::SanitizeThread);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string entryname("entry");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user