blob: 9e5d679aa3c209badbbbf32e95ccff3418f095dc [file] [log] [blame]
Chris Lattner7e1a8f82010-04-04 19:09:29 +00001//===-- AsmPrinterInlineAsm.cpp - AsmPrinter Inline Asm Handling ----------===//
Chris Lattner736e31d2010-04-04 18:34:07 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner7e1a8f82010-04-04 19:09:29 +000010// This file implements the inline assembler pieces of the AsmPrinter class.
Chris Lattner736e31d2010-04-04 18:34:07 +000011//
12//===----------------------------------------------------------------------===//
13
14#define DEBUG_TYPE "asm-printer"
Chris Lattner736e31d2010-04-04 18:34:07 +000015#include "llvm/CodeGen/AsmPrinter.h"
Chris Lattnercf9a4152010-04-07 05:38:05 +000016#include "llvm/Constants.h"
Chris Lattner7e1a8f82010-04-04 19:09:29 +000017#include "llvm/InlineAsm.h"
Chris Lattner6eb78062010-04-06 00:55:39 +000018#include "llvm/LLVMContext.h"
19#include "llvm/Module.h"
Chris Lattner736e31d2010-04-04 18:34:07 +000020#include "llvm/CodeGen/MachineBasicBlock.h"
Chris Lattner6eb78062010-04-06 00:55:39 +000021#include "llvm/CodeGen/MachineModuleInfo.h"
Chris Lattner736e31d2010-04-04 18:34:07 +000022#include "llvm/MC/MCAsmInfo.h"
23#include "llvm/MC/MCStreamer.h"
24#include "llvm/MC/MCSymbol.h"
Chris Lattneraf632c92010-04-05 23:11:24 +000025#include "llvm/Target/TargetAsmParser.h"
26#include "llvm/Target/TargetMachine.h"
27#include "llvm/Target/TargetRegistry.h"
28#include "llvm/ADT/OwningPtr.h"
Chris Lattner736e31d2010-04-04 18:34:07 +000029#include "llvm/ADT/SmallString.h"
30#include "llvm/ADT/Twine.h"
31#include "llvm/Support/ErrorHandling.h"
Chris Lattneraf632c92010-04-05 23:11:24 +000032#include "llvm/Support/MemoryBuffer.h"
33#include "llvm/Support/SourceMgr.h"
Chris Lattner736e31d2010-04-04 18:34:07 +000034#include "llvm/Support/raw_ostream.h"
Chris Lattner736e31d2010-04-04 18:34:07 +000035using namespace llvm;
36
Chris Lattner6e30c6a2010-11-17 08:03:32 +000037namespace {
38 struct SrcMgrDiagInfo {
39 const MDNode *LocInfo;
Chris Lattner4afa1282010-11-17 08:13:01 +000040 LLVMContext::InlineAsmDiagHandlerTy DiagHandler;
Chris Lattner6e30c6a2010-11-17 08:03:32 +000041 void *DiagContext;
42 };
43}
44
45/// SrcMgrDiagHandler - This callback is invoked when the SourceMgr for an
46/// inline asm has an error in it. diagInfo is a pointer to the SrcMgrDiagInfo
47/// struct above.
Chris Lattner4afa1282010-11-17 08:13:01 +000048static void SrcMgrDiagHandler(const SMDiagnostic &Diag, void *diagInfo) {
Chris Lattner6e30c6a2010-11-17 08:03:32 +000049 SrcMgrDiagInfo *DiagInfo = static_cast<SrcMgrDiagInfo *>(diagInfo);
50 assert(DiagInfo && "Diagnostic context not passed down?");
51
52 unsigned LocCookie = 0;
53 if (const MDNode *LocInfo = DiagInfo->LocInfo)
54 if (LocInfo->getNumOperands() > 0)
55 if (const ConstantInt *CI = dyn_cast<ConstantInt>(LocInfo->getOperand(0)))
56 LocCookie = CI->getZExtValue();
57
Chris Lattner4afa1282010-11-17 08:13:01 +000058 DiagInfo->DiagHandler(Diag, DiagInfo->DiagContext, LocCookie);
Chris Lattner6e30c6a2010-11-17 08:03:32 +000059}
60
Chris Lattner736e31d2010-04-04 18:34:07 +000061/// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
Chris Lattnera38941d2010-11-17 07:53:40 +000062void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode) const {
Chris Lattner736e31d2010-04-04 18:34:07 +000063 assert(!Str.empty() && "Can't emit empty inline asm block");
Jim Grosbach2b2de242010-10-01 23:29:12 +000064
Chris Lattneraf632c92010-04-05 23:11:24 +000065 // Remember if the buffer is nul terminated or not so we can avoid a copy.
66 bool isNullTerminated = Str.back() == 0;
67 if (isNullTerminated)
68 Str = Str.substr(0, Str.size()-1);
Jim Grosbach2b2de242010-10-01 23:29:12 +000069
Chris Lattner736e31d2010-04-04 18:34:07 +000070 // If the output streamer is actually a .s file, just emit the blob textually.
71 // This is useful in case the asm parser doesn't handle something but the
72 // system assembler does.
73 if (OutStreamer.hasRawTextSupport()) {
74 OutStreamer.EmitRawText(Str);
75 return;
76 }
Jim Grosbach2b2de242010-10-01 23:29:12 +000077
Chris Lattneraf632c92010-04-05 23:11:24 +000078 SourceMgr SrcMgr;
Chris Lattner6e30c6a2010-11-17 08:03:32 +000079 SrcMgrDiagInfo DiagInfo;
Jim Grosbach2b2de242010-10-01 23:29:12 +000080
Chris Lattner6eb78062010-04-06 00:55:39 +000081 // If the current LLVMContext has an inline asm handler, set it in SourceMgr.
82 LLVMContext &LLVMCtx = MMI->getModule()->getContext();
83 bool HasDiagHandler = false;
Chris Lattner4afa1282010-11-17 08:13:01 +000084 if (LLVMCtx.getInlineAsmDiagnosticHandler() != 0) {
Chris Lattner6e30c6a2010-11-17 08:03:32 +000085 // If the source manager has an issue, we arrange for SrcMgrDiagHandler
86 // to be invoked, getting DiagInfo passed into it.
87 DiagInfo.LocInfo = LocMDNode;
Chris Lattner4afa1282010-11-17 08:13:01 +000088 DiagInfo.DiagHandler = LLVMCtx.getInlineAsmDiagnosticHandler();
Chris Lattner6e30c6a2010-11-17 08:03:32 +000089 DiagInfo.DiagContext = LLVMCtx.getInlineAsmDiagnosticContext();
90 SrcMgr.setDiagHandler(SrcMgrDiagHandler, &DiagInfo);
Chris Lattner6eb78062010-04-06 00:55:39 +000091 HasDiagHandler = true;
92 }
Jim Grosbach2b2de242010-10-01 23:29:12 +000093
Chris Lattneraf632c92010-04-05 23:11:24 +000094 MemoryBuffer *Buffer;
95 if (isNullTerminated)
96 Buffer = MemoryBuffer::getMemBuffer(Str, "<inline asm>");
97 else
98 Buffer = MemoryBuffer::getMemBufferCopy(Str, "<inline asm>");
99
100 // Tell SrcMgr about this buffer, it takes ownership of the buffer.
101 SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
Jim Grosbach2b2de242010-10-01 23:29:12 +0000102
Daniel Dunbar9fbb37e2010-07-18 18:31:33 +0000103 OwningPtr<MCAsmParser> Parser(createMCAsmParser(TM.getTarget(), SrcMgr,
104 OutContext, OutStreamer,
105 *MAI));
Daniel Dunbard73ada72010-07-19 00:33:49 +0000106 OwningPtr<TargetAsmParser> TAP(TM.getTarget().createAsmParser(*Parser, TM));
Chris Lattneraf632c92010-04-05 23:11:24 +0000107 if (!TAP)
Chris Lattner75361b62010-04-07 22:58:41 +0000108 report_fatal_error("Inline asm not supported by this streamer because"
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000109 " we don't have an asm parser for this target\n");
Daniel Dunbar9fbb37e2010-07-18 18:31:33 +0000110 Parser->setTargetParser(*TAP.get());
Chris Lattneraf632c92010-04-05 23:11:24 +0000111
112 // Don't implicitly switch to the text section before the asm.
Daniel Dunbar9fbb37e2010-07-18 18:31:33 +0000113 int Res = Parser->Run(/*NoInitialTextSection*/ true,
114 /*NoFinalize*/ true);
Chris Lattner6eb78062010-04-06 00:55:39 +0000115 if (Res && !HasDiagHandler)
Chris Lattner75361b62010-04-07 22:58:41 +0000116 report_fatal_error("Error parsing inline asm\n");
Chris Lattner736e31d2010-04-04 18:34:07 +0000117}
118
119
120/// EmitInlineAsm - This method formats and emits the specified machine
121/// instruction that is an inline asm.
122void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
123 assert(MI->isInlineAsm() && "printInlineAsm only works on inline asms");
Jim Grosbach2b2de242010-10-01 23:29:12 +0000124
Chris Lattner736e31d2010-04-04 18:34:07 +0000125 unsigned NumOperands = MI->getNumOperands();
Jim Grosbach2b2de242010-10-01 23:29:12 +0000126
Chris Lattner736e31d2010-04-04 18:34:07 +0000127 // Count the number of register definitions to find the asm string.
128 unsigned NumDefs = 0;
129 for (; MI->getOperand(NumDefs).isReg() && MI->getOperand(NumDefs).isDef();
130 ++NumDefs)
Chris Lattnercf9a4152010-04-07 05:38:05 +0000131 assert(NumDefs != NumOperands-2 && "No asm string?");
Jim Grosbach2b2de242010-10-01 23:29:12 +0000132
Chris Lattner736e31d2010-04-04 18:34:07 +0000133 assert(MI->getOperand(NumDefs).isSymbol() && "No asm string?");
134
135 // Disassemble the AsmStr, printing out the literal pieces, the operands, etc.
136 const char *AsmStr = MI->getOperand(NumDefs).getSymbolName();
137
138 // If this asmstr is empty, just print the #APP/#NOAPP markers.
139 // These are useful to see where empty asm's wound up.
140 if (AsmStr[0] == 0) {
Chris Lattner4c842dd2010-04-05 22:42:30 +0000141 // Don't emit the comments if writing to a .o file.
Chris Lattner736e31d2010-04-04 18:34:07 +0000142 if (!OutStreamer.hasRawTextSupport()) return;
143
144 OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+
145 MAI->getInlineAsmStart());
146 OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+
147 MAI->getInlineAsmEnd());
148 return;
149 }
150
151 // Emit the #APP start marker. This has to happen even if verbose-asm isn't
152 // enabled, so we use EmitRawText.
153 if (OutStreamer.hasRawTextSupport())
154 OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+
155 MAI->getInlineAsmStart());
156
Chris Lattnercf9a4152010-04-07 05:38:05 +0000157 // Get the !srcloc metadata node if we have it, and decode the loc cookie from
158 // it.
159 unsigned LocCookie = 0;
Chris Lattnera38941d2010-11-17 07:53:40 +0000160 const MDNode *LocMD = 0;
Chris Lattnerd0024fe2010-04-08 18:20:52 +0000161 for (unsigned i = MI->getNumOperands(); i != 0; --i) {
Chris Lattnera38941d2010-11-17 07:53:40 +0000162 if (MI->getOperand(i-1).isMetadata() &&
163 (LocMD = MI->getOperand(i-1).getMetadata()) &&
164 LocMD->getNumOperands() != 0) {
165 if (const ConstantInt *CI = dyn_cast<ConstantInt>(LocMD->getOperand(0))) {
166 LocCookie = CI->getZExtValue();
167 break;
168 }
169 }
Chris Lattnercf9a4152010-04-07 05:38:05 +0000170 }
Jim Grosbach2b2de242010-10-01 23:29:12 +0000171
Chris Lattner736e31d2010-04-04 18:34:07 +0000172 // Emit the inline asm to a temporary string so we can emit it through
173 // EmitInlineAsm.
174 SmallString<256> StringData;
175 raw_svector_ostream OS(StringData);
Jim Grosbach2b2de242010-10-01 23:29:12 +0000176
Chris Lattner736e31d2010-04-04 18:34:07 +0000177 OS << '\t';
178
179 // The variant of the current asmprinter.
180 int AsmPrinterVariant = MAI->getAssemblerDialect();
181
182 int CurVariant = -1; // The number of the {.|.|.} region we are in.
183 const char *LastEmitted = AsmStr; // One past the last character emitted.
Jim Grosbach2b2de242010-10-01 23:29:12 +0000184
Chris Lattner736e31d2010-04-04 18:34:07 +0000185 while (*LastEmitted) {
186 switch (*LastEmitted) {
187 default: {
188 // Not a special case, emit the string section literally.
189 const char *LiteralEnd = LastEmitted+1;
190 while (*LiteralEnd && *LiteralEnd != '{' && *LiteralEnd != '|' &&
191 *LiteralEnd != '}' && *LiteralEnd != '$' && *LiteralEnd != '\n')
192 ++LiteralEnd;
193 if (CurVariant == -1 || CurVariant == AsmPrinterVariant)
194 OS.write(LastEmitted, LiteralEnd-LastEmitted);
195 LastEmitted = LiteralEnd;
196 break;
197 }
198 case '\n':
199 ++LastEmitted; // Consume newline character.
Chris Lattner4c842dd2010-04-05 22:42:30 +0000200 OS << '\n'; // Indent code with newline.
Chris Lattner736e31d2010-04-04 18:34:07 +0000201 break;
202 case '$': {
203 ++LastEmitted; // Consume '$' character.
204 bool Done = true;
205
206 // Handle escapes.
207 switch (*LastEmitted) {
208 default: Done = false; break;
209 case '$': // $$ -> $
210 if (CurVariant == -1 || CurVariant == AsmPrinterVariant)
211 OS << '$';
212 ++LastEmitted; // Consume second '$' character.
213 break;
214 case '(': // $( -> same as GCC's { character.
215 ++LastEmitted; // Consume '(' character.
Chris Lattnerfee455e2010-04-07 05:27:36 +0000216 if (CurVariant != -1)
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000217 report_fatal_error("Nested variants found in inline asm string: '" +
218 Twine(AsmStr) + "'");
Chris Lattner736e31d2010-04-04 18:34:07 +0000219 CurVariant = 0; // We're in the first variant now.
220 break;
221 case '|':
222 ++LastEmitted; // consume '|' character.
223 if (CurVariant == -1)
224 OS << '|'; // this is gcc's behavior for | outside a variant
225 else
226 ++CurVariant; // We're in the next variant.
227 break;
228 case ')': // $) -> same as GCC's } char.
229 ++LastEmitted; // consume ')' character.
230 if (CurVariant == -1)
231 OS << '}'; // this is gcc's behavior for } outside a variant
Jim Grosbach2b2de242010-10-01 23:29:12 +0000232 else
Chris Lattner736e31d2010-04-04 18:34:07 +0000233 CurVariant = -1;
234 break;
235 }
236 if (Done) break;
Jim Grosbach2b2de242010-10-01 23:29:12 +0000237
Chris Lattner736e31d2010-04-04 18:34:07 +0000238 bool HasCurlyBraces = false;
239 if (*LastEmitted == '{') { // ${variable}
240 ++LastEmitted; // Consume '{' character.
241 HasCurlyBraces = true;
242 }
Jim Grosbach2b2de242010-10-01 23:29:12 +0000243
Chris Lattner736e31d2010-04-04 18:34:07 +0000244 // If we have ${:foo}, then this is not a real operand reference, it is a
245 // "magic" string reference, just like in .td files. Arrange to call
246 // PrintSpecial.
247 if (HasCurlyBraces && *LastEmitted == ':') {
248 ++LastEmitted;
249 const char *StrStart = LastEmitted;
250 const char *StrEnd = strchr(StrStart, '}');
251 if (StrEnd == 0)
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000252 report_fatal_error("Unterminated ${:foo} operand in inline asm"
253 " string: '" + Twine(AsmStr) + "'");
Jim Grosbach2b2de242010-10-01 23:29:12 +0000254
Chris Lattner736e31d2010-04-04 18:34:07 +0000255 std::string Val(StrStart, StrEnd);
256 PrintSpecial(MI, OS, Val.c_str());
257 LastEmitted = StrEnd+1;
258 break;
259 }
Jim Grosbach2b2de242010-10-01 23:29:12 +0000260
Chris Lattner736e31d2010-04-04 18:34:07 +0000261 const char *IDStart = LastEmitted;
Chris Lattner65eeaad2010-04-04 18:42:18 +0000262 const char *IDEnd = IDStart;
Jim Grosbach2b2de242010-10-01 23:29:12 +0000263 while (*IDEnd >= '0' && *IDEnd <= '9') ++IDEnd;
264
Chris Lattner65eeaad2010-04-04 18:42:18 +0000265 unsigned Val;
266 if (StringRef(IDStart, IDEnd-IDStart).getAsInteger(10, Val))
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000267 report_fatal_error("Bad $ operand number in inline asm string: '" +
268 Twine(AsmStr) + "'");
Chris Lattner736e31d2010-04-04 18:34:07 +0000269 LastEmitted = IDEnd;
Jim Grosbach2b2de242010-10-01 23:29:12 +0000270
Chris Lattner736e31d2010-04-04 18:34:07 +0000271 char Modifier[2] = { 0, 0 };
Jim Grosbach2b2de242010-10-01 23:29:12 +0000272
Chris Lattner736e31d2010-04-04 18:34:07 +0000273 if (HasCurlyBraces) {
274 // If we have curly braces, check for a modifier character. This
275 // supports syntax like ${0:u}, which correspond to "%u0" in GCC asm.
276 if (*LastEmitted == ':') {
277 ++LastEmitted; // Consume ':' character.
Chris Lattner4c842dd2010-04-05 22:42:30 +0000278 if (*LastEmitted == 0)
Chris Lattner75361b62010-04-07 22:58:41 +0000279 report_fatal_error("Bad ${:} expression in inline asm string: '" +
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000280 Twine(AsmStr) + "'");
Jim Grosbach2b2de242010-10-01 23:29:12 +0000281
Chris Lattner736e31d2010-04-04 18:34:07 +0000282 Modifier[0] = *LastEmitted;
283 ++LastEmitted; // Consume modifier character.
284 }
Jim Grosbach2b2de242010-10-01 23:29:12 +0000285
Chris Lattner4c842dd2010-04-05 22:42:30 +0000286 if (*LastEmitted != '}')
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000287 report_fatal_error("Bad ${} expression in inline asm string: '" +
288 Twine(AsmStr) + "'");
Chris Lattner736e31d2010-04-04 18:34:07 +0000289 ++LastEmitted; // Consume '}' character.
290 }
Jim Grosbach2b2de242010-10-01 23:29:12 +0000291
Chris Lattner4c842dd2010-04-05 22:42:30 +0000292 if (Val >= NumOperands-1)
Benjamin Kramer1bd73352010-04-08 10:44:28 +0000293 report_fatal_error("Invalid $ operand number in inline asm string: '" +
294 Twine(AsmStr) + "'");
Jim Grosbach2b2de242010-10-01 23:29:12 +0000295
Chris Lattner736e31d2010-04-04 18:34:07 +0000296 // Okay, we finally have a value number. Ask the target to print this
297 // operand!
298 if (CurVariant == -1 || CurVariant == AsmPrinterVariant) {
Dale Johannesenf1e309e2010-07-02 20:16:09 +0000299 unsigned OpNo = 2;
Chris Lattner736e31d2010-04-04 18:34:07 +0000300
301 bool Error = false;
302
303 // Scan to find the machine operand number for the operand.
304 for (; Val; --Val) {
305 if (OpNo >= MI->getNumOperands()) break;
306 unsigned OpFlags = MI->getOperand(OpNo).getImm();
307 OpNo += InlineAsm::getNumOperandRegisters(OpFlags) + 1;
308 }
309
310 if (OpNo >= MI->getNumOperands()) {
311 Error = true;
312 } else {
313 unsigned OpFlags = MI->getOperand(OpNo).getImm();
314 ++OpNo; // Skip over the ID number.
315
316 if (Modifier[0] == 'l') // labels are target independent
317 // FIXME: What if the operand isn't an MBB, report error?
318 OS << *MI->getOperand(OpNo).getMBB()->getSymbol();
319 else {
320 AsmPrinter *AP = const_cast<AsmPrinter*>(this);
Chris Lattnerfee455e2010-04-07 05:27:36 +0000321 if (InlineAsm::isMemKind(OpFlags)) {
Chris Lattner736e31d2010-04-04 18:34:07 +0000322 Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
323 Modifier[0] ? Modifier : 0,
324 OS);
325 } else {
326 Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
327 Modifier[0] ? Modifier : 0, OS);
328 }
329 }
330 }
331 if (Error) {
332 std::string msg;
333 raw_string_ostream Msg(msg);
Chris Lattner38686bd2010-04-07 23:40:44 +0000334 Msg << "invalid operand in inline asm: '" << AsmStr << "'";
335 MMI->getModule()->getContext().emitError(LocCookie, Msg.str());
Chris Lattner736e31d2010-04-04 18:34:07 +0000336 }
337 }
338 break;
339 }
340 }
341 }
Chris Lattneraf632c92010-04-05 23:11:24 +0000342 OS << '\n' << (char)0; // null terminate string.
Chris Lattnera38941d2010-11-17 07:53:40 +0000343 EmitInlineAsm(OS.str(), LocMD);
Jim Grosbach2b2de242010-10-01 23:29:12 +0000344
Chris Lattner736e31d2010-04-04 18:34:07 +0000345 // Emit the #NOAPP end marker. This has to happen even if verbose-asm isn't
346 // enabled, so we use EmitRawText.
347 if (OutStreamer.hasRawTextSupport())
348 OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+
349 MAI->getInlineAsmEnd());
350}
351
352
353/// PrintSpecial - Print information related to the specified machine instr
354/// that is independent of the operand, and may be independent of the instr
355/// itself. This can be useful for portably encoding the comment character
356/// or other bits of target-specific knowledge into the asmstrings. The
357/// syntax used is ${:comment}. Targets can override this to add support
358/// for their own strange codes.
359void AsmPrinter::PrintSpecial(const MachineInstr *MI, raw_ostream &OS,
360 const char *Code) const {
361 if (!strcmp(Code, "private")) {
362 OS << MAI->getPrivateGlobalPrefix();
363 } else if (!strcmp(Code, "comment")) {
364 OS << MAI->getCommentString();
365 } else if (!strcmp(Code, "uid")) {
366 // Comparing the address of MI isn't sufficient, because machineinstrs may
367 // be allocated to the same address across functions.
Jim Grosbach2b2de242010-10-01 23:29:12 +0000368
Chris Lattner736e31d2010-04-04 18:34:07 +0000369 // If this is a new LastFn instruction, bump the counter.
370 if (LastMI != MI || LastFn != getFunctionNumber()) {
371 ++Counter;
372 LastMI = MI;
373 LastFn = getFunctionNumber();
374 }
375 OS << Counter;
376 } else {
377 std::string msg;
378 raw_string_ostream Msg(msg);
379 Msg << "Unknown special formatter '" << Code
380 << "' for machine instr: " << *MI;
Chris Lattner75361b62010-04-07 22:58:41 +0000381 report_fatal_error(Msg.str());
Jim Grosbach2b2de242010-10-01 23:29:12 +0000382 }
Chris Lattner736e31d2010-04-04 18:34:07 +0000383}
384
385/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
386/// instruction, using the specified assembler variant. Targets should
387/// override this to format as appropriate.
388bool AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
389 unsigned AsmVariant, const char *ExtraCode,
390 raw_ostream &O) {
391 // Target doesn't support this yet!
392 return true;
393}
394
395bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
396 unsigned AsmVariant,
397 const char *ExtraCode, raw_ostream &O) {
398 // Target doesn't support this yet!
399 return true;
400}
401