blob: 1fba4e1ebd4c62173f933f18cf05129d77425d07 [file] [log] [blame]
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00001//===-- ARMAsmPrinter.cpp - ARM LLVM assembly writer ----------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the "Instituto Nokia de Tecnologia" and
6// is distributed under the University of Illinois Open Source
7// License. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10//
11// This file contains a printer that converts from our internal representation
12// of machine-dependent LLVM code to GAS-format ARM assembly language.
13//
14//===----------------------------------------------------------------------===//
15
Chris Lattner95b2c7d2006-12-19 22:59:26 +000016#define DEBUG_TYPE "asm-printer"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000017#include "ARM.h"
Evan Chenga8e29892007-01-19 07:51:42 +000018#include "ARMTargetMachine.h"
19#include "ARMAddressingModes.h"
20#include "ARMConstantPoolValue.h"
21#include "ARMMachineFunctionInfo.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000022#include "llvm/Constants.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000023#include "llvm/Module.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000024#include "llvm/CodeGen/AsmPrinter.h"
Evan Chenga8e29892007-01-19 07:51:42 +000025#include "llvm/CodeGen/DwarfWriter.h"
Jim Laskey44c3b9f2007-01-26 21:22:28 +000026#include "llvm/CodeGen/MachineModuleInfo.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000027#include "llvm/CodeGen/MachineFunctionPass.h"
Evan Chenga8e29892007-01-19 07:51:42 +000028#include "llvm/CodeGen/MachineJumpTableInfo.h"
Jim Laskey563321a2006-09-06 18:34:40 +000029#include "llvm/Target/TargetAsmInfo.h"
Rafael Espindolab01c4bb2006-07-27 11:38:51 +000030#include "llvm/Target/TargetData.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000031#include "llvm/Target/TargetMachine.h"
Evan Cheng5be54b02007-01-19 19:25:36 +000032#include "llvm/Target/TargetOptions.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000033#include "llvm/ADT/Statistic.h"
34#include "llvm/ADT/StringExtras.h"
Evan Chenga8e29892007-01-19 07:51:42 +000035#include "llvm/Support/Compiler.h"
36#include "llvm/Support/Mangler.h"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000037#include "llvm/Support/MathExtras.h"
38#include <cctype>
Evan Chenga8e29892007-01-19 07:51:42 +000039#include <iostream>
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000040using namespace llvm;
41
Chris Lattner95b2c7d2006-12-19 22:59:26 +000042STATISTIC(EmittedInsts, "Number of machine instrs printed");
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000043
Chris Lattner95b2c7d2006-12-19 22:59:26 +000044namespace {
Jim Laskey563321a2006-09-06 18:34:40 +000045 struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
Jim Laskeya0f3d172006-09-07 22:06:40 +000046 ARMAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
Evan Chenga8e29892007-01-19 07:51:42 +000047 : AsmPrinter(O, TM, T), DW(O, this, T), AFI(NULL), InCPMode(false) {
48 Subtarget = &TM.getSubtarget<ARMSubtarget>();
Jim Laskey563321a2006-09-06 18:34:40 +000049 }
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000050
Evan Chenga8e29892007-01-19 07:51:42 +000051 DwarfWriter DW;
52
53 /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
54 /// make the right decision when printing asm code for different targets.
55 const ARMSubtarget *Subtarget;
56
57 /// AFI - Keep a pointer to ARMFunctionInfo for the current
58 /// MachineFunction
59 ARMFunctionInfo *AFI;
60
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000061 /// We name each basic block in a Function with a unique number, so
62 /// that we can consistently refer to them later. This is cleared
63 /// at the beginning of each call to runOnMachineFunction().
64 ///
65 typedef std::map<const Value *, unsigned> ValueMapTy;
66 ValueMapTy NumberForBB;
67
Evan Chenga8e29892007-01-19 07:51:42 +000068 /// Keeps the set of GlobalValues that require non-lazy-pointers for
69 /// indirect access.
70 std::set<std::string> GVNonLazyPtrs;
71
72 /// Keeps the set of external function GlobalAddresses that the asm
73 /// printer should generate stubs for.
74 std::set<std::string> FnStubs;
75
76 /// True if asm printer is printing a series of CONSTPOOL_ENTRY.
77 bool InCPMode;
78
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000079 virtual const char *getPassName() const {
80 return "ARM Assembly Printer";
81 }
82
Evan Chenga8e29892007-01-19 07:51:42 +000083 void printOperand(const MachineInstr *MI, int opNum,
84 const char *Modifier = 0);
85 void printSOImmOperand(const MachineInstr *MI, int opNum);
86 void printSORegOperand(const MachineInstr *MI, int opNum);
87 void printAddrMode2Operand(const MachineInstr *MI, int OpNo);
88 void printAddrMode2OffsetOperand(const MachineInstr *MI, int OpNo);
89 void printAddrMode3Operand(const MachineInstr *MI, int OpNo);
90 void printAddrMode3OffsetOperand(const MachineInstr *MI, int OpNo);
91 void printAddrMode4Operand(const MachineInstr *MI, int OpNo,
92 const char *Modifier = 0);
93 void printAddrMode5Operand(const MachineInstr *MI, int OpNo,
94 const char *Modifier = 0);
95 void printAddrModePCOperand(const MachineInstr *MI, int OpNo,
96 const char *Modifier = 0);
97 void printThumbAddrModeRROperand(const MachineInstr *MI, int OpNo);
98 void printThumbAddrModeRI5Operand(const MachineInstr *MI, int OpNo,
99 unsigned Scale);
Evan Chengc38f2bc2007-01-23 22:59:13 +0000100 void printThumbAddrModeS1Operand(const MachineInstr *MI, int OpNo);
101 void printThumbAddrModeS2Operand(const MachineInstr *MI, int OpNo);
102 void printThumbAddrModeS4Operand(const MachineInstr *MI, int OpNo);
Evan Chenga8e29892007-01-19 07:51:42 +0000103 void printThumbAddrModeSPOperand(const MachineInstr *MI, int OpNo);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000104 void printCCOperand(const MachineInstr *MI, int opNum);
Evan Chenga8e29892007-01-19 07:51:42 +0000105 void printPCLabel(const MachineInstr *MI, int opNum);
106 void printRegisterList(const MachineInstr *MI, int opNum);
107 void printCPInstOperand(const MachineInstr *MI, int opNum,
108 const char *Modifier);
109 void printJTBlockOperand(const MachineInstr *MI, int opNum);
110
111 virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
112 unsigned AsmVariant, const char *ExtraCode);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000113
114 bool printInstruction(const MachineInstr *MI); // autogenerated.
Evan Chenga8e29892007-01-19 07:51:42 +0000115 void printMachineInstruction(const MachineInstr *MI);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000116 bool runOnMachineFunction(MachineFunction &F);
117 bool doInitialization(Module &M);
118 bool doFinalization(Module &M);
Evan Chenga8e29892007-01-19 07:51:42 +0000119
120 virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
121 printDataDirective(MCPV->getType());
122
123 ARMConstantPoolValue *ACPV = (ARMConstantPoolValue*)MCPV;
Lauro Ramos Venancio1a92d942007-01-26 19:51:32 +0000124 GlobalValue *GV = ACPV->getGV();
125 std::string Name = Mang->getValueName(GV);
Evan Chenga8e29892007-01-19 07:51:42 +0000126 if (ACPV->isNonLazyPointer()) {
127 GVNonLazyPtrs.insert(Name);
128 O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr";
129 } else
130 O << Name;
131 if (ACPV->getPCAdjustment() != 0)
132 O << "-(" << TAI->getPrivateGlobalPrefix() << "PC"
133 << utostr(ACPV->getLabelId())
134 << "+" << (unsigned)ACPV->getPCAdjustment() << ")";
135 O << "\n";
Lauro Ramos Venancio1a92d942007-01-26 19:51:32 +0000136
137 // If the constant pool value is a extern weak symbol, remember to emit
138 // the weak reference.
139 if (GV->hasExternalWeakLinkage())
140 ExtWeakSymbols.insert(GV);
Evan Chenga8e29892007-01-19 07:51:42 +0000141 }
142
143 void getAnalysisUsage(AnalysisUsage &AU) const {
144 AU.setPreservesAll();
Jim Laskey44c3b9f2007-01-26 21:22:28 +0000145 AU.addRequired<MachineModuleInfo>();
Evan Chenga8e29892007-01-19 07:51:42 +0000146 }
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000147 };
148} // end of anonymous namespace
149
150#include "ARMGenAsmWriter.inc"
151
152/// createARMCodePrinterPass - Returns a pass that prints the ARM
153/// assembly code for a MachineFunction to the given output stream,
154/// using the given target machine description. This should work
155/// regardless of whether the function is in SSA form.
156///
157FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o,
Evan Chenga8e29892007-01-19 07:51:42 +0000158 ARMTargetMachine &tm) {
Jim Laskeya0f3d172006-09-07 22:06:40 +0000159 return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo());
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000160}
161
Evan Chenga8e29892007-01-19 07:51:42 +0000162/// runOnMachineFunction - This uses the printInstruction()
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000163/// method to print assembly for each instruction.
164///
165bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
Evan Chenga8e29892007-01-19 07:51:42 +0000166 AFI = MF.getInfo<ARMFunctionInfo>();
Rafael Espindola4b442b52006-05-23 02:48:20 +0000167
Evan Cheng5be54b02007-01-19 19:25:36 +0000168 if (Subtarget->isTargetDarwin()) {
Jim Laskey44c3b9f2007-01-26 21:22:28 +0000169 DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
Chris Lattner1a199de2006-12-21 22:59:58 +0000170 }
171
Evan Chenga8e29892007-01-19 07:51:42 +0000172 SetupMachineFunction(MF);
173 O << "\n";
Rafael Espindola4b442b52006-05-23 02:48:20 +0000174
Evan Chenga8e29892007-01-19 07:51:42 +0000175 // NOTE: we don't print out constant pools here, they are handled as
176 // instructions.
177
178 O << "\n";
Rafael Espindola4b442b52006-05-23 02:48:20 +0000179 // Print out labels for the function.
180 const Function *F = MF.getFunction();
181 switch (F->getLinkage()) {
182 default: assert(0 && "Unknown linkage type!");
183 case Function::InternalLinkage:
Evan Chenga8e29892007-01-19 07:51:42 +0000184 SwitchToTextSection("\t.text", F);
Rafael Espindola4b442b52006-05-23 02:48:20 +0000185 break;
186 case Function::ExternalLinkage:
Evan Chenga8e29892007-01-19 07:51:42 +0000187 SwitchToTextSection("\t.text", F);
Rafael Espindola4b442b52006-05-23 02:48:20 +0000188 O << "\t.globl\t" << CurrentFnName << "\n";
189 break;
190 case Function::WeakLinkage:
191 case Function::LinkOnceLinkage:
Evan Cheng5be54b02007-01-19 19:25:36 +0000192 if (Subtarget->isTargetDarwin()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000193 SwitchToTextSection(
194 ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", F);
195 O << "\t.globl\t" << CurrentFnName << "\n";
196 O << "\t.weak_definition\t" << CurrentFnName << "\n";
197 } else {
198 O << TAI->getWeakRefDirective() << CurrentFnName << "\n";
199 }
Rafael Espindola4b442b52006-05-23 02:48:20 +0000200 break;
201 }
Evan Chenga8e29892007-01-19 07:51:42 +0000202
203 if (AFI->isThumbFunction()) {
204 EmitAlignment(1, F);
205 O << "\t.code\t16\n";
206 O << "\t.thumb_func\t" << CurrentFnName << "\n";
207 InCPMode = false;
208 } else
209 EmitAlignment(2, F);
210
Rafael Espindola4b442b52006-05-23 02:48:20 +0000211 O << CurrentFnName << ":\n";
Evan Cheng5be54b02007-01-19 19:25:36 +0000212 if (Subtarget->isTargetDarwin()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000213 // Emit pre-function debug information.
214 DW.BeginFunction(&MF);
215 }
Rafael Espindola4b442b52006-05-23 02:48:20 +0000216
217 // Print out code for the function.
218 for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
219 I != E; ++I) {
220 // Print a label for the basic block.
221 if (I != MF.begin()) {
222 printBasicBlockLabel(I, true);
223 O << '\n';
224 }
225 for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
226 II != E; ++II) {
227 // Print the assembly for the instruction.
Evan Chenga8e29892007-01-19 07:51:42 +0000228 printMachineInstruction(II);
Rafael Espindola4b442b52006-05-23 02:48:20 +0000229 }
230 }
231
Evan Chenga8e29892007-01-19 07:51:42 +0000232 if (TAI->hasDotTypeDotSizeDirective())
233 O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
234
Evan Cheng5be54b02007-01-19 19:25:36 +0000235 if (Subtarget->isTargetDarwin()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000236 // Emit post-function debug information.
237 DW.EndFunction();
238 }
239
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000240 return false;
241}
242
Evan Chenga8e29892007-01-19 07:51:42 +0000243void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
244 const char *Modifier) {
245 const MachineOperand &MO = MI->getOperand(opNum);
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000246 switch (MO.getType()) {
247 case MachineOperand::MO_Register:
248 if (MRegisterInfo::isPhysicalRegister(MO.getReg()))
Evan Chenga8e29892007-01-19 07:51:42 +0000249 O << TM.getRegisterInfo()->get(MO.getReg()).Name;
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000250 else
251 assert(0 && "not implemented");
252 break;
Evan Chenga8e29892007-01-19 07:51:42 +0000253 case MachineOperand::MO_Immediate: {
254 if (!Modifier || strcmp(Modifier, "no_hash") != 0)
255 O << "#";
256
257 O << (int)MO.getImmedValue();
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000258 break;
Evan Chenga8e29892007-01-19 07:51:42 +0000259 }
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000260 case MachineOperand::MO_MachineBasicBlock:
Rafael Espindola687bc492006-08-24 13:45:55 +0000261 printBasicBlockLabel(MO.getMachineBasicBlock());
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000262 return;
Rafael Espindola84b19be2006-07-16 01:02:57 +0000263 case MachineOperand::MO_GlobalAddress: {
Evan Chenga8e29892007-01-19 07:51:42 +0000264 bool isCallOp = Modifier && !strcmp(Modifier, "call");
Rafael Espindola84b19be2006-07-16 01:02:57 +0000265 GlobalValue *GV = MO.getGlobal();
266 std::string Name = Mang->getValueName(GV);
Evan Chenga8e29892007-01-19 07:51:42 +0000267 bool isExt = (GV->isExternal() || GV->hasWeakLinkage() ||
268 GV->hasLinkOnceLinkage());
Evan Cheng5be54b02007-01-19 19:25:36 +0000269 if (isExt && isCallOp && Subtarget->isTargetDarwin() &&
Evan Chenga8e29892007-01-19 07:51:42 +0000270 TM.getRelocationModel() != Reloc::Static) {
271 O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
272 FnStubs.insert(Name);
273 } else
274 O << Name;
275
276 if (GV->hasExternalWeakLinkage())
Rafael Espindola15404d02006-12-18 03:37:18 +0000277 ExtWeakSymbols.insert(GV);
Evan Chenga8e29892007-01-19 07:51:42 +0000278 break;
Rafael Espindola84b19be2006-07-16 01:02:57 +0000279 }
Evan Chenga8e29892007-01-19 07:51:42 +0000280 case MachineOperand::MO_ExternalSymbol: {
281 bool isCallOp = Modifier && !strcmp(Modifier, "call");
282 std::string Name(TAI->getGlobalPrefix());
283 Name += MO.getSymbolName();
Evan Cheng5be54b02007-01-19 19:25:36 +0000284 if (isCallOp && Subtarget->isTargetDarwin() &&
Evan Chenga8e29892007-01-19 07:51:42 +0000285 TM.getRelocationModel() != Reloc::Static) {
286 O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
287 FnStubs.insert(Name);
288 } else
289 O << Name;
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000290 break;
Evan Chenga8e29892007-01-19 07:51:42 +0000291 }
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000292 case MachineOperand::MO_ConstantPoolIndex:
Jim Laskey563321a2006-09-06 18:34:40 +0000293 O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
Rafael Espindola06c1e7e2006-08-01 12:58:43 +0000294 << '_' << MO.getConstantPoolIndex();
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000295 break;
Evan Chenga8e29892007-01-19 07:51:42 +0000296 case MachineOperand::MO_JumpTableIndex:
297 O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
298 << '_' << MO.getJumpTableIndex();
299 break;
Rafael Espindola2f99b6b2006-05-25 12:57:06 +0000300 default:
301 O << "<unknown operand type>"; abort (); break;
302 }
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000303}
304
Evan Chenga8e29892007-01-19 07:51:42 +0000305/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 with 8-bit
306/// immediate in bits 0-7.
307void ARMAsmPrinter::printSOImmOperand(const MachineInstr *MI, int OpNum) {
308 const MachineOperand &MO = MI->getOperand(OpNum);
309 assert(MO.isImmediate() && (MO.getImmedValue() < (1 << 12)) &&
310 "Not a valid so_imm value!");
311 unsigned Imm = ARM_AM::getSOImmValImm(MO.getImmedValue());
312 unsigned Rot = ARM_AM::getSOImmValRot(MO.getImmedValue());
313
314 // Print low-level immediate formation info, per
315 // A5.1.3: "Data-processing operands - Immediate".
316 if (Rot) {
317 O << "#" << Imm << ", " << Rot;
318 // Pretty printed version.
319 O << ' ' << TAI->getCommentString() << ' ' << (int)ARM_AM::rotr32(Imm, Rot);
320 } else {
321 O << "#" << Imm;
322 }
323}
324
325// so_reg is a 4-operand unit corresponding to register forms of the A5.1
326// "Addressing Mode 1 - Data-processing operands" forms. This includes:
327// REG 0 0 - e.g. R5
328// REG REG 0,SH_OPC - e.g. R5, ROR R3
329// REG 0 IMM,SH_OPC - e.g. R5, LSL #3
330void ARMAsmPrinter::printSORegOperand(const MachineInstr *MI, int Op) {
331 const MachineOperand &MO1 = MI->getOperand(Op);
332 const MachineOperand &MO2 = MI->getOperand(Op+1);
333 const MachineOperand &MO3 = MI->getOperand(Op+2);
334
335 assert(MRegisterInfo::isPhysicalRegister(MO1.getReg()));
336 O << TM.getRegisterInfo()->get(MO1.getReg()).Name;
337
338 // Print the shift opc.
339 O << ", "
340 << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO3.getImmedValue()))
341 << " ";
342
343 if (MO2.getReg()) {
344 assert(MRegisterInfo::isPhysicalRegister(MO2.getReg()));
345 O << TM.getRegisterInfo()->get(MO2.getReg()).Name;
346 assert(ARM_AM::getSORegOffset(MO3.getImm()) == 0);
347 } else {
348 O << "#" << ARM_AM::getSORegOffset(MO3.getImm());
349 }
350}
351
352void ARMAsmPrinter::printAddrMode2Operand(const MachineInstr *MI, int Op) {
353 const MachineOperand &MO1 = MI->getOperand(Op);
354 const MachineOperand &MO2 = MI->getOperand(Op+1);
355 const MachineOperand &MO3 = MI->getOperand(Op+2);
356
357 if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
358 printOperand(MI, Op);
359 return;
360 }
361
362 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
363
364 if (!MO2.getReg()) {
365 if (ARM_AM::getAM2Offset(MO3.getImm())) // Don't print +0.
366 O << ", #"
367 << (char)ARM_AM::getAM2Op(MO3.getImm())
368 << ARM_AM::getAM2Offset(MO3.getImm());
369 O << "]";
370 return;
371 }
372
373 O << ", "
374 << (char)ARM_AM::getAM2Op(MO3.getImm())
375 << TM.getRegisterInfo()->get(MO2.getReg()).Name;
376
377 if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm()))
378 O << ", "
379 << ARM_AM::getShiftOpcStr(ARM_AM::getAM2ShiftOpc(MO3.getImmedValue()))
380 << " #" << ShImm;
381 O << "]";
382}
383
384void ARMAsmPrinter::printAddrMode2OffsetOperand(const MachineInstr *MI, int Op){
385 const MachineOperand &MO1 = MI->getOperand(Op);
386 const MachineOperand &MO2 = MI->getOperand(Op+1);
387
388 if (!MO1.getReg()) {
389 if (ARM_AM::getAM2Offset(MO2.getImm())) // Don't print +0.
390 O << "#"
391 << (char)ARM_AM::getAM2Op(MO2.getImm())
392 << ARM_AM::getAM2Offset(MO2.getImm());
393 return;
394 }
395
396 O << (char)ARM_AM::getAM2Op(MO2.getImm())
397 << TM.getRegisterInfo()->get(MO1.getReg()).Name;
398
399 if (unsigned ShImm = ARM_AM::getAM2Offset(MO2.getImm()))
400 O << ", "
401 << ARM_AM::getShiftOpcStr(ARM_AM::getAM2ShiftOpc(MO2.getImmedValue()))
402 << " #" << ShImm;
403}
404
405void ARMAsmPrinter::printAddrMode3Operand(const MachineInstr *MI, int Op) {
406 const MachineOperand &MO1 = MI->getOperand(Op);
407 const MachineOperand &MO2 = MI->getOperand(Op+1);
408 const MachineOperand &MO3 = MI->getOperand(Op+2);
409
410 assert(MRegisterInfo::isPhysicalRegister(MO1.getReg()));
411 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
412
413 if (MO2.getReg()) {
414 O << ", "
415 << (char)ARM_AM::getAM3Op(MO3.getImm())
416 << TM.getRegisterInfo()->get(MO2.getReg()).Name
417 << "]";
418 return;
419 }
420
421 if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm()))
422 O << ", #"
423 << (char)ARM_AM::getAM3Op(MO3.getImm())
424 << ImmOffs;
425 O << "]";
426}
427
428void ARMAsmPrinter::printAddrMode3OffsetOperand(const MachineInstr *MI, int Op){
429 const MachineOperand &MO1 = MI->getOperand(Op);
430 const MachineOperand &MO2 = MI->getOperand(Op+1);
431
432 if (MO1.getReg()) {
433 O << (char)ARM_AM::getAM3Op(MO2.getImm())
434 << TM.getRegisterInfo()->get(MO1.getReg()).Name;
435 return;
436 }
437
438 unsigned ImmOffs = ARM_AM::getAM3Offset(MO2.getImm());
439 O << "#"
440 << (char)ARM_AM::getAM3Op(MO2.getImm())
441 << ImmOffs;
442}
443
444void ARMAsmPrinter::printAddrMode4Operand(const MachineInstr *MI, int Op,
445 const char *Modifier) {
446 const MachineOperand &MO1 = MI->getOperand(Op);
447 const MachineOperand &MO2 = MI->getOperand(Op+1);
448 ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO2.getImm());
449 if (Modifier && strcmp(Modifier, "submode") == 0) {
450 if (MO1.getReg() == ARM::SP) {
451 bool isLDM = (MI->getOpcode() == ARM::LDM ||
452 MI->getOpcode() == ARM::LDM_RET);
453 O << ARM_AM::getAMSubModeAltStr(Mode, isLDM);
454 } else
455 O << ARM_AM::getAMSubModeStr(Mode);
456 } else {
457 printOperand(MI, Op);
458 if (ARM_AM::getAM4WBFlag(MO2.getImm()))
459 O << "!";
460 }
461}
462
463void ARMAsmPrinter::printAddrMode5Operand(const MachineInstr *MI, int Op,
464 const char *Modifier) {
465 const MachineOperand &MO1 = MI->getOperand(Op);
466 const MachineOperand &MO2 = MI->getOperand(Op+1);
467
468 if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
469 printOperand(MI, Op);
470 return;
471 }
472
473 assert(MRegisterInfo::isPhysicalRegister(MO1.getReg()));
474
475 if (Modifier && strcmp(Modifier, "submode") == 0) {
476 ARM_AM::AMSubMode Mode = ARM_AM::getAM5SubMode(MO2.getImm());
477 if (MO1.getReg() == ARM::SP) {
478 bool isFLDM = (MI->getOpcode() == ARM::FLDMD ||
479 MI->getOpcode() == ARM::FLDMS);
480 O << ARM_AM::getAMSubModeAltStr(Mode, isFLDM);
481 } else
482 O << ARM_AM::getAMSubModeStr(Mode);
483 return;
484 } else if (Modifier && strcmp(Modifier, "base") == 0) {
485 // Used for FSTM{D|S} and LSTM{D|S} operations.
486 O << TM.getRegisterInfo()->get(MO1.getReg()).Name;
487 if (ARM_AM::getAM5WBFlag(MO2.getImm()))
488 O << "!";
489 return;
490 }
491
492 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
493
494 if (unsigned ImmOffs = ARM_AM::getAM5Offset(MO2.getImm())) {
495 O << ", #"
496 << (char)ARM_AM::getAM5Op(MO2.getImm())
497 << ImmOffs*4;
498 }
499 O << "]";
500}
501
502void ARMAsmPrinter::printAddrModePCOperand(const MachineInstr *MI, int Op,
503 const char *Modifier) {
504 if (Modifier && strcmp(Modifier, "label") == 0) {
505 printPCLabel(MI, Op+1);
506 return;
507 }
508
509 const MachineOperand &MO1 = MI->getOperand(Op);
510 assert(MRegisterInfo::isPhysicalRegister(MO1.getReg()));
511 O << "[pc, +" << TM.getRegisterInfo()->get(MO1.getReg()).Name << "]";
512}
513
514void
515ARMAsmPrinter::printThumbAddrModeRROperand(const MachineInstr *MI, int Op) {
516 const MachineOperand &MO1 = MI->getOperand(Op);
517 const MachineOperand &MO2 = MI->getOperand(Op+1);
518 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
519 O << ", " << TM.getRegisterInfo()->get(MO2.getReg()).Name << "]";
520}
521
522void
523ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op,
524 unsigned Scale) {
525 const MachineOperand &MO1 = MI->getOperand(Op);
Evan Chengc38f2bc2007-01-23 22:59:13 +0000526 const MachineOperand &MO2 = MI->getOperand(Op+2);
Evan Chenga8e29892007-01-19 07:51:42 +0000527
528 if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right.
529 printOperand(MI, Op);
530 return;
531 }
532
533 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
534 if (unsigned ImmOffs = MO2.getImm()) {
535 O << ", #" << ImmOffs;
536 if (Scale > 1)
537 O << " * " << Scale;
538 }
539 O << "]";
540}
541
542void
Evan Chengc38f2bc2007-01-23 22:59:13 +0000543ARMAsmPrinter::printThumbAddrModeS1Operand(const MachineInstr *MI, int Op) {
544 if (MI->getOperand(Op+1).getReg())
545 printThumbAddrModeRROperand(MI, Op);
546 else
547 printThumbAddrModeRI5Operand(MI, Op, 1);
Evan Chenga8e29892007-01-19 07:51:42 +0000548}
549void
Evan Chengc38f2bc2007-01-23 22:59:13 +0000550ARMAsmPrinter::printThumbAddrModeS2Operand(const MachineInstr *MI, int Op) {
551 if (MI->getOperand(Op+1).getReg())
552 printThumbAddrModeRROperand(MI, Op);
553 else
554 printThumbAddrModeRI5Operand(MI, Op, 2);
Evan Chenga8e29892007-01-19 07:51:42 +0000555}
556void
Evan Chengc38f2bc2007-01-23 22:59:13 +0000557ARMAsmPrinter::printThumbAddrModeS4Operand(const MachineInstr *MI, int Op) {
558 if (MI->getOperand(Op+1).getReg())
559 printThumbAddrModeRROperand(MI, Op);
560 else
561 printThumbAddrModeRI5Operand(MI, Op, 4);
Evan Chenga8e29892007-01-19 07:51:42 +0000562}
563
564void ARMAsmPrinter::printThumbAddrModeSPOperand(const MachineInstr *MI,int Op) {
565 const MachineOperand &MO1 = MI->getOperand(Op);
566 const MachineOperand &MO2 = MI->getOperand(Op+1);
567 O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name;
568 if (unsigned ImmOffs = MO2.getImm())
569 O << ", #" << ImmOffs << " * 4";
570 O << "]";
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000571}
572
573void ARMAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
Rafael Espindola6f602de2006-08-24 16:13:15 +0000574 int CC = (int)MI->getOperand(opNum).getImmedValue();
575 O << ARMCondCodeToString((ARMCC::CondCodes)CC);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000576}
577
Evan Chenga8e29892007-01-19 07:51:42 +0000578void ARMAsmPrinter::printPCLabel(const MachineInstr *MI, int opNum) {
579 int Id = (int)MI->getOperand(opNum).getImmedValue();
580 O << TAI->getPrivateGlobalPrefix() << "PC" << Id;
581}
582
583void ARMAsmPrinter::printRegisterList(const MachineInstr *MI, int opNum) {
584 O << "{";
585 for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) {
586 printOperand(MI, i);
587 if (i != e-1) O << ", ";
588 }
589 O << "}";
590}
591
592void ARMAsmPrinter::printCPInstOperand(const MachineInstr *MI, int OpNo,
593 const char *Modifier) {
594 assert(Modifier && "This operand only works with a modifier!");
595 // There are two aspects to a CONSTANTPOOL_ENTRY operand, the label and the
596 // data itself.
597 if (!strcmp(Modifier, "label")) {
598 unsigned ID = MI->getOperand(OpNo).getImm();
599 O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
600 << '_' << ID << ":\n";
601 } else {
602 assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for CPE");
603 unsigned CPI = MI->getOperand(OpNo).getConstantPoolIndex();
604
605 const MachineConstantPoolEntry &MCPE = // Chasing pointers is fun?
606 MI->getParent()->getParent()->getConstantPool()->getConstants()[CPI];
607
608 if (MCPE.isMachineConstantPoolEntry())
609 EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
610 else
611 EmitGlobalConstant(MCPE.Val.ConstVal);
612 }
613}
614
615void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNo) {
616 const MachineOperand &MO1 = MI->getOperand(OpNo);
617 const MachineOperand &MO2 = MI->getOperand(OpNo+1); // Unique Id
618 unsigned JTI = MO1.getJumpTableIndex();
619 O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
620 << '_' << JTI << '_' << MO2.getImmedValue() << ":\n";
621
622 const char *JTEntryDirective = TAI->getJumpTableDirective();
623 if (!JTEntryDirective)
624 JTEntryDirective = TAI->getData32bitsDirective();
625
626 const MachineFunction *MF = MI->getParent()->getParent();
627 MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
628 const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
629 const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
630 bool UseSet= TAI->getSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
631 std::set<MachineBasicBlock*> JTSets;
632 for (unsigned i = 0, e = JTBBs.size(); i != e; ++i) {
633 MachineBasicBlock *MBB = JTBBs[i];
634 if (UseSet && JTSets.insert(MBB).second)
635 printSetLabel(JTI, MO2.getImmedValue(), MBB);
636
637 O << JTEntryDirective << ' ';
638 if (UseSet)
639 O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
640 << '_' << JTI << '_' << MO2.getImmedValue()
641 << "_set_" << MBB->getNumber();
642 else if (TM.getRelocationModel() == Reloc::PIC_) {
643 printBasicBlockLabel(MBB, false, false);
644 // If the arch uses custom Jump Table directives, don't calc relative to JT
645 if (!TAI->getJumpTableDirective())
646 O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
647 << getFunctionNumber() << '_' << JTI << '_' << MO2.getImmedValue();
648 } else
649 printBasicBlockLabel(MBB, false, false);
650 O << '\n';
651 }
652}
653
654
655bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
656 unsigned AsmVariant, const char *ExtraCode){
657 // Does this asm operand have a single letter operand modifier?
658 if (ExtraCode && ExtraCode[0]) {
659 if (ExtraCode[1] != 0) return true; // Unknown modifier.
660
661 switch (ExtraCode[0]) {
662 default: return true; // Unknown modifier.
663 case 'Q':
664 if (TM.getTargetData()->isLittleEndian())
665 break;
666 // Fallthrough
667 case 'R':
668 if (TM.getTargetData()->isBigEndian())
669 break;
670 // Fallthrough
671 case 'H': // Write second word of DI / DF reference.
672 // Verify that this operand has two consecutive registers.
673 if (!MI->getOperand(OpNo).isRegister() ||
674 OpNo+1 == MI->getNumOperands() ||
675 !MI->getOperand(OpNo+1).isRegister())
676 return true;
677 ++OpNo; // Return the high-part.
678 }
679 }
680
681 printOperand(MI, OpNo);
682 return false;
683}
684
685void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
686 ++EmittedInsts;
687
688 if (MI->getOpcode() == ARM::CONSTPOOL_ENTRY) {
689 if (!InCPMode && AFI->isThumbFunction()) {
690 EmitAlignment(2);
691 InCPMode = true;
692 }
693 } else {
694 if (InCPMode && AFI->isThumbFunction()) {
695 EmitAlignment(1);
696 InCPMode = false;
697 }
698 O << "\t";
699 }
700
701 // Call the autogenerated instruction printer routines.
702 printInstruction(MI);
703}
704
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000705bool ARMAsmPrinter::doInitialization(Module &M) {
Evan Cheng5be54b02007-01-19 19:25:36 +0000706 if (Subtarget->isTargetDarwin()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000707 // Emit initial debug information.
708 DW.BeginModule(&M);
709 }
710
711 return AsmPrinter::doInitialization(M);
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000712}
713
714bool ARMAsmPrinter::doFinalization(Module &M) {
Rafael Espindolab01c4bb2006-07-27 11:38:51 +0000715 const TargetData *TD = TM.getTargetData();
716
717 for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
718 I != E; ++I) {
719 if (!I->hasInitializer()) // External global require no code
720 continue;
721
722 if (EmitSpecialLLVMGlobal(I))
723 continue;
724
Rafael Espindolab01c4bb2006-07-27 11:38:51 +0000725 std::string name = Mang->getValueName(I);
726 Constant *C = I->getInitializer();
727 unsigned Size = TD->getTypeSize(C->getType());
Evan Chenga8e29892007-01-19 07:51:42 +0000728 unsigned Align = TD->getPreferredAlignmentLog(I);
Rafael Espindolab01c4bb2006-07-27 11:38:51 +0000729
Evan Cheng5be54b02007-01-19 19:25:36 +0000730 if (I->hasHiddenVisibility())
731 if (const char *Directive = TAI->getHiddenDirective())
732 O << Directive << name << "\n";
733 if (Subtarget->isTargetELF())
Lauro Ramos Venanciob1cc0522007-01-25 20:11:04 +0000734 O << "\t.type " << name << ",%object\n";
Evan Cheng5be54b02007-01-19 19:25:36 +0000735
736 if (C->isNullValue()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000737 if (I->hasExternalLinkage()) {
Evan Cheng5be54b02007-01-19 19:25:36 +0000738 if (const char *Directive = TAI->getZeroFillDirective()) {
Evan Chenga8e29892007-01-19 07:51:42 +0000739 O << "\t.globl\t" << name << "\n";
Evan Cheng5be54b02007-01-19 19:25:36 +0000740 O << Directive << "__DATA__, __common, " << name << ", "
741 << Size << ", " << Align << "\n";
742 continue;
743 }
744 }
745
746 if (!I->hasSection() &&
747 (I->hasInternalLinkage() || I->hasWeakLinkage() ||
748 I->hasLinkOnceLinkage())) {
749 if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
750 if (!NoZerosInBSS && TAI->getBSSSection())
751 SwitchToDataSection(TAI->getBSSSection(), I);
752 else
753 SwitchToDataSection(TAI->getDataSection(), I);
Evan Chenga8e29892007-01-19 07:51:42 +0000754 if (TAI->getLCOMMDirective() != NULL) {
755 if (I->hasInternalLinkage()) {
756 O << TAI->getLCOMMDirective() << name << "," << Size;
Evan Cheng5be54b02007-01-19 19:25:36 +0000757 if (Subtarget->isTargetDarwin())
Evan Chenga8e29892007-01-19 07:51:42 +0000758 O << "," << Align;
759 } else
760 O << TAI->getCOMMDirective() << name << "," << Size;
761 } else {
762 if (I->hasInternalLinkage())
763 O << "\t.local\t" << name << "\n";
764 O << TAI->getCOMMDirective() << name << "," << Size;
765 if (TAI->getCOMMDirectiveTakesAlignment())
766 O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
767 }
Evan Cheng5be54b02007-01-19 19:25:36 +0000768 O << "\t\t" << TAI->getCommentString() << " " << I->getName() << "\n";
769 continue;
Evan Chenga8e29892007-01-19 07:51:42 +0000770 }
Evan Cheng5be54b02007-01-19 19:25:36 +0000771 }
Evan Chenga8e29892007-01-19 07:51:42 +0000772
Evan Cheng5be54b02007-01-19 19:25:36 +0000773 switch (I->getLinkage()) {
774 case GlobalValue::LinkOnceLinkage:
775 case GlobalValue::WeakLinkage:
776 if (Subtarget->isTargetDarwin()) {
777 O << "\t.globl " << name << "\n"
778 << "\t.weak_definition " << name << "\n";
779 SwitchToDataSection("\t.section __DATA,__const_coal,coalesced", I);
780 } else {
781 std::string SectionName("\t.section\t.llvm.linkonce.d." +
782 name +
783 ",\"aw\",%progbits");
784 SwitchToDataSection(SectionName.c_str(), I);
785 O << "\t.weak " << name << "\n";
786 }
787 break;
788 case GlobalValue::AppendingLinkage:
789 // FIXME: appending linkage variables should go into a section of
790 // their name or something. For now, just emit them as external.
791 case GlobalValue::ExternalLinkage:
792 O << "\t.globl " << name << "\n";
793 // FALL THROUGH
794 case GlobalValue::InternalLinkage: {
795 if (I->isConstant()) {
796 const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
797 if (TAI->getCStringSection() && CVA && CVA->isCString()) {
798 SwitchToDataSection(TAI->getCStringSection(), I);
799 break;
800 }
801 }
802 // FIXME: special handling for ".ctors" & ".dtors" sections
803 if (I->hasSection() &&
804 (I->getSection() == ".ctors" ||
805 I->getSection() == ".dtors")) {
806 assert(!Subtarget->isTargetDarwin());
807 std::string SectionName = ".section " + I->getSection();
808 SectionName += ",\"aw\",%progbits";
809 SwitchToDataSection(SectionName.c_str());
810 } else {
811 if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
812 SwitchToDataSection(TAI->getBSSSection(), I);
813 else
Evan Chenga8e29892007-01-19 07:51:42 +0000814 SwitchToDataSection(TAI->getDataSection(), I);
Rafael Espindolab97809c2006-10-19 13:30:40 +0000815 }
Evan Cheng5be54b02007-01-19 19:25:36 +0000816
817 break;
818 }
819 default:
820 assert(0 && "Unknown linkage type!");
821 break;
Evan Chenga8e29892007-01-19 07:51:42 +0000822 }
Rafael Espindolab97809c2006-10-19 13:30:40 +0000823
Evan Chenga8e29892007-01-19 07:51:42 +0000824 EmitAlignment(Align, I);
Evan Cheng5be54b02007-01-19 19:25:36 +0000825 O << name << ":\t\t\t\t" << TAI->getCommentString() << " " << I->getName()
826 << "\n";
827 if (TAI->hasDotTypeDotSizeDirective())
Rafael Espindolab97809c2006-10-19 13:30:40 +0000828 O << "\t.size " << name << ", " << Size << "\n";
Evan Chenga8e29892007-01-19 07:51:42 +0000829 // If the initializer is a extern weak symbol, remember to emit the weak
830 // reference!
831 if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
832 if (GV->hasExternalWeakLinkage())
833 ExtWeakSymbols.insert(GV);
834
835 EmitGlobalConstant(C);
836 O << '\n';
837 }
838
Evan Cheng5be54b02007-01-19 19:25:36 +0000839 if (Subtarget->isTargetDarwin()) {
840 SwitchToDataSection("");
841
Evan Chenga8e29892007-01-19 07:51:42 +0000842 // Output stubs for dynamically-linked functions
843 unsigned j = 1;
844 for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
845 i != e; ++i, ++j) {
846 if (TM.getRelocationModel() == Reloc::PIC_)
847 SwitchToTextSection(".section __TEXT,__picsymbolstub4,symbol_stubs,"
848 "none,16", 0);
849 else
850 SwitchToTextSection(".section __TEXT,__symbol_stub4,symbol_stubs,"
851 "none,12", 0);
852
853 EmitAlignment(2);
854 O << "\t.code\t32\n";
855
856 O << "L" << *i << "$stub:\n";
857 O << "\t.indirect_symbol " << *i << "\n";
858 O << "\tldr ip, L" << *i << "$slp\n";
859 if (TM.getRelocationModel() == Reloc::PIC_) {
860 O << "L" << *i << "$scv:\n";
861 O << "\tadd ip, pc, ip\n";
862 }
863 O << "\tldr pc, [ip, #0]\n";
864 O << "L" << *i << "$slp:\n";
865 if (TM.getRelocationModel() == Reloc::PIC_)
866 O << "\t.long\tL" << *i << "$lazy_ptr-(L" << *i << "$scv+8)\n";
867 else
868 O << "\t.long\tL" << *i << "$lazy_ptr\n";
869 SwitchToDataSection(".lazy_symbol_pointer", 0);
870 O << "L" << *i << "$lazy_ptr:\n";
871 O << "\t.indirect_symbol " << *i << "\n";
872 O << "\t.long\tdyld_stub_binding_helper\n";
873 }
874 O << "\n";
875
876 // Output non-lazy-pointers for external and common global variables.
877 if (GVNonLazyPtrs.begin() != GVNonLazyPtrs.end())
878 SwitchToDataSection(".non_lazy_symbol_pointer", 0);
879 for (std::set<std::string>::iterator i = GVNonLazyPtrs.begin(),
880 e = GVNonLazyPtrs.end(); i != e; ++i) {
881 O << "L" << *i << "$non_lazy_ptr:\n";
882 O << "\t.indirect_symbol " << *i << "\n";
883 O << "\t.long\t0\n";
884 }
885
886 // Emit initial debug information.
887 DW.EndModule();
888
889 // Funny Darwin hack: This flag tells the linker that no global symbols
890 // contain code that falls through to other global symbols (e.g. the obvious
891 // implementation of multiple entry points). If this doesn't occur, the
892 // linker can safely perform dead code stripping. Since LLVM never
893 // generates code that does this, it is always safe to set.
894 O << "\t.subsections_via_symbols\n";
Rafael Espindolab01c4bb2006-07-27 11:38:51 +0000895 }
Rafael Espindolab97809c2006-10-19 13:30:40 +0000896
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000897 AsmPrinter::doFinalization(M);
898 return false; // success
899}