LLVM  7.0.0svn
Functions | Variables
X86AsmInstrumentation.cpp File Reference
#include "X86AsmInstrumentation.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "X86Operand.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SMLoc.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <limits>
#include <memory>
#include <vector>
Include dependency graph for X86AsmInstrumentation.cpp:

Go to the source code of this file.

Functions

static int64_t ApplyDisplacementBounds (int64_t Displacement)
 
static void CheckDisplacementBounds (int64_t Displacement)
 
static bool IsStackReg (unsigned Reg)
 
static bool IsSmallMemAccess (unsigned AccessSize)
 

Variables

static cl::opt< boolClAsanInstrumentAssembly ("asan-instrument-assembly", cl::desc("instrument assembly with AddressSanitizer checks"), cl::Hidden, cl::init(false))
 
static const int64_t MinAllowedDisplacement
 
static const int64_t MaxAllowedDisplacement
 

Function Documentation

◆ ApplyDisplacementBounds()

static int64_t ApplyDisplacementBounds ( int64_t  Displacement)
static

Definition at line 113 of file X86AsmInstrumentation.cpp.

References llvm::max().

Referenced by IsSmallMemAccess().

◆ CheckDisplacementBounds()

static void CheckDisplacementBounds ( int64_t  Displacement)
static

Definition at line 118 of file X86AsmInstrumentation.cpp.

References assert().

Referenced by IsSmallMemAccess().

◆ IsSmallMemAccess()

static bool IsSmallMemAccess ( unsigned  AccessSize)
static

Definition at line 127 of file X86AsmInstrumentation.cpp.

References llvm::X86Operand::addMemOperands(), llvm::MCInst::addOperand(), ApplyDisplacementBounds(), assert(), CheckDisplacementBounds(), llvm::MCExpr::Constant, llvm::count(), llvm::MCConstantExpr::create(), llvm::MCSymbolRefExpr::create(), llvm::MCOperand::createImm(), llvm::X86Operand::CreateMem(), llvm::MCOperand::createReg(), llvm::MCContext::createTempSymbol(), llvm::N86::ECX, llvm::N86::EDI, llvm::MCStreamer::EmitCFIAdjustCfaOffset(), llvm::MCStreamer::EmitCFIDefCfaRegister(), llvm::MCStreamer::EmitCFIRelOffset(), llvm::MCStreamer::EmitCFIRememberState(), llvm::MCStreamer::EmitCFIRestoreState(), llvm::MCStreamer::EmitLabel(), llvm::N86::ESI, llvm::N86::ESP, llvm::MCInstrInfo::get(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCExpr::getKind(), llvm::X86Operand::getMemBaseReg(), llvm::X86Operand::getMemDisp(), llvm::X86Operand::getMemIndexReg(), llvm::X86Operand::getMemModeSize(), llvm::X86Operand::getMemScale(), llvm::X86Operand::getMemSegReg(), llvm::MCInst::getOpcode(), llvm::MCContext::getOrCreateSymbol(), llvm::MCContext::getRegisterInfo(), llvm::MCConstantExpr::getValue(), llvm::getX86SubSuperRegister(), llvm::MCParsedAsmOperand::isMem(), llvm::X86Operand::isMem(), IsStackReg(), llvm_unreachable, MRI, Reg, llvm::MCInst::setOpcode(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, and llvm::MCSymbolRefExpr::VK_PLT.

◆ IsStackReg()

static bool IsStackReg ( unsigned  Reg)
static

Definition at line 123 of file X86AsmInstrumentation.cpp.

References llvm::N86::ESP.

Referenced by IsSmallMemAccess().

Variable Documentation

◆ ClAsanInstrumentAssembly

cl::opt<bool> ClAsanInstrumentAssembly("asan-instrument-assembly", cl::desc("instrument assembly with AddressSanitizer checks"), cl::Hidden, cl::init(false))
static

◆ MaxAllowedDisplacement

const int64_t MaxAllowedDisplacement
static
Initial value:
=
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)

Definition at line 110 of file X86AsmInstrumentation.cpp.

◆ MinAllowedDisplacement

const int64_t MinAllowedDisplacement
static
Initial value:
=
std::numeric_limits<int32_t>::min()

Definition at line 108 of file X86AsmInstrumentation.cpp.