Andrew Lenharth | 0126952 | 2005-01-24 18:37:48 +0000 | [diff] [blame] | 1 | //===-- AlphaAsmPrinter.cpp - Alpha LLVM assembly writer ------------------===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 2 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +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 | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 7 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +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 Alpha assembly language. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "Alpha.h" |
| 16 | #include "AlphaInstrInfo.h" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 17 | #include "AlphaTargetMachine.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 18 | #include "llvm/Module.h" |
Chris Lattner | 5b3a455 | 2005-03-17 15:38:16 +0000 | [diff] [blame] | 19 | #include "llvm/Type.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 20 | #include "llvm/Assembly/Writer.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/MachineConstantPool.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 22 | #include "llvm/CodeGen/ValueTypes.h" |
| 23 | #include "llvm/CodeGen/AsmPrinter.h" |
| 24 | |
| 25 | #include "llvm/Target/TargetMachine.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 26 | |
| 27 | #include "llvm/Support/Mangler.h" |
| 28 | #include "llvm/ADT/Statistic.h" |
Andrew Lenharth | 3ae1829 | 2005-04-14 16:24:00 +0000 | [diff] [blame] | 29 | #include "llvm/Support/CommandLine.h" |
Andrew Lenharth | 0126952 | 2005-01-24 18:37:48 +0000 | [diff] [blame] | 30 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 31 | using namespace llvm; |
| 32 | |
| 33 | namespace { |
| 34 | Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); |
| 35 | |
| 36 | struct AlphaAsmPrinter : public AsmPrinter { |
| 37 | |
| 38 | /// Unique incrementer for label values for referencing Global values. |
| 39 | /// |
| 40 | unsigned LabelNumber; |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 41 | |
| 42 | AlphaAsmPrinter(std::ostream &o, TargetMachine &tm) |
Andrew Lenharth | 440e688 | 2005-02-04 14:09:38 +0000 | [diff] [blame] | 43 | : AsmPrinter(o, tm), LabelNumber(0) |
| 44 | { |
| 45 | AlignmentIsInBytes = false; |
Chris Lattner | 81a994e | 2005-11-21 06:51:52 +0000 | [diff] [blame] | 46 | PrivateGlobalPrefix = "$"; |
Andrew Lenharth | 440e688 | 2005-02-04 14:09:38 +0000 | [diff] [blame] | 47 | } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 48 | |
| 49 | /// We name each basic block in a Function with a unique number, so |
| 50 | /// that we can consistently refer to them later. This is cleared |
| 51 | /// at the beginning of each call to runOnMachineFunction(). |
| 52 | /// |
| 53 | typedef std::map<const Value *, unsigned> ValueMapTy; |
| 54 | ValueMapTy NumberForBB; |
Andrew Lenharth | c24b537 | 2005-04-13 17:17:28 +0000 | [diff] [blame] | 55 | std::string CurSection; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 56 | |
| 57 | virtual const char *getPassName() const { |
| 58 | return "Alpha Assembly Printer"; |
| 59 | } |
| 60 | bool printInstruction(const MachineInstr *MI); |
| 61 | void printOp(const MachineOperand &MO, bool IsCallOp = false); |
| 62 | void printConstantPool(MachineConstantPool *MCP); |
| 63 | void printOperand(const MachineInstr *MI, int opNum, MVT::ValueType VT); |
| 64 | void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true); |
| 65 | void printMachineInstruction(const MachineInstr *MI); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 66 | bool runOnMachineFunction(MachineFunction &F); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 67 | bool doInitialization(Module &M); |
| 68 | bool doFinalization(Module &M); |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 69 | void switchSection(std::ostream &OS, const char *NewSection); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 70 | }; |
| 71 | } // end of anonymous namespace |
| 72 | |
| 73 | /// createAlphaCodePrinterPass - Returns a pass that prints the Alpha |
| 74 | /// assembly code for a MachineFunction to the given output stream, |
| 75 | /// using the given target machine description. This should work |
| 76 | /// regardless of whether the function is in SSA form. |
| 77 | /// |
| 78 | FunctionPass *llvm::createAlphaCodePrinterPass (std::ostream &o, |
| 79 | TargetMachine &tm) { |
| 80 | return new AlphaAsmPrinter(o, tm); |
| 81 | } |
| 82 | |
| 83 | #include "AlphaGenAsmWriter.inc" |
| 84 | |
| 85 | void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum, MVT::ValueType VT) |
| 86 | { |
| 87 | const MachineOperand &MO = MI->getOperand(opNum); |
| 88 | if (MO.getType() == MachineOperand::MO_MachineRegister) { |
| 89 | assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physreg??"); |
Andrew Lenharth | 0126952 | 2005-01-24 18:37:48 +0000 | [diff] [blame] | 90 | O << TM.getRegisterInfo()->get(MO.getReg()).Name; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 91 | } else if (MO.isImmediate()) { |
| 92 | O << MO.getImmedValue(); |
| 93 | } else { |
| 94 | printOp(MO); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | |
| 99 | void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { |
| 100 | const MRegisterInfo &RI = *TM.getRegisterInfo(); |
| 101 | int new_symbol; |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 102 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 103 | switch (MO.getType()) { |
| 104 | case MachineOperand::MO_VirtualRegister: |
| 105 | if (Value *V = MO.getVRegValueOrNull()) { |
| 106 | O << "<" << V->getName() << ">"; |
| 107 | return; |
| 108 | } |
| 109 | // FALLTHROUGH |
| 110 | case MachineOperand::MO_MachineRegister: |
| 111 | case MachineOperand::MO_CCRegister: |
Andrew Lenharth | 0126952 | 2005-01-24 18:37:48 +0000 | [diff] [blame] | 112 | O << RI.get(MO.getReg()).Name; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 113 | return; |
| 114 | |
| 115 | case MachineOperand::MO_SignExtendedImmed: |
| 116 | case MachineOperand::MO_UnextendedImmed: |
| 117 | std::cerr << "printOp() does not handle immediate values\n"; |
| 118 | abort(); |
| 119 | return; |
| 120 | |
| 121 | case MachineOperand::MO_PCRelativeDisp: |
Andrew Lenharth | 0126952 | 2005-01-24 18:37:48 +0000 | [diff] [blame] | 122 | std::cerr << "Shouldn't use addPCDisp() when building Alpha MachineInstrs"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 123 | abort(); |
| 124 | return; |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 125 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 126 | case MachineOperand::MO_MachineBasicBlock: { |
| 127 | MachineBasicBlock *MBBOp = MO.getMachineBasicBlock(); |
Andrew Lenharth | eee2a88 | 2005-06-06 19:03:09 +0000 | [diff] [blame] | 128 | O << "$LBB" << Mang->getValueName(MBBOp->getParent()->getFunction()) |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 129 | << "_" << MBBOp->getNumber() << "\t" << CommentString << " " |
| 130 | << MBBOp->getBasicBlock()->getName(); |
| 131 | return; |
| 132 | } |
| 133 | |
| 134 | case MachineOperand::MO_ConstantPoolIndex: |
Chris Lattner | 81a994e | 2005-11-21 06:51:52 +0000 | [diff] [blame] | 135 | O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" |
| 136 | << MO.getConstantPoolIndex(); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 137 | return; |
| 138 | |
| 139 | case MachineOperand::MO_ExternalSymbol: |
| 140 | O << MO.getSymbolName(); |
| 141 | return; |
| 142 | |
Andrew Lenharth | c24b537 | 2005-04-13 17:17:28 +0000 | [diff] [blame] | 143 | case MachineOperand::MO_GlobalAddress: |
| 144 | //Abuse PCrel to specify pcrel calls |
| 145 | //calls are the only thing that use this flag |
| 146 | if (MO.isPCRelative()) |
| 147 | O << "$" << Mang->getValueName(MO.getGlobal()) << "..ng"; |
| 148 | else |
| 149 | O << Mang->getValueName(MO.getGlobal()); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 150 | return; |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 151 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 152 | default: |
| 153 | O << "<unknown operand type: " << MO.getType() << ">"; |
| 154 | return; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | /// printMachineInstruction -- Print out a single Alpha MI to |
| 159 | /// the current output stream. |
| 160 | /// |
| 161 | void AlphaAsmPrinter::printMachineInstruction(const MachineInstr *MI) { |
| 162 | ++EmittedInsts; |
| 163 | if (printInstruction(MI)) |
| 164 | return; // Printer was automatically generated |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 165 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 166 | assert(0 && "Unhandled instruction in asm writer!"); |
| 167 | abort(); |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | |
| 172 | /// runOnMachineFunction - This uses the printMachineInstruction() |
| 173 | /// method to print assembly for each instruction. |
| 174 | /// |
| 175 | bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { |
| 176 | setupMachineFunction(MF); |
| 177 | O << "\n\n"; |
| 178 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 179 | // Print out constants referenced by the function |
| 180 | printConstantPool(MF.getConstantPool()); |
| 181 | |
| 182 | // Print out labels for the function. |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 183 | switchSection(O, "text"); |
Andrew Lenharth | c24b537 | 2005-04-13 17:17:28 +0000 | [diff] [blame] | 184 | emitAlignment(4); |
Andrew Lenharth | 044f31f | 2005-05-27 03:39:30 +0000 | [diff] [blame] | 185 | O << "\t.globl " << CurrentFnName << "\n"; |
| 186 | O << "\t.ent " << CurrentFnName << "\n"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 187 | |
| 188 | O << CurrentFnName << ":\n"; |
| 189 | |
| 190 | // Print out code for the function. |
| 191 | for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); |
| 192 | I != E; ++I) { |
| 193 | // Print a label for the basic block. |
Andrew Lenharth | eee2a88 | 2005-06-06 19:03:09 +0000 | [diff] [blame] | 194 | O << "$LBB" << CurrentFnName << "_" << I->getNumber() << ":\t" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 195 | << CommentString << " " << I->getBasicBlock()->getName() << "\n"; |
| 196 | for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); |
| 197 | II != E; ++II) { |
| 198 | // Print the assembly for the instruction. |
| 199 | O << "\t"; |
| 200 | printMachineInstruction(II); |
| 201 | } |
| 202 | } |
| 203 | ++LabelNumber; |
| 204 | |
Andrew Lenharth | 2b6c4f5 | 2005-02-25 22:55:15 +0000 | [diff] [blame] | 205 | O << "\t.end " << CurrentFnName << "\n"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 206 | |
| 207 | // We didn't modify anything. |
| 208 | return false; |
| 209 | } |
| 210 | |
| 211 | |
| 212 | /// printConstantPool - Print to the current output stream assembly |
| 213 | /// representations of the constants in the constant pool MCP. This is |
| 214 | /// used to print out constants which have been "spilled to memory" by |
| 215 | /// the code generator. |
| 216 | /// |
| 217 | void AlphaAsmPrinter::printConstantPool(MachineConstantPool *MCP) { |
| 218 | const std::vector<Constant*> &CP = MCP->getConstants(); |
| 219 | const TargetData &TD = TM.getTargetData(); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 220 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 221 | if (CP.empty()) return; |
| 222 | |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 223 | switchSection(O, "rodata"); |
Andrew Lenharth | f61ed95 | 2005-02-01 20:38:53 +0000 | [diff] [blame] | 224 | for (unsigned i = 0, e = CP.size(); i != e; ++i) { |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 225 | // switchSection(O, "section .rodata, \"dr\""); |
Andrew Lenharth | f61ed95 | 2005-02-01 20:38:53 +0000 | [diff] [blame] | 226 | emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType())); |
Chris Lattner | 81a994e | 2005-11-21 06:51:52 +0000 | [diff] [blame] | 227 | O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i |
| 228 | << ":\t\t\t\t\t" << CommentString << *CP[i] << "\n"; |
Andrew Lenharth | f61ed95 | 2005-02-01 20:38:53 +0000 | [diff] [blame] | 229 | emitGlobalConstant(CP[i]); |
| 230 | } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | bool AlphaAsmPrinter::doInitialization(Module &M) |
| 234 | { |
| 235 | AsmPrinter::doInitialization(M); |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 236 | if(TM.getSubtarget<AlphaSubtarget>().hasF2I() |
| 237 | || TM.getSubtarget<AlphaSubtarget>().hasCT()) |
Andrew Lenharth | 3ae1829 | 2005-04-14 16:24:00 +0000 | [diff] [blame] | 238 | O << "\t.arch ev6\n"; |
| 239 | else |
| 240 | O << "\t.arch ev56\n"; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 241 | O << "\t.set noat\n"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 242 | return false; |
| 243 | } |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 244 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 245 | |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 246 | // switchSection - Switch to the specified section of the executable if we are |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 247 | // not already in it! |
| 248 | // |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 249 | void AlphaAsmPrinter::switchSection(std::ostream &OS, const char *NewSection) |
Andrew Lenharth | c24b537 | 2005-04-13 17:17:28 +0000 | [diff] [blame] | 250 | { |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 251 | if (CurSection != NewSection) { |
| 252 | CurSection = NewSection; |
| 253 | if (!CurSection.empty()) |
Andrew Lenharth | 21e786b | 2005-08-12 16:13:43 +0000 | [diff] [blame] | 254 | OS << "\t.section ." << NewSection << "\n"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 255 | } |
| 256 | } |
| 257 | |
| 258 | bool AlphaAsmPrinter::doFinalization(Module &M) { |
| 259 | const TargetData &TD = TM.getTargetData(); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 260 | |
Chris Lattner | e4d5c44 | 2005-03-15 04:54:21 +0000 | [diff] [blame] | 261 | for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 262 | if (I->hasInitializer()) { // External global require no code |
| 263 | O << "\n\n"; |
| 264 | std::string name = Mang->getValueName(I); |
| 265 | Constant *C = I->getInitializer(); |
| 266 | unsigned Size = TD.getTypeSize(C->getType()); |
| 267 | unsigned Align = TD.getTypeAlignmentShift(C->getType()); |
| 268 | |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 269 | if (C->isNullValue() && |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 270 | (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || |
| 271 | I->hasWeakLinkage() /* FIXME: Verify correct */)) { |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 272 | switchSection(O, "data"); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 273 | if (I->hasInternalLinkage()) |
| 274 | O << "\t.local " << name << "\n"; |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 275 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 276 | O << "\t.comm " << name << "," << TD.getTypeSize(C->getType()) |
| 277 | << "," << (1 << Align); |
| 278 | O << "\t\t# "; |
| 279 | WriteAsOperand(O, I, true, true, &M); |
| 280 | O << "\n"; |
| 281 | } else { |
| 282 | switch (I->getLinkage()) { |
| 283 | case GlobalValue::LinkOnceLinkage: |
| 284 | case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. |
| 285 | // Nonnull linkonce -> weak |
| 286 | O << "\t.weak " << name << "\n"; |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 287 | switchSection(O, ""); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 288 | O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\",@progbits\n"; |
| 289 | break; |
| 290 | case GlobalValue::AppendingLinkage: |
| 291 | // FIXME: appending linkage variables should go into a section of |
| 292 | // their name or something. For now, just emit them as external. |
| 293 | case GlobalValue::ExternalLinkage: |
| 294 | // If external or appending, declare as a global symbol |
| 295 | O << "\t.globl " << name << "\n"; |
| 296 | // FALL THROUGH |
| 297 | case GlobalValue::InternalLinkage: |
| 298 | if (C->isNullValue()) |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 299 | switchSection(O, "bss"); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 300 | else |
Chris Lattner | 62cbf2a | 2005-11-21 06:55:27 +0000 | [diff] [blame] | 301 | switchSection(O, "data"); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 302 | break; |
| 303 | case GlobalValue::GhostLinkage: |
Andrew Lenharth | 3dc15f3 | 2005-03-10 19:02:02 +0000 | [diff] [blame] | 304 | std::cerr << "GhostLinkage cannot appear in AlphaAsmPrinter!\n"; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 305 | abort(); |
| 306 | } |
| 307 | |
| 308 | emitAlignment(Align); |
| 309 | O << "\t.type " << name << ",@object\n"; |
| 310 | O << "\t.size " << name << "," << Size << "\n"; |
| 311 | O << name << ":\t\t\t\t# "; |
| 312 | WriteAsOperand(O, I, true, true, &M); |
| 313 | O << " = "; |
| 314 | WriteAsOperand(O, C, false, false, &M); |
| 315 | O << "\n"; |
| 316 | emitGlobalConstant(C); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | AsmPrinter::doFinalization(M); |
| 321 | return false; |
| 322 | } |