[PATCH] Asm instrumentation is disabled on non-Linux OSes.
Yuri Gorshenin
ygorshenin at chromium.org
Wed Apr 30 04:26:12 PDT 2014
Hi eugenis,
Asm instrumentation is disabled on non-Linux OSes.
http://reviews.llvm.org/D3564
Files:
lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
Index: lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
+++ lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
@@ -11,6 +11,7 @@
#include "X86AsmInstrumentation.h"
#include "X86Operand.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
@@ -206,10 +207,14 @@
const MCInst &Inst, SmallVectorImpl<MCParsedAsmOperand *> &Operands,
MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out) {}
-X86AsmInstrumentation *
-CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, const MCContext &Ctx,
- const MCSubtargetInfo &STI) {
- if (MCOptions.SanitizeAddress) {
+X86AsmInstrumentation* CreateX86AsmInstrumentation(
+ const MCTargetOptions& MCOptions,
+ const MCContext& Ctx,
+ const MCSubtargetInfo& STI) {
+ // FIXME: remove OS check as soon as asm instrumentation functions from
+ // compiler-rt are fixed.
+ Triple T(STI.getTargetTriple());
+ if (T.isOSLinux() && MCOptions.SanitizeAddress) {
if ((STI.getFeatureBits() & X86::Mode32Bit) != 0)
return new X86AddressSanitizer32(STI);
if ((STI.getFeatureBits() & X86::Mode64Bit) != 0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3564.8969.patch
Type: text/x-patch
Size: 1344 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140430/f33c9897/attachment.bin>
More information about the llvm-commits
mailing list