34 #define GET_REGINFO_MC_DESC 35 #include "ARMGenRegisterInfo.inc" 47 Info =
"deprecated since v7, use 'isb'";
54 Info =
"deprecated since v7, use 'dsb'";
62 Info =
"deprecated since v7, use 'dmb'";
73 Info =
"applying IT instruction to more than one subsequent instruction is " 84 "cannot predicate thumb instructions");
91 Info =
"use of SP or PC in the list is deprecated";
101 "cannot predicate thumb instructions");
104 bool ListContainsPC =
false, ListContainsLR =
false;
111 ListContainsLR =
true;
114 ListContainsPC =
true;
117 Info =
"use of SP in the list is deprecated";
122 if (ListContainsPC && ListContainsLR) {
123 Info =
"use of LR and PC simultaneously in the list is deprecated";
130 #define GET_INSTRINFO_MC_DESC 131 #include "ARMGenInstrInfo.inc" 133 #define GET_SUBTARGETINFO_MC_DESC 134 #include "ARMGenSubtargetInfo.inc" 137 std::string ARMArchFeature;
144 if (!ARMArchFeature.empty())
145 ARMArchFeature +=
",";
146 ARMArchFeature +=
"+thumb-mode,+v4t";
150 if (!ARMArchFeature.empty())
151 ARMArchFeature +=
",";
152 ARMArchFeature +=
"+nacl-trap";
156 if (!ARMArchFeature.empty())
157 ARMArchFeature +=
",";
158 ARMArchFeature +=
"+noarm";
161 return ARMArchFeature;
169 ArchFS = (
Twine(ArchFS) +
"," + FS).str();
174 return createARMMCSubtargetInfoImpl(TT, CPU, ArchFS);
179 InitARMMCInstrInfo(X);
185 InitARMMCRegisterInfo(X, ARM::LR, 0, 0, ARM::PC);
190 const Triple &TheTriple) {
208 std::unique_ptr<MCAsmBackend> &&MAB,
209 std::unique_ptr<MCObjectWriter> &&OW,
210 std::unique_ptr<MCCodeEmitter> &&Emitter,
213 Ctx, std::move(MAB), std::move(OW), std::move(Emitter),
false,
219 std::unique_ptr<MCObjectWriter> &&OW,
220 std::unique_ptr<MCCodeEmitter> &&Emitter,
bool RelaxAll,
221 bool DWARFMustBeAtTheEnd) {
223 std::move(Emitter),
false, DWARFMustBeAtTheEnd);
227 unsigned SyntaxVariant,
231 if (SyntaxVariant == 0)
257 bool isConditionalBranch(
const MCInst &Inst)
const override {
264 bool evaluateBranch(
const MCInst &Inst, uint64_t Addr,
265 uint64_t
Size, uint64_t &
Target)
const override {
276 class ThumbMCInstrAnalysis :
public ARMMCInstrAnalysis {
278 ThumbMCInstrAnalysis(
const MCInstrInfo *
Info) : ARMMCInstrAnalysis(Info) {}
280 bool evaluateBranch(
const MCInst &Inst, uint64_t Addr,
281 uint64_t
Size, uint64_t &
Target)
const override {
295 return new ARMMCInstrAnalysis(Info);
299 return new ThumbMCInstrAnalysis(Info);
MCAsmBackend * createARMLEAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static MCInstrAnalysis * createThumbMCInstrAnalysis(const MCInstrInfo *Info)
This class represents lattice values for constants.
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target...
static MCInstrInfo * createARMMCInstrInfo()
static bool getITDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info)
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
virtual bool isConditionalBranch(const MCInst &Inst) const
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
Construct ARM Mach-O relocation info.
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Target & getTheThumbLETarget()
void LLVMInitializeARMTargetMC()
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const FeatureBitset & getFeatureBits() const
StringRef getArchName(ArchKind AK)
int getDwarfRegNum(unsigned RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
static void RegisterCOFFStreamer(Target &T, Target::COFFStreamerCtorTy Fn)
static MCInstPrinter * createARMMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Target & getTheARMBETarget()
unsigned getReg() const
Returns the register number.
Context object for machine code objects.
virtual bool isUnconditionalBranch(const MCInst &Inst) const
Target & getTheThumbBETarget()
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
void addInitialFrameState(const MCCFIInstruction &Inst)
static bool isUnconditionalBranch(Instruction *Term)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
MCAsmBackend * createARMBEAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
MCTargetStreamer * createARMTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
Analysis containing CSE Info
Instances of this class represent a single low-level machine instruction.
MCRelocationInfo * createMCRelocationInfo(const Triple &TT, MCContext &Ctx)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool isOSWindows() const
Tests whether the OS is Windows.
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
MCTargetStreamer * createARMObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
static MCRegisterInfo * createARMMCRegisterInfo(const Triple &Triple)
Streaming machine code generation interface.
unsigned const MachineRegisterInfo * MRI
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
static void RegisterMachOStreamer(Target &T, Target::MachOStreamerCtorTy Fn)
MCStreamer * createELFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Interface to description of machine instruction set.
Create MCExprs from relocations found in an object file.
unsigned getNumOperands() const
MCSubtargetInfo * createARMMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Create a ARM MCSubtargetInfo instance.
static MCStreamer * createARMMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool DWARFMustBeAtTheEnd)
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
MCELFStreamer * createARMELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter, bool RelaxAll, bool IsThumb)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
static bool getARMLoadDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info)
Triple - Helper class for working with autoconf configuration names.
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
ArchKind parseArch(StringRef Arch)
const MCOperand & getOperand(unsigned i) const
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Target - Wrapper for Target specific information.
static bool getMCRDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info)
MCCodeEmitter * createARMLEMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
OperandType
Operands are tagged with one of the values of this enum.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
Generic base class for all target subtargets.
static MCAsmInfo * createARMMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TheTriple)
static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn)
static MCInstrAnalysis * createARMMCInstrAnalysis(const MCInstrInfo *Info)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCTargetStreamer * createARMNullTargetStreamer(MCStreamer &S)
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
static void RegisterNullTargetStreamer(Target &T, Target::NullTargetStreamerCtorTy Fn)
std::string ParseARMTriple(const Triple &TT, StringRef CPU)
static void RegisterMCRelocationInfo(Target &T, Target::MCRelocationInfoCtorTy Fn)
RegisterMCRelocationInfo - Register an MCRelocationInfo implementation for the given target...
static MCRelocationInfo * createARMMCRelocationInfo(const Triple &TT, MCContext &Ctx)
StringRef - Represent a constant reference to a string, i.e.
MCStreamer * createMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
static bool getARMStoreDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info)
Target & getTheARMLETarget()
unsigned getOpcode() const
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
MCCodeEmitter * createARMBEMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)