llvm.org GIT mirror llvm / 55f8c07
[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 Evgeniy Stepanov 6 years ago
1 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1010 #include "X86AsmInstrumentation.h"
1111 #include "X86Operand.h"
1212 #include "llvm/ADT/StringExtras.h"
13 #include "llvm/ADT/Triple.h"
1314 #include "llvm/IR/Function.h"
1415 #include "llvm/MC/MCContext.h"
1516 #include "llvm/MC/MCInst.h"
206207 MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out) {}
207208
208209 X86AsmInstrumentation *
209 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, const MCContext &Ctx,
210 const MCSubtargetInfo &STI) {
211 if (MCOptions.SanitizeAddress) {
210 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
211 const MCContext &Ctx, const MCSubtargetInfo &STI) {
212 Triple T(STI.getTargetTriple());
213 const bool hasCompilerRTSupport = T.isOSLinux();
214 if (hasCompilerRTSupport && MCOptions.SanitizeAddress) {
212215 if ((STI.getFeatureBits() & X86::Mode32Bit) != 0)
213216 return new X86AddressSanitizer32(STI);
214217 if ((STI.getFeatureBits() & X86::Mode64Bit) != 0)