LLVM  15.0.0git
AVRAsmPrinter.cpp
Go to the documentation of this file.
1 //===-- AVRAsmPrinter.cpp - AVR LLVM assembly writer ----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains a printer that converts from our internal representation
10 // of machine-dependent LLVM code to GAS-format AVR assembly language.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AVR.h"
15 #include "AVRMCInstLower.h"
16 #include "AVRSubtarget.h"
17 #include "AVRTargetMachine.h"
19 #include "MCTargetDesc/AVRMCExpr.h"
21 
28 #include "llvm/IR/Mangler.h"
29 #include "llvm/MC/MCContext.h"
30 #include "llvm/MC/MCInst.h"
31 #include "llvm/MC/MCStreamer.h"
32 #include "llvm/MC/MCSymbol.h"
33 #include "llvm/MC/TargetRegistry.h"
36 
37 #define DEBUG_TYPE "avr-asm-printer"
38 
39 namespace llvm {
40 
41 /// An AVR assembly code printer.
42 class AVRAsmPrinter : public AsmPrinter {
43 public:
44  AVRAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer)
45  : AsmPrinter(TM, std::move(Streamer)), MRI(*TM.getMCRegisterInfo()) {}
46 
47  StringRef getPassName() const override { return "AVR Assembly Printer"; }
48 
49  void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O);
50 
51  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
52  const char *ExtraCode, raw_ostream &O) override;
53 
54  bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
55  const char *ExtraCode, raw_ostream &O) override;
56 
57  void emitInstruction(const MachineInstr *MI) override;
58 
59  const MCExpr *lowerConstant(const Constant *CV) override;
60 
61  void emitXXStructor(const DataLayout &DL, const Constant *CV) override;
62 
63  bool doFinalization(Module &M) override;
64 
65  void emitStartOfAsmFile(Module &M) override;
66 
67 private:
68  const MCRegisterInfo &MRI;
69  bool EmittedStructorSymbolAttrs = false;
70 };
71 
72 void AVRAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
73  raw_ostream &O) {
74  const MachineOperand &MO = MI->getOperand(OpNo);
75 
76  switch (MO.getType()) {
79  break;
81  O << MO.getImm();
82  break;
84  O << getSymbol(MO.getGlobal());
85  break;
88  break;
90  O << *MO.getMBB()->getSymbol();
91  break;
92  default:
93  llvm_unreachable("Not implemented yet!");
94  }
95 }
96 
97 bool AVRAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
98  const char *ExtraCode, raw_ostream &O) {
99  // Default asm printer can only deal with some extra codes,
100  // so try it first.
101  bool Error = AsmPrinter::PrintAsmOperand(MI, OpNum, ExtraCode, O);
102 
103  if (Error && ExtraCode && ExtraCode[0]) {
104  if (ExtraCode[1] != 0)
105  return true; // Unknown modifier.
106 
107  if (ExtraCode[0] >= 'A' && ExtraCode[0] <= 'Z') {
108  const MachineOperand &RegOp = MI->getOperand(OpNum);
109 
110  assert(RegOp.isReg() && "Operand must be a register when you're"
111  "using 'A'..'Z' operand extracodes.");
112  Register Reg = RegOp.getReg();
113 
114  unsigned ByteNumber = ExtraCode[0] - 'A';
115 
116  unsigned OpFlags = MI->getOperand(OpNum - 1).getImm();
117  unsigned NumOpRegs = InlineAsm::getNumOperandRegisters(OpFlags);
118  (void)NumOpRegs;
119 
120  const AVRSubtarget &STI = MF->getSubtarget<AVRSubtarget>();
121  const TargetRegisterInfo &TRI = *STI.getRegisterInfo();
122 
123  const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(Reg);
124  unsigned BytesPerReg = TRI.getRegSizeInBits(*RC) / 8;
125  assert(BytesPerReg <= 2 && "Only 8 and 16 bit regs are supported.");
126 
127  unsigned RegIdx = ByteNumber / BytesPerReg;
128  assert(RegIdx < NumOpRegs && "Multibyte index out of range.");
129 
130  Reg = MI->getOperand(OpNum + RegIdx).getReg();
131 
132  if (BytesPerReg == 2) {
133  Reg = TRI.getSubReg(Reg, ByteNumber % BytesPerReg ? AVR::sub_hi
134  : AVR::sub_lo);
135  }
136 
138  return false;
139  }
140  }
141 
142  if (Error)
143  printOperand(MI, OpNum, O);
144 
145  return false;
146 }
147 
149  unsigned OpNum, const char *ExtraCode,
150  raw_ostream &O) {
151  if (ExtraCode && ExtraCode[0])
152  return true; // Unknown modifier
153 
154  const MachineOperand &MO = MI->getOperand(OpNum);
155  (void)MO;
156  assert(MO.isReg() && "Unexpected inline asm memory operand");
157 
158  // TODO: We should be able to look up the alternative name for
159  // the register if it's given.
160  // TableGen doesn't expose a way of getting retrieving names
161  // for registers.
162  if (MI->getOperand(OpNum).getReg() == AVR::R31R30) {
163  O << "Z";
164  } else {
165  assert(MI->getOperand(OpNum).getReg() == AVR::R29R28 &&
166  "Wrong register class for memory operand.");
167  O << "Y";
168  }
169 
170  // If NumOpRegs == 2, then we assume it is product of a FrameIndex expansion
171  // and the second operand is an Imm.
172  unsigned OpFlags = MI->getOperand(OpNum - 1).getImm();
173  unsigned NumOpRegs = InlineAsm::getNumOperandRegisters(OpFlags);
174 
175  if (NumOpRegs == 2) {
176  O << '+' << MI->getOperand(OpNum + 1).getImm();
177  }
178 
179  return false;
180 }
181 
183  AVRMCInstLower MCInstLowering(OutContext, *this);
184 
185  MCInst I;
186  MCInstLowering.lowerInstruction(*MI, I);
188 }
189 
191  MCContext &Ctx = OutContext;
192 
193  if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
194  bool IsProgMem = GV->getAddressSpace() == AVR::ProgramMemory;
195  if (IsProgMem) {
196  const MCExpr *Expr = MCSymbolRefExpr::create(getSymbol(GV), Ctx);
197  return AVRMCExpr::create(AVRMCExpr::VK_AVR_PM, Expr, false, Ctx);
198  }
199  }
200 
201  return AsmPrinter::lowerConstant(CV);
202 }
203 
205  if (!EmittedStructorSymbolAttrs) {
206  OutStreamer->emitRawComment(
207  " Emitting these undefined symbol references causes us to link the"
208  " libgcc code that runs our constructors/destructors");
209  OutStreamer->emitRawComment(" This matches GCC's behavior");
210 
211  MCSymbol *CtorsSym = OutContext.getOrCreateSymbol("__do_global_ctors");
212  OutStreamer->emitSymbolAttribute(CtorsSym, MCSA_Global);
213 
214  MCSymbol *DtorsSym = OutContext.getOrCreateSymbol("__do_global_dtors");
215  OutStreamer->emitSymbolAttribute(DtorsSym, MCSA_Global);
216 
217  EmittedStructorSymbolAttrs = true;
218  }
219 
221 }
222 
224  MCSymbol *DoCopyData = OutContext.getOrCreateSymbol("__do_copy_data");
225  MCSymbol *DoClearBss = OutContext.getOrCreateSymbol("__do_clear_bss");
226 
227  // FIXME: We can disable __do_copy_data if there are no static RAM variables.
228 
229  OutStreamer->emitRawComment(
230  " Declaring this symbol tells the CRT that it should");
231  OutStreamer->emitRawComment(
232  "copy all variables from program memory to RAM on startup");
233  OutStreamer->emitSymbolAttribute(DoCopyData, MCSA_Global);
234 
235  OutStreamer->emitRawComment(
236  " Declaring this symbol tells the CRT that it should");
237  OutStreamer->emitRawComment("clear the zeroed data section on startup");
238  OutStreamer->emitSymbolAttribute(DoClearBss, MCSA_Global);
239 
241 }
242 
244  const AVRTargetMachine &TM = (const AVRTargetMachine &)MMI->getTarget();
245  const AVRSubtarget *SubTM = (const AVRSubtarget *)TM.getSubtargetImpl();
246  if (!SubTM)
247  return;
248 
249  // Emit __tmp_reg__.
250  OutStreamer->emitAssignment(
251  MMI->getContext().getOrCreateSymbol(StringRef("__tmp_reg__")),
253  // Emit __zero_reg__.
254  OutStreamer->emitAssignment(
255  MMI->getContext().getOrCreateSymbol(StringRef("__zero_reg__")),
257  // Emit __SREG__.
258  OutStreamer->emitAssignment(
259  MMI->getContext().getOrCreateSymbol(StringRef("__SREG__")),
261  // Emit __SP_H__ if available.
262  if (!SubTM->hasSmallStack())
263  OutStreamer->emitAssignment(
264  MMI->getContext().getOrCreateSymbol(StringRef("__SP_H__")),
266  // Emit __SP_L__.
267  OutStreamer->emitAssignment(
268  MMI->getContext().getOrCreateSymbol(StringRef("__SP_L__")),
270  // Emit __EIND__ if available.
271  if (SubTM->hasEIJMPCALL())
272  OutStreamer->emitAssignment(
273  MMI->getContext().getOrCreateSymbol(StringRef("__EIND__")),
275  // Emit __RAMPZ__ if available.
276  if (SubTM->hasELPM())
277  OutStreamer->emitAssignment(
278  MMI->getContext().getOrCreateSymbol(StringRef("__RAMPZ__")),
280 }
281 
282 } // end of namespace llvm
283 
286 }
AsmPrinter.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
MachineInstr.h
llvm::MachineOperand::MO_Immediate
@ MO_Immediate
Immediate operand.
Definition: MachineOperand.h:52
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
AVRInstPrinter.h
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::AsmPrinter::emitXXStructor
virtual void emitXXStructor(const DataLayout &DL, const Constant *CV)
Targets can override this to change how global constants that are part of a C++ static/global constru...
Definition: AsmPrinter.h:552
llvm::AsmPrinter::lowerConstant
virtual const MCExpr * lowerConstant(const Constant *CV)
Lower the specified LLVM Constant to an MCExpr.
Definition: AsmPrinter.cpp:2691
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition: MachineModuleInfo.h:144
llvm::AVRAsmPrinter::emitInstruction
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
Definition: AVRAsmPrinter.cpp:182
llvm::AVRSubtarget::getIORegEIND
int getIORegEIND(void) const
Definition: AVRSubtarget.h:96
llvm::MachineOperand::getGlobal
const GlobalValue * getGlobal() const
Definition: MachineOperand.h:572
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:76
AVRMCInstLower.h
llvm::MCConstantExpr::create
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
llvm::AVRTargetMachine
A generic AVR implementation.
Definition: AVRTargetMachine.h:28
llvm::AVR::ProgramMemory
@ ProgramMemory
Definition: AVR.h:43
ErrorHandling.h
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::AsmPrinter::doFinalization
bool doFinalization(Module &M) override
Shut down the asmprinter.
Definition: AsmPrinter.cpp:1921
llvm::AVRSubtarget::getIORegSPH
int getIORegSPH(void) const
Definition: AVRSubtarget.h:98
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:234
LLVMInitializeAVRAsmPrinter
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRAsmPrinter()
Definition: AVRAsmPrinter.cpp:284
llvm::AVRAsmPrinter::doFinalization
bool doFinalization(Module &M) override
Shut down the asmprinter.
Definition: AVRAsmPrinter.cpp:223
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1628
llvm::MachineOperand::MO_Register
@ MO_Register
Register operand.
Definition: MachineOperand.h:51
llvm::AsmPrinter::EmitToStreamer
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
Definition: AsmPrinter.cpp:401
AVRMCExpr.h
llvm::AVRSubtarget::getIORegRAMPZ
int getIORegRAMPZ(void) const
Get I/O register addresses.
Definition: AVRSubtarget.h:95
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition: MachineBasicBlock.cpp:57
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:207
llvm::AVRMCInstLower
Lowers MachineInstr objects into MCInst objects.
Definition: AVRMCInstLower.h:25
llvm::MachineOperand::MO_GlobalAddress
@ MO_GlobalAddress
Address of a global value.
Definition: MachineOperand.h:61
llvm::MachineOperand::getImm
int64_t getImm() const
Definition: MachineOperand.h:546
llvm::AsmPrinter::OutStreamer
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition: AsmPrinter.h:96
llvm::AVRSubtarget
A specific AVR target MCU.
Definition: AVRSubtarget.h:31
llvm::AVRSubtarget::hasEIJMPCALL
bool hasEIJMPCALL() const
Definition: AVRSubtarget.h:67
MCContext.h
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:45
MCSymbol.h
llvm::MachineModuleInfo::getTarget
const LLVMTargetMachine & getTarget() const
Definition: MachineModuleInfo.h:142
MCInst.h
llvm::getTheAVRTarget
Target & getTheAVRTarget()
Definition: AVRTargetInfo.cpp:12
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:48
AVRTargetInfo.h
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::AVRAsmPrinter::emitStartOfAsmFile
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
Definition: AVRAsmPrinter.cpp:243
llvm::AVRAsmPrinter::PrintAsmOperand
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
Definition: AVRAsmPrinter.cpp:97
llvm::AVRSubtarget::getRegZeroIndex
int getRegZeroIndex(void) const
Definition: AVRSubtarget.h:103
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:656
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:239
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::AVRMCExpr::create
static const AVRMCExpr * create(VariantKind Kind, const MCExpr *Expr, bool isNegated, MCContext &Ctx)
Creates an AVR machine code expression.
Definition: AVRMCExpr.cpp:38
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::MachineOperand::isReg
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Definition: MachineOperand.h:320
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
llvm::AVRInstPrinter::getPrettyRegisterName
static const char * getPrettyRegisterName(unsigned RegNo, MCRegisterInfo const &MRI)
Definition: AVRInstPrinter.cpp:89
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:126
llvm::AVRAsmPrinter::printOperand
void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O)
Definition: AVRAsmPrinter.cpp:72
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::MachineOperand::getType
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Definition: MachineOperand.h:218
llvm::AVRAsmPrinter::lowerConstant
const MCExpr * lowerConstant(const Constant *CV) override
Lower the specified LLVM Constant to an MCExpr.
Definition: AVRAsmPrinter.cpp:190
AVRTargetMachine.h
llvm::AVRSubtarget::hasSmallStack
bool hasSmallStack() const
Definition: AVRSubtarget.h:69
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::AsmPrinter::getSymbol
MCSymbol * getSymbol(const GlobalValue *GV) const
Definition: AsmPrinter.cpp:654
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1675
llvm::AsmPrinter::MF
MachineFunction * MF
The current machine function.
Definition: AsmPrinter.h:99
llvm::AsmPrinter::OutContext
MCContext & OutContext
This is the context for the output file that we are streaming.
Definition: AsmPrinter.h:91
MachineModuleInfo.h
llvm::MachineOperand::getReg
Register getReg() const
getReg - Returns the register number.
Definition: MachineOperand.h:359
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
Mangler.h
llvm::AVRSubtarget::hasELPM
bool hasELPM() const
Definition: AVRSubtarget.h:73
llvm::AsmPrinter::GetExternalSymbolSymbol
MCSymbol * GetExternalSymbolSymbol(StringRef Sym) const
Return the MCSymbol for the specified ExternalSymbol.
Definition: AsmPrinter.cpp:3395
llvm::AVRMCExpr::VK_AVR_PM
@ VK_AVR_PM
Corresponds to pm(), reference to program memory.
Definition: AVRMCExpr.h:30
llvm::MachineOperand::getMBB
MachineBasicBlock * getMBB() const
Definition: MachineOperand.h:561
AVRSubtarget.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::MachineOperand::MO_MachineBasicBlock
@ MO_MachineBasicBlock
MachineBasicBlock reference.
Definition: MachineOperand.h:55
TargetSubtargetInfo.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::AVRSubtarget::getIORegSREG
int getIORegSREG(void) const
Definition: AVRSubtarget.h:99
llvm::AVRAsmPrinter::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: AVRAsmPrinter.cpp:47
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::AsmPrinter::MMI
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
Definition: AsmPrinter.h:102
llvm::AVRSubtarget::getRegTmpIndex
int getRegTmpIndex(void) const
Get GPR aliases.
Definition: AVRSubtarget.h:102
std
Definition: BitVector.h:851
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::MachineOperand::MO_ExternalSymbol
@ MO_ExternalSymbol
Name of external global symbol.
Definition: MachineOperand.h:60
llvm::AVRAsmPrinter::emitXXStructor
void emitXXStructor(const DataLayout &DL, const Constant *CV) override
Targets can override this to change how global constants that are part of a C++ static/global constru...
Definition: AVRAsmPrinter.cpp:204
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
AVR.h
llvm::MCSA_Global
@ MCSA_Global
.type _foo, @gnu_unique_object
Definition: MCDirectives.h:30
llvm::AVRAsmPrinter::AVRAsmPrinter
AVRAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
Definition: AVRAsmPrinter.cpp:44
llvm::AVRAsmPrinter
An AVR assembly code printer.
Definition: AVRAsmPrinter.cpp:42
llvm::AVRSubtarget::getRegisterInfo
const AVRRegisterInfo * getRegisterInfo() const override
Definition: AVRSubtarget.h:51
llvm::AsmPrinter::TM
TargetMachine & TM
Target machine description.
Definition: AsmPrinter.h:84
llvm::AVRAsmPrinter::PrintAsmMemoryOperand
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
Definition: AVRAsmPrinter.cpp:148
llvm::TargetMachine::getSubtargetImpl
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Definition: TargetMachine.h:133
llvm::InlineAsm::getNumOperandRegisters
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
Definition: InlineAsm.h:355
llvm::MachineOperand::getSymbolName
const char * getSymbolName() const
Definition: MachineOperand.h:617
MCStreamer.h
llvm::RegisterAsmPrinter
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...
Definition: TargetRegistry.h:1381
raw_ostream.h
MachineFunction.h
TargetRegistry.h
TargetRegisterInfo.h
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::AVRMCInstLower::lowerInstruction
void lowerInstruction(const MachineInstr &MI, MCInst &OutMI) const
Lowers a MachineInstr into a MCInst.
Definition: AVRMCInstLower.cpp:64
llvm::AsmPrinter::PrintAsmOperand
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
Definition: AsmPrinterInlineAsm.cpp:467
llvm::AVRSubtarget::getIORegSPL
int getIORegSPL(void) const
Definition: AVRSubtarget.h:97