blob: e608f7ec37a3df5bb60a43c8a7e0bbb68c0410df [file] [log] [blame]
Chris Lattner7c90f732006-02-05 05:50:24 +00001//===-- SparcAsmPrinter.cpp - Sparc LLVM assembly writer ------------------===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Brian Gaeke4acfd032004-03-04 06:00:41 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanb5f662f2005-04-21 23:30:14 +00007//
Brian Gaeke4acfd032004-03-04 06:00:41 +00008//===----------------------------------------------------------------------===//
9//
10// This file contains a printer that converts from our internal representation
Chris Lattner7c90f732006-02-05 05:50:24 +000011// of machine-dependent LLVM code to GAS-format SPARC assembly language.
Brian Gaeke4acfd032004-03-04 06:00:41 +000012//
13//===----------------------------------------------------------------------===//
14
Chris Lattner95b2c7d2006-12-19 22:59:26 +000015#define DEBUG_TYPE "asm-printer"
Chris Lattner7c90f732006-02-05 05:50:24 +000016#include "Sparc.h"
17#include "SparcInstrInfo.h"
Chris Lattner225503a2009-06-19 15:48:10 +000018#include "SparcTargetMachine.h"
Brian Gaeke4acfd032004-03-04 06:00:41 +000019#include "llvm/Constants.h"
20#include "llvm/DerivedTypes.h"
21#include "llvm/Module.h"
Chris Lattner1dbed162005-12-17 07:04:29 +000022#include "llvm/CodeGen/AsmPrinter.h"
Bill Wendlingcb819f12009-02-18 23:12:06 +000023#include "llvm/CodeGen/DwarfWriter.h"
Brian Gaeke4acfd032004-03-04 06:00:41 +000024#include "llvm/CodeGen/MachineFunctionPass.h"
25#include "llvm/CodeGen/MachineConstantPool.h"
26#include "llvm/CodeGen/MachineInstr.h"
Chris Lattner6c2f9e12009-08-19 05:49:37 +000027#include "llvm/MC/MCStreamer.h"
Chris Lattneraf76e592009-08-22 20:48:53 +000028#include "llvm/MC/MCAsmInfo.h"
Chris Lattnerf0144122009-07-28 03:13:23 +000029#include "llvm/Target/TargetLoweringObjectFile.h"
Daniel Dunbar51b198a2009-07-15 20:24:03 +000030#include "llvm/Target/TargetRegistry.h"
Brian Gaeke74dfcf12004-09-02 02:37:43 +000031#include "llvm/ADT/Statistic.h"
32#include "llvm/ADT/StringExtras.h"
33#include "llvm/Support/CommandLine.h"
Chris Lattner6c2f9e12009-08-19 05:49:37 +000034#include "llvm/Support/ErrorHandling.h"
35#include "llvm/Support/FormattedStream.h"
36#include "llvm/Support/Mangler.h"
Jim Laskeyb8df7c22005-08-17 20:04:34 +000037#include "llvm/Support/MathExtras.h"
Brian Gaekea8b00ca2004-03-06 05:30:21 +000038#include <cctype>
Anton Korobeynikovae9f3a32008-02-20 11:08:44 +000039#include <cstring>
Owen Andersonc0078482008-07-10 01:44:27 +000040#include <map>
Brian Gaeke4acfd032004-03-04 06:00:41 +000041using namespace llvm;
42
Chris Lattner95b2c7d2006-12-19 22:59:26 +000043STATISTIC(EmittedInsts, "Number of machine instrs printed");
Brian Gaeke4acfd032004-03-04 06:00:41 +000044
Chris Lattner95b2c7d2006-12-19 22:59:26 +000045namespace {
Bill Wendling57f0db82009-02-24 08:30:20 +000046 class VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
Brian Gaeke4acfd032004-03-04 06:00:41 +000047 /// We name each basic block in a Function with a unique number, so
48 /// that we can consistently refer to them later. This is cleared
49 /// at the beginning of each call to runOnMachineFunction().
50 ///
51 typedef std::map<const Value *, unsigned> ValueMapTy;
52 ValueMapTy NumberForBB;
Owen Anderson2af72d42009-06-26 21:45:04 +000053 unsigned BBNumber;
Bill Wendling57f0db82009-02-24 08:30:20 +000054 public:
David Greene71847812009-07-14 20:18:05 +000055 explicit SparcAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
Chris Lattneraf76e592009-08-22 20:48:53 +000056 const MCAsmInfo *T, bool V)
Daniel Dunbar5bcc8bd2009-07-01 01:48:54 +000057 : AsmPrinter(O, TM, T, V), BBNumber(0) {}
Brian Gaeke4acfd032004-03-04 06:00:41 +000058
Brian Gaeke4acfd032004-03-04 06:00:41 +000059 virtual const char *getPassName() const {
Chris Lattner7c90f732006-02-05 05:50:24 +000060 return "Sparc Assembly Printer";
Brian Gaeke4acfd032004-03-04 06:00:41 +000061 }
62
Chris Lattner40bbebd2009-07-21 18:38:57 +000063 void PrintGlobalVariable(const GlobalVariable *GVar);
Brian Gaeke446ae112004-06-15 19:52:59 +000064 void printOperand(const MachineInstr *MI, int opNum);
Chris Lattnerad7a3e62006-02-10 07:35:42 +000065 void printMemOperand(const MachineInstr *MI, int opNum,
66 const char *Modifier = 0);
Chris Lattner7c90f732006-02-05 05:50:24 +000067 void printCCOperand(const MachineInstr *MI, int opNum);
Chris Lattner6788faa2006-01-31 06:49:09 +000068
Chris Lattner41aefdc2009-08-08 01:32:19 +000069 void printInstruction(const MachineInstr *MI); // autogenerated.
Misha Brukmanb5f662f2005-04-21 23:30:14 +000070 bool runOnMachineFunction(MachineFunction &F);
Anton Korobeynikovf3693302008-10-10 10:15:03 +000071 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
72 unsigned AsmVariant, const char *ExtraCode);
73 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
74 unsigned AsmVariant, const char *ExtraCode);
Brian Gaeke4acfd032004-03-04 06:00:41 +000075 };
76} // end of anonymous namespace
77
Chris Lattner7c90f732006-02-05 05:50:24 +000078#include "SparcGenAsmWriter.inc"
Chris Lattner994b7352005-12-16 06:34:17 +000079
Chris Lattner225503a2009-06-19 15:48:10 +000080
Evan Cheng4eecdeb2008-02-02 08:39:46 +000081/// runOnMachineFunction - This uses the printInstruction()
Brian Gaeke4acfd032004-03-04 06:00:41 +000082/// method to print assembly for each instruction.
83///
Chris Lattner7c90f732006-02-05 05:50:24 +000084bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
Bill Wendling57f0db82009-02-24 08:30:20 +000085 this->MF = &MF;
86
Chris Lattner1dbed162005-12-17 07:04:29 +000087 SetupMachineFunction(MF);
88
Chris Lattnerb5e9eb62005-12-17 07:11:43 +000089 // Print out constants referenced by the function
90 EmitConstantPool(MF.getConstantPool());
91
Brian Gaeke4acfd032004-03-04 06:00:41 +000092 // BBNumber is used here so that a given Printer will never give two
93 // BBs the same name. (If you have a better way, please let me know!)
Brian Gaeke4acfd032004-03-04 06:00:41 +000094
95 O << "\n\n";
Brian Gaeke4acfd032004-03-04 06:00:41 +000096
Chris Lattner29bd9e12006-10-05 02:48:40 +000097 // Print out the label for the function.
98 const Function *F = MF.getFunction();
Chris Lattner6c2f9e12009-08-19 05:49:37 +000099 OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
Bill Wendling20c568f2009-06-30 22:38:32 +0000100 EmitAlignment(MF.getAlignment(), F);
Anton Korobeynikov2a166e92008-08-07 09:53:13 +0000101 O << "\t.globl\t" << CurrentFnName << '\n';
Anton Korobeynikovf5b6a472008-08-08 18:25:07 +0000102
103 printVisibility(CurrentFnName, F->getVisibility());
104
Brian Gaeke54cc3c22004-03-16 22:52:04 +0000105 O << "\t.type\t" << CurrentFnName << ", #function\n";
Brian Gaeke4acfd032004-03-04 06:00:41 +0000106 O << CurrentFnName << ":\n";
Richard Pennington930e4d92009-09-08 12:47:30 +0000107 // Emit pre-function debug information.
108 DW->BeginFunction(&MF);
Brian Gaeke4acfd032004-03-04 06:00:41 +0000109
110 // Number each basic block so that we can consistently refer to them
111 // in PC-relative references.
Chris Lattner29bd9e12006-10-05 02:48:40 +0000112 // FIXME: Why not use the MBB numbers?
Brian Gaeke4acfd032004-03-04 06:00:41 +0000113 NumberForBB.clear();
114 for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
115 I != E; ++I) {
116 NumberForBB[I->getBasicBlock()] = BBNumber++;
117 }
118
119 // Print out code for the function.
120 for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
121 I != E; ++I) {
122 // Print a label for the basic block.
Nate Begemancdf38c42006-05-02 05:37:32 +0000123 if (I != MF.begin()) {
Evan Chengfb8075d2008-02-28 00:43:03 +0000124 printBasicBlockLabel(I, true, true);
Nate Begemancdf38c42006-05-02 05:37:32 +0000125 O << '\n';
126 }
Brian Gaeke4acfd032004-03-04 06:00:41 +0000127 for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
Misha Brukman27177f82005-04-22 18:06:01 +0000128 II != E; ++II) {
Brian Gaeke4acfd032004-03-04 06:00:41 +0000129 // Print the assembly for the instruction.
Chris Lattner0d8fcd32005-12-17 06:54:41 +0000130 printInstruction(II);
Chris Lattner1dbed162005-12-17 07:04:29 +0000131 ++EmittedInsts;
Brian Gaeke4acfd032004-03-04 06:00:41 +0000132 }
133 }
134
Richard Pennington930e4d92009-09-08 12:47:30 +0000135 // Emit post-function debug information.
136 DW->EndFunction(&MF);
137
Brian Gaeke4acfd032004-03-04 06:00:41 +0000138 // We didn't modify anything.
139 return false;
140}
141
Chris Lattner7c90f732006-02-05 05:50:24 +0000142void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
Brian Gaeke446ae112004-06-15 19:52:59 +0000143 const MachineOperand &MO = MI->getOperand (opNum);
Dan Gohman6f0d0242008-02-10 18:45:23 +0000144 const TargetRegisterInfo &RI = *TM.getRegisterInfo();
Brian Gaeke446ae112004-06-15 19:52:59 +0000145 bool CloseParen = false;
Dan Gohmand735b802008-10-03 15:45:36 +0000146 if (MI->getOpcode() == SP::SETHIi && !MO.isReg() && !MO.isImm()) {
Brian Gaeke446ae112004-06-15 19:52:59 +0000147 O << "%hi(";
148 CloseParen = true;
Dan Gohmand735b802008-10-03 15:45:36 +0000149 } else if ((MI->getOpcode() == SP::ORri || MI->getOpcode() == SP::ADDri) &&
150 !MO.isReg() && !MO.isImm()) {
Brian Gaeke446ae112004-06-15 19:52:59 +0000151 O << "%lo(";
152 CloseParen = true;
153 }
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000154 switch (MO.getType()) {
Chris Lattner2d90ac72006-05-04 18:05:43 +0000155 case MachineOperand::MO_Register:
Dan Gohman6f0d0242008-02-10 18:45:23 +0000156 if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
Bill Wendling74ab84c2008-02-26 21:11:01 +0000157 O << "%" << LowercaseString (RI.get(MO.getReg()).AsmName);
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000158 else
159 O << "%reg" << MO.getReg();
Brian Gaeke446ae112004-06-15 19:52:59 +0000160 break;
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000161
Chris Lattner63b3d712006-05-04 17:21:20 +0000162 case MachineOperand::MO_Immediate:
Chris Lattner9a1ceae2007-12-30 20:49:49 +0000163 O << (int)MO.getImm();
Brian Gaeke446ae112004-06-15 19:52:59 +0000164 break;
Nate Begeman37efe672006-04-22 18:53:45 +0000165 case MachineOperand::MO_MachineBasicBlock:
Chris Lattner8aa797a2007-12-30 23:10:15 +0000166 printBasicBlockLabel(MO.getMBB());
Brian Gaeke09c13092004-06-17 19:39:23 +0000167 return;
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000168 case MachineOperand::MO_GlobalAddress:
Chris Lattnerb8158ac2009-07-14 18:17:16 +0000169 O << Mang->getMangledName(MO.getGlobal());
Brian Gaeke446ae112004-06-15 19:52:59 +0000170 break;
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000171 case MachineOperand::MO_ExternalSymbol:
172 O << MO.getSymbolName();
Brian Gaeke446ae112004-06-15 19:52:59 +0000173 break;
Brian Gaeke8a0ae9e2004-06-27 22:50:44 +0000174 case MachineOperand::MO_ConstantPoolIndex:
Chris Lattner33adcfb2009-08-22 21:43:10 +0000175 O << MAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_"
Chris Lattner8aa797a2007-12-30 23:10:15 +0000176 << MO.getIndex();
Brian Gaeke8a0ae9e2004-06-27 22:50:44 +0000177 break;
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000178 default:
Torok Edwinc23197a2009-07-14 16:55:14 +0000179 llvm_unreachable("<unknown operand type>");
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000180 }
Brian Gaeke446ae112004-06-15 19:52:59 +0000181 if (CloseParen) O << ")";
Brian Gaeke62aa28a2004-03-05 08:39:09 +0000182}
183
Chris Lattnerad7a3e62006-02-10 07:35:42 +0000184void SparcAsmPrinter::printMemOperand(const MachineInstr *MI, int opNum,
185 const char *Modifier) {
Chris Lattnerbc83fd92005-12-17 20:04:49 +0000186 printOperand(MI, opNum);
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000187
Chris Lattnerad7a3e62006-02-10 07:35:42 +0000188 // If this is an ADD operand, emit it like normal operands.
189 if (Modifier && !strcmp(Modifier, "arith")) {
190 O << ", ";
191 printOperand(MI, opNum+1);
192 return;
193 }
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000194
Dan Gohmand735b802008-10-03 15:45:36 +0000195 if (MI->getOperand(opNum+1).isReg() &&
Chris Lattner7c90f732006-02-05 05:50:24 +0000196 MI->getOperand(opNum+1).getReg() == SP::G0)
Chris Lattner76acc872005-12-18 02:37:35 +0000197 return; // don't print "+%g0"
Dan Gohmand735b802008-10-03 15:45:36 +0000198 if (MI->getOperand(opNum+1).isImm() &&
Chris Lattner9a1ceae2007-12-30 20:49:49 +0000199 MI->getOperand(opNum+1).getImm() == 0)
Chris Lattner76acc872005-12-18 02:37:35 +0000200 return; // don't print "+0"
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000201
Chris Lattnerbc83fd92005-12-17 20:04:49 +0000202 O << "+";
Dan Gohmand735b802008-10-03 15:45:36 +0000203 if (MI->getOperand(opNum+1).isGlobal() ||
204 MI->getOperand(opNum+1).isCPI()) {
Chris Lattnere1389ad2005-12-18 02:27:00 +0000205 O << "%lo(";
206 printOperand(MI, opNum+1);
207 O << ")";
208 } else {
209 printOperand(MI, opNum+1);
210 }
Chris Lattnerbc83fd92005-12-17 20:04:49 +0000211}
212
Chris Lattner7c90f732006-02-05 05:50:24 +0000213void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
Chris Lattner9a1ceae2007-12-30 20:49:49 +0000214 int CC = (int)MI->getOperand(opNum).getImm();
Chris Lattner7c90f732006-02-05 05:50:24 +0000215 O << SPARCCondCodeToString((SPCC::CondCodes)CC);
Chris Lattner6788faa2006-01-31 06:49:09 +0000216}
217
Chris Lattner40bbebd2009-07-21 18:38:57 +0000218void SparcAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000219 const TargetData *TD = TM.getTargetData();
220
221 if (!GVar->hasInitializer())
222 return; // External global require no code
223
224 // Check to see if this is a special global used by LLVM, if so, emit it.
225 if (EmitSpecialLLVMGlobal(GVar))
226 return;
227
228 O << "\n\n";
Chris Lattnerb8158ac2009-07-14 18:17:16 +0000229 std::string name = Mang->getMangledName(GVar);
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000230 Constant *C = GVar->getInitializer();
Duncan Sands777d2302009-05-09 07:06:46 +0000231 unsigned Size = TD->getTypeAllocSize(C->getType());
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000232 unsigned Align = TD->getPreferredAlignment(GVar);
233
Anton Korobeynikovf5b6a472008-08-08 18:25:07 +0000234 printVisibility(name, GVar->getVisibility());
235
Chris Lattner6c2f9e12009-08-19 05:49:37 +0000236 OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GVar, Mang,
237 TM));
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000238
239 if (C->isNullValue() && !GVar->hasSection()) {
240 if (!GVar->isThreadLocal() &&
Duncan Sands667d4b82009-03-07 15:45:40 +0000241 (GVar->hasLocalLinkage() || GVar->isWeakForLinker())) {
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000242 if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
243
Rafael Espindolabb46f522009-01-15 20:18:42 +0000244 if (GVar->hasLocalLinkage())
Anton Korobeynikov2a166e92008-08-07 09:53:13 +0000245 O << "\t.local " << name << '\n';
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000246
Chris Lattner33adcfb2009-08-22 21:43:10 +0000247 O << MAI->getCOMMDirective() << name << ',' << Size;
248 if (MAI->getCOMMDirectiveTakesAlignment())
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000249 O << ',' << (1 << Align);
250
251 O << '\n';
252 return;
253 }
254 }
255
256 switch (GVar->getLinkage()) {
Duncan Sands4dc2b392009-03-11 20:14:15 +0000257 case GlobalValue::CommonLinkage:
Duncan Sands667d4b82009-03-07 15:45:40 +0000258 case GlobalValue::LinkOnceAnyLinkage:
259 case GlobalValue::LinkOnceODRLinkage:
260 case GlobalValue::WeakAnyLinkage: // FIXME: Verify correct for weak.
261 case GlobalValue::WeakODRLinkage: // FIXME: Verify correct for weak.
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000262 // Nonnull linkonce -> weak
Anton Korobeynikov2a166e92008-08-07 09:53:13 +0000263 O << "\t.weak " << name << '\n';
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000264 break;
265 case GlobalValue::AppendingLinkage:
266 // FIXME: appending linkage variables should go into a section of
267 // their name or something. For now, just emit them as external.
268 case GlobalValue::ExternalLinkage:
269 // If external or appending, declare as a global symbol
Chris Lattner33adcfb2009-08-22 21:43:10 +0000270 O << MAI->getGlobalDirective() << name << '\n';
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000271 // FALL THROUGH
Rafael Espindolabb46f522009-01-15 20:18:42 +0000272 case GlobalValue::PrivateLinkage:
Bill Wendling3d10a5a2009-07-20 01:03:30 +0000273 case GlobalValue::LinkerPrivateLinkage:
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000274 case GlobalValue::InternalLinkage:
275 break;
276 case GlobalValue::GhostLinkage:
Torok Edwinc23197a2009-07-14 16:55:14 +0000277 llvm_unreachable("Should not have any unmaterialized functions!");
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000278 case GlobalValue::DLLImportLinkage:
Torok Edwinc23197a2009-07-14 16:55:14 +0000279 llvm_unreachable("DLLImport linkage is not supported by this target!");
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000280 case GlobalValue::DLLExportLinkage:
Torok Edwinc23197a2009-07-14 16:55:14 +0000281 llvm_unreachable("DLLExport linkage is not supported by this target!");
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000282 default:
Torok Edwinc23197a2009-07-14 16:55:14 +0000283 llvm_unreachable("Unknown linkage type!");
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000284 }
285
Anton Korobeynikovfcd99bb2008-08-07 09:53:38 +0000286 EmitAlignment(Align, GVar);
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000287
Chris Lattner33adcfb2009-08-22 21:43:10 +0000288 if (MAI->hasDotTypeDotSizeDirective()) {
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000289 O << "\t.type " << name << ",#object\n";
Anton Korobeynikov2a166e92008-08-07 09:53:13 +0000290 O << "\t.size " << name << ',' << Size << '\n';
Anton Korobeynikov5b794b92008-08-07 09:51:25 +0000291 }
292
293 O << name << ":\n";
294 EmitGlobalConstant(C);
295}
Anton Korobeynikovf3693302008-10-10 10:15:03 +0000296
297/// PrintAsmOperand - Print out an operand for an inline asm expression.
298///
299bool SparcAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
300 unsigned AsmVariant,
301 const char *ExtraCode) {
Anton Korobeynikov4cf5e2e2008-10-10 20:29:50 +0000302 if (ExtraCode && ExtraCode[0]) {
303 if (ExtraCode[1] != 0) return true; // Unknown modifier.
304
305 switch (ExtraCode[0]) {
306 default: return true; // Unknown modifier.
307 case 'r':
308 break;
309 }
310 }
Anton Korobeynikovf3693302008-10-10 10:15:03 +0000311
312 printOperand(MI, OpNo);
313
314 return false;
315}
316
317bool SparcAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
318 unsigned OpNo,
319 unsigned AsmVariant,
320 const char *ExtraCode) {
321 if (ExtraCode && ExtraCode[0])
322 return true; // Unknown modifier
323
324 O << '[';
325 printMemOperand(MI, OpNo);
326 O << ']';
327
328 return false;
329}
Douglas Gregor1555a232009-06-16 20:12:29 +0000330
Bob Wilsona96751f2009-06-23 23:59:40 +0000331// Force static initialization.
Daniel Dunbar51b198a2009-07-15 20:24:03 +0000332extern "C" void LLVMInitializeSparcAsmPrinter() {
Daniel Dunbar0c795d62009-07-25 06:49:55 +0000333 RegisterAsmPrinter<SparcAsmPrinter> X(TheSparcTarget);
Daniel Dunbar51b198a2009-07-15 20:24:03 +0000334}