mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
[asan] Disable asm instrumentation on unsupported platforms.
Only emit calls to compiler-rt asm routines on platforms where they are present (currently limited to linux i386/x86_64). Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207651 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee053f4f51
commit
55f8c07504
@ -11,6 +11,7 @@
|
|||||||
#include "X86AsmInstrumentation.h"
|
#include "X86AsmInstrumentation.h"
|
||||||
#include "X86Operand.h"
|
#include "X86Operand.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/IR/Function.h"
|
#include "llvm/IR/Function.h"
|
||||||
#include "llvm/MC/MCContext.h"
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/MC/MCInst.h"
|
#include "llvm/MC/MCInst.h"
|
||||||
@ -207,9 +208,11 @@ void X86AsmInstrumentation::InstrumentInstruction(
|
|||||||
MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out) {}
|
MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out) {}
|
||||||
|
|
||||||
X86AsmInstrumentation *
|
X86AsmInstrumentation *
|
||||||
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, const MCContext &Ctx,
|
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
|
||||||
const MCSubtargetInfo &STI) {
|
const MCContext &Ctx, const MCSubtargetInfo &STI) {
|
||||||
if (MCOptions.SanitizeAddress) {
|
Triple T(STI.getTargetTriple());
|
||||||
|
const bool hasCompilerRTSupport = T.isOSLinux();
|
||||||
|
if (hasCompilerRTSupport && MCOptions.SanitizeAddress) {
|
||||||
if ((STI.getFeatureBits() & X86::Mode32Bit) != 0)
|
if ((STI.getFeatureBits() & X86::Mode32Bit) != 0)
|
||||||
return new X86AddressSanitizer32(STI);
|
return new X86AddressSanitizer32(STI);
|
||||||
if ((STI.getFeatureBits() & X86::Mode64Bit) != 0)
|
if ((STI.getFeatureBits() & X86::Mode64Bit) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user