Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 1 | //===-- SparcV8AsmPrinter.cpp - SparcV8 LLVM assembly writer --------------===// |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 2 | // |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 7 | // |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains a printer that converts from our internal representation |
| 11 | // of machine-dependent LLVM code to GAS-format Sparc V8 assembly language. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "SparcV8.h" |
| 16 | #include "SparcV8InstrInfo.h" |
| 17 | #include "llvm/Constants.h" |
| 18 | #include "llvm/DerivedTypes.h" |
| 19 | #include "llvm/Module.h" |
| 20 | #include "llvm/Assembly/Writer.h" |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/AsmPrinter.h" |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 22 | #include "llvm/CodeGen/MachineFunctionPass.h" |
| 23 | #include "llvm/CodeGen/MachineConstantPool.h" |
| 24 | #include "llvm/CodeGen/MachineInstr.h" |
| 25 | #include "llvm/Target/TargetMachine.h" |
| 26 | #include "llvm/Support/Mangler.h" |
Brian Gaeke | 74dfcf1 | 2004-09-02 02:37:43 +0000 | [diff] [blame] | 27 | #include "llvm/ADT/Statistic.h" |
| 28 | #include "llvm/ADT/StringExtras.h" |
| 29 | #include "llvm/Support/CommandLine.h" |
Jim Laskey | b8df7c2 | 2005-08-17 20:04:34 +0000 | [diff] [blame] | 30 | #include "llvm/Support/MathExtras.h" |
Brian Gaeke | a8b00ca | 2004-03-06 05:30:21 +0000 | [diff] [blame] | 31 | #include <cctype> |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 32 | using namespace llvm; |
| 33 | |
| 34 | namespace { |
| 35 | Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); |
| 36 | |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 37 | struct SparcV8AsmPrinter : public AsmPrinter { |
Chris Lattner | b5e9eb6 | 2005-12-17 07:11:43 +0000 | [diff] [blame] | 38 | SparcV8AsmPrinter(std::ostream &O, TargetMachine &TM) : AsmPrinter(O, TM) { |
| 39 | Data16bitsDirective = "\t.half\t"; |
| 40 | Data32bitsDirective = "\t.word\t"; |
Chris Lattner | 379e6c0 | 2005-12-18 23:36:45 +0000 | [diff] [blame] | 41 | Data64bitsDirective = 0; // .xword is only supported by V9. |
Chris Lattner | 967abf3 | 2005-12-17 07:17:08 +0000 | [diff] [blame] | 42 | ZeroDirective = 0; // no .zero or .space! |
Chris Lattner | 7a48e50 | 2005-12-18 23:35:05 +0000 | [diff] [blame] | 43 | CommentString = "!"; |
| 44 | ConstantPoolSection = "\t.section \".rodata\",#alloc\n"; |
Chris Lattner | b5e9eb6 | 2005-12-17 07:11:43 +0000 | [diff] [blame] | 45 | } |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 46 | |
| 47 | /// 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; |
| 53 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 54 | virtual const char *getPassName() const { |
| 55 | return "SparcV8 Assembly Printer"; |
| 56 | } |
| 57 | |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 58 | void printOperand(const MachineInstr *MI, int opNum); |
Chris Lattner | bc83fd9 | 2005-12-17 20:04:49 +0000 | [diff] [blame] | 59 | void printMemOperand(const MachineInstr *MI, int opNum); |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 60 | bool printInstruction(const MachineInstr *MI); // autogenerated. |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 61 | bool runOnMachineFunction(MachineFunction &F); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 62 | bool doInitialization(Module &M); |
| 63 | bool doFinalization(Module &M); |
| 64 | }; |
| 65 | } // end of anonymous namespace |
| 66 | |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 67 | #include "SparcV8GenAsmWriter.inc" |
| 68 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 69 | /// createSparcV8CodePrinterPass - Returns a pass that prints the SparcV8 |
| 70 | /// assembly code for a MachineFunction to the given output stream, |
| 71 | /// using the given target machine description. This should work |
| 72 | /// regardless of whether the function is in SSA form. |
| 73 | /// |
| 74 | FunctionPass *llvm::createSparcV8CodePrinterPass (std::ostream &o, |
| 75 | TargetMachine &tm) { |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 76 | return new SparcV8AsmPrinter(o, tm); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 77 | } |
| 78 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 79 | /// runOnMachineFunction - This uses the printMachineInstruction() |
| 80 | /// method to print assembly for each instruction. |
| 81 | /// |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 82 | bool SparcV8AsmPrinter::runOnMachineFunction(MachineFunction &MF) { |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 83 | SetupMachineFunction(MF); |
| 84 | |
Chris Lattner | b5e9eb6 | 2005-12-17 07:11:43 +0000 | [diff] [blame] | 85 | // Print out constants referenced by the function |
| 86 | EmitConstantPool(MF.getConstantPool()); |
| 87 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 88 | // BBNumber is used here so that a given Printer will never give two |
| 89 | // BBs the same name. (If you have a better way, please let me know!) |
| 90 | static unsigned BBNumber = 0; |
| 91 | |
| 92 | O << "\n\n"; |
| 93 | // What's my mangled name? |
| 94 | CurrentFnName = Mang->getValueName(MF.getFunction()); |
| 95 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 96 | // Print out labels for the function. |
| 97 | O << "\t.text\n"; |
| 98 | O << "\t.align 16\n"; |
| 99 | O << "\t.globl\t" << CurrentFnName << "\n"; |
Brian Gaeke | 54cc3c2 | 2004-03-16 22:52:04 +0000 | [diff] [blame] | 100 | O << "\t.type\t" << CurrentFnName << ", #function\n"; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 101 | O << CurrentFnName << ":\n"; |
| 102 | |
| 103 | // Number each basic block so that we can consistently refer to them |
| 104 | // in PC-relative references. |
| 105 | NumberForBB.clear(); |
| 106 | for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); |
| 107 | I != E; ++I) { |
| 108 | NumberForBB[I->getBasicBlock()] = BBNumber++; |
| 109 | } |
| 110 | |
| 111 | // Print out code for the function. |
| 112 | for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); |
| 113 | I != E; ++I) { |
| 114 | // Print a label for the basic block. |
Brian Gaeke | 09c1309 | 2004-06-17 19:39:23 +0000 | [diff] [blame] | 115 | O << ".LBB" << Mang->getValueName(MF.getFunction ()) |
| 116 | << "_" << I->getNumber () << ":\t! " |
| 117 | << I->getBasicBlock ()->getName () << "\n"; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 118 | for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); |
Misha Brukman | 27177f8 | 2005-04-22 18:06:01 +0000 | [diff] [blame] | 119 | II != E; ++II) { |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 120 | // Print the assembly for the instruction. |
Chris Lattner | 0d8fcd3 | 2005-12-17 06:54:41 +0000 | [diff] [blame] | 121 | O << "\t"; |
| 122 | printInstruction(II); |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 123 | ++EmittedInsts; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | |
| 127 | // We didn't modify anything. |
| 128 | return false; |
| 129 | } |
| 130 | |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 131 | void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) { |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 132 | const MachineOperand &MO = MI->getOperand (opNum); |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 133 | const MRegisterInfo &RI = *TM.getRegisterInfo(); |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 134 | bool CloseParen = false; |
| 135 | if (MI->getOpcode() == V8::SETHIi && !MO.isRegister() && !MO.isImmediate()) { |
| 136 | O << "%hi("; |
| 137 | CloseParen = true; |
Misha Brukman | f54ef97 | 2004-06-24 23:38:20 +0000 | [diff] [blame] | 138 | } else if (MI->getOpcode() ==V8::ORri &&!MO.isRegister() &&!MO.isImmediate()) |
| 139 | { |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 140 | O << "%lo("; |
| 141 | CloseParen = true; |
| 142 | } |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 143 | switch (MO.getType()) { |
| 144 | case MachineOperand::MO_VirtualRegister: |
| 145 | if (Value *V = MO.getVRegValueOrNull()) { |
| 146 | O << "<" << V->getName() << ">"; |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 147 | break; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 148 | } |
| 149 | // FALLTHROUGH |
| 150 | case MachineOperand::MO_MachineRegister: |
| 151 | if (MRegisterInfo::isPhysicalRegister(MO.getReg())) |
Brian Gaeke | a8b00ca | 2004-03-06 05:30:21 +0000 | [diff] [blame] | 152 | O << "%" << LowercaseString (RI.get(MO.getReg()).Name); |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 153 | else |
| 154 | O << "%reg" << MO.getReg(); |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 155 | break; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 156 | |
| 157 | case MachineOperand::MO_SignExtendedImmed: |
| 158 | case MachineOperand::MO_UnextendedImmed: |
| 159 | O << (int)MO.getImmedValue(); |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 160 | break; |
Brian Gaeke | 09c1309 | 2004-06-17 19:39:23 +0000 | [diff] [blame] | 161 | case MachineOperand::MO_MachineBasicBlock: { |
| 162 | MachineBasicBlock *MBBOp = MO.getMachineBasicBlock(); |
| 163 | O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction()) |
| 164 | << "_" << MBBOp->getNumber () << "\t! " |
| 165 | << MBBOp->getBasicBlock ()->getName (); |
| 166 | return; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 167 | } |
Brian Gaeke | 09c1309 | 2004-06-17 19:39:23 +0000 | [diff] [blame] | 168 | case MachineOperand::MO_PCRelativeDisp: |
| 169 | std::cerr << "Shouldn't use addPCDisp() when building SparcV8 MachineInstrs"; |
| 170 | abort (); |
| 171 | return; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 172 | case MachineOperand::MO_GlobalAddress: |
| 173 | O << Mang->getValueName(MO.getGlobal()); |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 174 | break; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 175 | case MachineOperand::MO_ExternalSymbol: |
| 176 | O << MO.getSymbolName(); |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 177 | break; |
Brian Gaeke | 8a0ae9e | 2004-06-27 22:50:44 +0000 | [diff] [blame] | 178 | case MachineOperand::MO_ConstantPoolIndex: |
Chris Lattner | b5e9eb6 | 2005-12-17 07:11:43 +0000 | [diff] [blame] | 179 | O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_" |
| 180 | << MO.getConstantPoolIndex(); |
Brian Gaeke | 8a0ae9e | 2004-06-27 22:50:44 +0000 | [diff] [blame] | 181 | break; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 182 | default: |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 183 | O << "<unknown operand type>"; abort (); break; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 184 | } |
Brian Gaeke | 446ae11 | 2004-06-15 19:52:59 +0000 | [diff] [blame] | 185 | if (CloseParen) O << ")"; |
Brian Gaeke | 62aa28a | 2004-03-05 08:39:09 +0000 | [diff] [blame] | 186 | } |
| 187 | |
Chris Lattner | bc83fd9 | 2005-12-17 20:04:49 +0000 | [diff] [blame] | 188 | void SparcV8AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum) { |
| 189 | printOperand(MI, opNum); |
Chris Lattner | 76acc87 | 2005-12-18 02:37:35 +0000 | [diff] [blame] | 190 | MachineOperand::MachineOperandType OpTy = MI->getOperand(opNum+1).getType(); |
| 191 | |
| 192 | if ((OpTy == MachineOperand::MO_VirtualRegister || |
| 193 | OpTy == MachineOperand::MO_MachineRegister) && |
| 194 | MI->getOperand(opNum+1).getReg() == V8::G0) |
| 195 | return; // don't print "+%g0" |
| 196 | if ((OpTy == MachineOperand::MO_SignExtendedImmed || |
| 197 | OpTy == MachineOperand::MO_UnextendedImmed) && |
| 198 | MI->getOperand(opNum+1).getImmedValue() == 0) |
| 199 | return; // don't print "+0" |
| 200 | |
Chris Lattner | bc83fd9 | 2005-12-17 20:04:49 +0000 | [diff] [blame] | 201 | O << "+"; |
Chris Lattner | 76acc87 | 2005-12-18 02:37:35 +0000 | [diff] [blame] | 202 | if (OpTy == MachineOperand::MO_GlobalAddress || |
| 203 | OpTy == MachineOperand::MO_ConstantPoolIndex) { |
Chris Lattner | e1389ad | 2005-12-18 02:27:00 +0000 | [diff] [blame] | 204 | O << "%lo("; |
| 205 | printOperand(MI, opNum+1); |
| 206 | O << ")"; |
| 207 | } else { |
| 208 | printOperand(MI, opNum+1); |
| 209 | } |
Chris Lattner | bc83fd9 | 2005-12-17 20:04:49 +0000 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 213 | bool SparcV8AsmPrinter::doInitialization(Module &M) { |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 214 | Mang = new Mangler(M); |
| 215 | return false; // success |
| 216 | } |
| 217 | |
Chris Lattner | 994b735 | 2005-12-16 06:34:17 +0000 | [diff] [blame] | 218 | bool SparcV8AsmPrinter::doFinalization(Module &M) { |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 219 | const TargetData &TD = TM.getTargetData(); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 220 | |
| 221 | // Print out module-level global variables here. |
Chris Lattner | e4d5c44 | 2005-03-15 04:54:21 +0000 | [diff] [blame] | 222 | for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 223 | if (I->hasInitializer()) { // External global require no code |
| 224 | O << "\n\n"; |
| 225 | std::string name = Mang->getValueName(I); |
| 226 | Constant *C = I->getInitializer(); |
| 227 | unsigned Size = TD.getTypeSize(C->getType()); |
| 228 | unsigned Align = TD.getTypeAlignment(C->getType()); |
| 229 | |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 230 | if (C->isNullValue() && |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 231 | (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || |
| 232 | I->hasWeakLinkage() /* FIXME: Verify correct */)) { |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 233 | SwitchSection(".data", I); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 234 | if (I->hasInternalLinkage()) |
| 235 | O << "\t.local " << name << "\n"; |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 236 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 237 | O << "\t.comm " << name << "," << TD.getTypeSize(C->getType()) |
| 238 | << "," << (unsigned)TD.getTypeAlignment(C->getType()); |
Brian Gaeke | 79db740 | 2004-03-16 22:37:12 +0000 | [diff] [blame] | 239 | O << "\t\t! "; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 240 | WriteAsOperand(O, I, true, true, &M); |
| 241 | O << "\n"; |
| 242 | } else { |
| 243 | switch (I->getLinkage()) { |
| 244 | case GlobalValue::LinkOnceLinkage: |
| 245 | case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. |
| 246 | // Nonnull linkonce -> weak |
| 247 | O << "\t.weak " << name << "\n"; |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 248 | SwitchSection("", I); |
| 249 | O << "\t.section\t\".llvm.linkonce.d." << name |
| 250 | << "\",\"aw\",@progbits\n"; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 251 | break; |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 252 | |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 253 | case GlobalValue::AppendingLinkage: |
| 254 | // FIXME: appending linkage variables should go into a section of |
| 255 | // their name or something. For now, just emit them as external. |
| 256 | case GlobalValue::ExternalLinkage: |
| 257 | // If external or appending, declare as a global symbol |
| 258 | O << "\t.globl " << name << "\n"; |
| 259 | // FALL THROUGH |
| 260 | case GlobalValue::InternalLinkage: |
| 261 | if (C->isNullValue()) |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 262 | SwitchSection(".bss", I); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 263 | else |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 264 | SwitchSection(".data", I); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 265 | break; |
Misha Brukman | c11c44f | 2004-11-19 21:49:19 +0000 | [diff] [blame] | 266 | case GlobalValue::GhostLinkage: |
| 267 | std::cerr << "Should not have any unmaterialized functions!\n"; |
| 268 | abort(); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | O << "\t.align " << Align << "\n"; |
Brian Gaeke | 54cc3c2 | 2004-03-16 22:52:04 +0000 | [diff] [blame] | 272 | O << "\t.type " << name << ",#object\n"; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 273 | O << "\t.size " << name << "," << Size << "\n"; |
Brian Gaeke | 79db740 | 2004-03-16 22:37:12 +0000 | [diff] [blame] | 274 | O << name << ":\t\t\t\t! "; |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 275 | WriteAsOperand(O, I, true, true, &M); |
| 276 | O << " = "; |
| 277 | WriteAsOperand(O, C, false, false, &M); |
| 278 | O << "\n"; |
Chris Lattner | 967abf3 | 2005-12-17 07:17:08 +0000 | [diff] [blame] | 279 | EmitGlobalConstant(C); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
Chris Lattner | 1dbed16 | 2005-12-17 07:04:29 +0000 | [diff] [blame] | 283 | AsmPrinter::doFinalization(M); |
Brian Gaeke | 4acfd03 | 2004-03-04 06:00:41 +0000 | [diff] [blame] | 284 | return false; // success |
| 285 | } |