52 SMShadowTracker.startFunction(MF);
117 if (GVSym->
getName()[0] !=
'$')
172 const char *Modifier =
nullptr,
unsigned AsmVariant = 0);
196 unsigned OpNo,
raw_ostream &O,
const char *Modifier,
197 unsigned AsmVariant) {
203 if (AsmVariant == 0) O <<
'%';
205 if (Modifier && strncmp(Modifier,
"subreg", strlen(
"subreg")) == 0) {
206 unsigned Size = (
strcmp(Modifier+6,
"64") == 0) ? 64 :
207 (
strcmp(Modifier+6,
"32") == 0) ? 32 :
208 (
strcmp(Modifier+6,
"16") == 0) ? 16 : 8;
216 if (AsmVariant == 0) O <<
'$';
221 if (AsmVariant == 0) O <<
'$';
230 const char *Modifier =
nullptr) {
236 bool HasBaseReg = BaseReg.
getReg() != 0;
237 if (HasBaseReg && Modifier && !
strcmp(Modifier,
"no-rip") &&
238 BaseReg.
getReg() == X86::RIP)
242 bool HasParenPart = IndexReg.
getReg() || HasBaseReg;
248 int DispVal = DispSpec.
getImm();
249 if (DispVal || !HasParenPart)
258 if (Modifier &&
strcmp(Modifier,
"H") == 0)
263 "X86 doesn't allow scaling by ESP");
274 O <<
',' << ScaleVal;
282 const char *Modifier =
nullptr) {
283 assert(
isMem(*MI, Op) &&
"Invalid memory reference!");
294 const char *Modifier =
nullptr,
295 unsigned AsmVariant = 1) {
310 bool NeedPlus =
false;
317 if (NeedPlus) O <<
" + ";
319 O << ScaleVal <<
'*';
324 if (!DispSpec.
isImm()) {
325 if (NeedPlus) O <<
" + ";
328 int64_t DispVal = DispSpec.
getImm();
329 if (DispVal || (!IndexReg.
getReg() && !BaseReg.
getReg())) {
348 default:
return true;
378 if (ExtraCode && ExtraCode[0]) {
379 if (ExtraCode[1] != 0)
return true;
383 switch (ExtraCode[0]) {
466 unsigned OpNo,
unsigned AsmVariant,
467 const char *ExtraCode,
474 if (ExtraCode && ExtraCode[0]) {
475 if (ExtraCode[1] != 0)
return true;
477 switch (ExtraCode[0]) {
478 default:
return true;
566 if (
MCSymbol *Sym = S->getCOMDATSymbol()) {
567 if (Sym->isUndefined())
591 if (!Stubs.empty()) {
597 for (
auto &Stub : Stubs)
631 for (
const auto &Global : M.globals())
633 for (
const auto &Alias : M.aliases())
639 if (!Flags.empty()) {
MO_SECREL - On a symbol operand this indicates that the immediate is the offset from beginning of sec...
Instances of this class represent a uniqued identifier for a section in the current translation unit...
A parsed version of the target data layout string in and methods for querying it. ...
SymbolListTy GetGVStubList()
Accessor methods to return the set of stubs in sorted order.
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand &MO, char Mode, raw_ostream &O)
SectionKind getSectionKind(const DataLayout *DL) const
void LLVMInitializeX86AsmPrinter()
const GlobalValue * getGlobal() const
static const char * getRegisterName(unsigned RegNo)
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol * getSymbol(const GlobalValue *GV) const
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
void emitLinkerFlagsForGlobal(raw_ostream &OS, const GlobalValue *GV) const override
MO_TLSLD - On a symbol operand this indicates that the immediate is the offset of the GOT entry with ...
MO_TLVP_PIC_BASE - On a symbol operand this indicates that the immediate is some TLS offset from the ...
MCContext & OutContext
This is the context for the output file that we are streaming.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - Emit the function body.
Address of indexed Jump Table for switch.
const MachineFunction * MF
The current machine function.
bool isTargetKnownWindowsMSVC() const
MCSymbol * getSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffi...
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
MO_DTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry with...
static void printSymbolOperand(X86AsmPrinter &P, const MachineOperand &MO, raw_ostream &O)
printSymbolOperand - Print a raw symbol reference operand.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with strcmp
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
AddrSegmentReg - The operand # of the segment in the memory operand.
const Triple & getTargetTriple() const
This represents a section on Windows.
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static void printPCRelImm(X86AsmPrinter &P, const MachineInstr *MI, unsigned OpNo, raw_ostream &O)
printPCRelImm - This is used to print an immediate value that ends up being encoded as a pc-relative ...
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
struct fuzzer::@269 Flags
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
No complex type; simple scalar variable.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool hasInternalLinkage() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Name of external global symbol.
Reg
All possible values of the reg field in the ModR/M byte.
bool usesVAFloatArgument() const
MCContext & getContext() const
static bool isMem(const MachineInstr &MI, unsigned Op)
void emitXRayTable()
Emit a table with all XRay instrumentation points.
void EmitFunctionBody()
This method emits the body and trailer for a function.
PointerTy getPointer() const
.code16 (X86) / .code 16 (ARM)
MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
static void printLeaMemReference(X86AsmPrinter &P, const MachineInstr *MI, unsigned Op, raw_ostream &O, const char *Modifier=nullptr)
bool isPICStyleRIPRel() const
MO_GOTTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry wi...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
static void emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel, MachineModuleInfoImpl::StubValueTy &MCSym)
This class is a data container for one entry in a MachineConstantPool.
static void printOperand(X86AsmPrinter &P, const MachineInstr *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr, unsigned AsmVariant=0)
MCContext & getContext() const
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
PrintAsmOperand - Print out an operand for an inline asm expression.
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
const Constant * ConstVal
Address of a global value.
unsigned getTargetFlags() const
Streaming machine code generation interface.
MCSymbol * CurrentFnSym
The symbol for the current function.
MO_GOT_ABSOLUTE_ADDRESS - On a symbol operand, this represents a relocation of: SYMBOL_LABEL + [...
const MCAsmInfo * MAI
Target Asm Printer information.
PointerIntPair - This class implements a pair of a pointer and small integer.
bool isTargetCOFF() const
MO_GOTNTPOFF - On a symbol operand this indicates that the immediate is the offset of the GOT entry w...
MO_TLVP - On a symbol operand this indicates that the immediate is some TLS offset.
This is an important base class in LLVM.
const MachineOperand & getOperand(unsigned i) const
MO_TLSLDM - On a symbol operand this indicates that the immediate is the offset of the GOT entry with...
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
TargetMachine & TM
Target machine description.
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
void printOffset(int64_t Offset, raw_ostream &OS) const
This is just convenient handler for printing offsets.
.subsections_via_symbols (MachO)
SectionKind - This is a simple POD value that classifies the properties of a section.
A function that returns a base type.
MCSection * getDrectveSection() const
int64_t getOffset() const
Return the offset from the symbol in this operand.
MO_NTPOFF - On a symbol operand this indicates that the immediate is the negative thread-pointer offs...
Ty & getObjFileInfo()
Keep track of various per-function pieces of information for backends that would like to do so...
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
MO_TLSGD - On a symbol operand this indicates that the immediate is the offset of the GOT entry with ...
void serializeToStackMapSection()
If there is any stack map data, create a stack map section and serialize the map info into it...
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
MO_TPOFF - On a symbol operand this indicates that the immediate is the thread-pointer offset for the...
unsigned Alignment
The required alignment for this entry.
MCSymbol * getPICBaseSymbol() const
getPICBaseSymbol - Return a function-local symbol to represent the PIC base.
virtual void EmitLabel(MCSymbol *Symbol)
Emit a label for Symbol into the current section.
const MCContext & getContext() const
void serializeToFaultMapSection()
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
void EmitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
const X86Subtarget & getSubtarget() const
static SectionKind getMetadata()
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
unsigned getX86SubSuperRegister(unsigned, unsigned, bool High=false)
Returns the sub or super register of a specific X86 register.
MCSymbol * GetCPISymbol(unsigned CPID) const override
Return the symbol for the specified constant pool entry.
static void printMemReference(X86AsmPrinter &P, const MachineInstr *MI, unsigned Op, raw_ostream &O, const char *Modifier=nullptr)
Representation of each machine instruction.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
void SetupMachineFunction(MachineFunction &MF)
This should be called when a new MachineFunction is being processed from runOnMachineFunction.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
StringRef getName() const
getName - Get the symbol name.
MO_INDNTPOFF - On a symbol operand this indicates that the immediate is the absolute address of the G...
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
static void printIntelMemReference(X86AsmPrinter &P, const MachineInstr *MI, unsigned Op, raw_ostream &O, const char *Modifier=nullptr, unsigned AsmVariant=1)
void EmitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
Target & getTheX86_32Target()
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets...
bool hasLocalLinkage() const
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
unsigned getReg() const
getReg - Returns the register number.
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A raw_ostream that writes to an std::string.
virtual const TargetInstrInfo * getInstrInfo() const
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
This class implements an extremely fast bulk output stream that can only output to a stream...
const Target & getTarget() const
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
const std::vector< MachineConstantPoolEntry > & getConstants() const
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
StringRef - Represent a constant reference to a string, i.e.
Address of indexed Constant in Constant Pool.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
union llvm::MachineConstantPoolEntry::@35 Val
The constant itself.
Target & getTheX86_64Target()
This class can be derived from and used by targets to hold private target-specific information for ea...
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...