1 //===-- EmitAssembly.cpp - Emit Sparc Specific .s File ---------------------==//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file implements all of the stuff necessary to output a .s file from
11 // LLVM. The code in this file assumes that the specified module has already
12 // been compiled into the internal data structures of the Module.
14 // This code largely consists of two LLVM Pass's: a FunctionPass and a Pass.
15 // The FunctionPass is pipelined together with all of the rest of the code
16 // generation stages, and the Pass runs at the end to emit code for global
17 // variables and such.
19 //===----------------------------------------------------------------------===//
21 #include "llvm/Constants.h"
22 #include "llvm/DerivedTypes.h"
23 #include "llvm/Module.h"
24 #include "llvm/Pass.h"
25 #include "llvm/Assembly/Writer.h"
26 #include "llvm/CodeGen/MachineConstantPool.h"
27 #include "llvm/CodeGen/MachineFunction.h"
28 #include "llvm/CodeGen/MachineFunctionInfo.h"
29 #include "llvm/CodeGen/MachineInstr.h"
30 #include "llvm/Support/Mangler.h"
31 #include "Support/StringExtras.h"
32 #include "Support/Statistic.h"
33 #include "SparcInternals.h"
38 Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
40 //===--------------------------------------------------------------------===//
43 /// getAsCString - Return the specified array as a C compatible string, only
44 /// if the predicate isString() is true.
46 std::string getAsCString(const ConstantArray *CVA) {
47 assert(CVA->isString() && "Array is not string compatible!");
49 std::string Result = "\"";
50 for (unsigned i = 0; i != CVA->getNumOperands(); ++i) {
51 unsigned char C = cast<ConstantInt>(CVA->getOperand(i))->getRawValue();
55 } else if (C == '\\') {
57 } else if (isprint(C)) {
60 Result += '\\'; // print all other chars as octal value
61 // Convert C to octal representation
62 Result += ((C >> 6) & 7) + '0';
63 Result += ((C >> 3) & 7) + '0';
64 Result += ((C >> 0) & 7) + '0';
72 inline bool ArrayTypeIsString(const ArrayType* arrayType) {
73 return (arrayType->getElementType() == Type::UByteTy ||
74 arrayType->getElementType() == Type::SByteTy);
77 inline const std::string
78 TypeToDataDirective(const Type* type) {
79 switch(type->getPrimitiveID())
81 case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID:
83 case Type::UShortTyID: case Type::ShortTyID:
85 case Type::UIntTyID: case Type::IntTyID:
87 case Type::ULongTyID: case Type::LongTyID: case Type::PointerTyID:
91 case Type::DoubleTyID:
94 if (ArrayTypeIsString((ArrayType*) type))
97 return "<InvaliDataTypeForPrinting>";
99 return "<InvaliDataTypeForPrinting>";
103 /// Get the size of the constant for the given target.
104 /// If this is an unsized array, return 0.
107 ConstantToSize(const Constant* CV, const TargetMachine& target) {
108 if (const ConstantArray* CVA = dyn_cast<ConstantArray>(CV)) {
109 const ArrayType *aty = cast<ArrayType>(CVA->getType());
110 if (ArrayTypeIsString(aty))
111 return 1 + CVA->getNumOperands();
114 return target.findOptimalStorageSize(CV->getType());
117 /// Align data larger than one L1 cache line on L1 cache line boundaries.
118 /// Align all smaller data on the next higher 2^x boundary (4, 8, ...).
121 SizeToAlignment(unsigned int size, const TargetMachine& target) {
122 unsigned short cacheLineSize = target.getCacheInfo().getCacheLineSize(1);
123 if (size > (unsigned) cacheLineSize / 2)
124 return cacheLineSize;
126 for (unsigned sz=1; /*no condition*/; sz *= 2)
131 /// Get the size of the type and then use SizeToAlignment.
134 TypeToAlignment(const Type* type, const TargetMachine& target) {
135 return SizeToAlignment(target.findOptimalStorageSize(type), target);
138 /// Get the size of the constant and then use SizeToAlignment.
139 /// Handles strings as a special case;
141 ConstantToAlignment(const Constant* CV, const TargetMachine& target) {
142 if (const ConstantArray* CVA = dyn_cast<ConstantArray>(CV))
143 if (ArrayTypeIsString(cast<ArrayType>(CVA->getType())))
144 return SizeToAlignment(1 + CVA->getNumOperands(), target);
146 return TypeToAlignment(CV->getType(), target);
149 } // End anonymous namespace
153 //===---------------------------------------------------------------------===//
154 // Code abstracted away from the AsmPrinter
155 //===---------------------------------------------------------------------===//
159 // Mangle symbol names appropriately
164 const TargetMachine &Target;
174 AsmPrinter(std::ostream &os, const TargetMachine &T)
175 : /* idTable(0), */ toAsm(os), Target(T), CurSection(Unknown) {}
181 // (start|end)(Module|Function) - Callback methods invoked by subclasses
182 void startModule(Module &M) {
183 Mang = new Mangler(M);
186 void PrintZeroBytesToPad(int numBytes) {
188 // Always use single unsigned bytes for padding. We don't know upon
189 // what data size the beginning address is aligned, so using anything
190 // other than a byte may cause alignment errors in the assembler.
193 printSingleConstantValue(Constant::getNullValue(Type::UByteTy));
196 /// Print a single constant value.
198 void printSingleConstantValue(const Constant* CV);
200 /// Print a constant value or values (it may be an aggregate).
201 /// Uses printSingleConstantValue() to print each individual value.
203 void printConstantValueOnly(const Constant* CV, int numPadBytesAfter = 0);
205 // Print a constant (which may be an aggregate) prefixed by all the
206 // appropriate directives. Uses printConstantValueOnly() to print the
208 void printConstant(const Constant* CV, std::string valID = "") {
209 if (valID.length() == 0)
212 toAsm << "\t.align\t" << ConstantToAlignment(CV, Target) << "\n";
214 // Print .size and .type only if it is not a string.
215 if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV))
216 if (CVA->isString()) {
217 // print it as a string and return
218 toAsm << valID << ":\n";
219 toAsm << "\t" << ".ascii" << "\t" << getAsCString(CVA) << "\n";
223 toAsm << "\t.type" << "\t" << valID << ",#object\n";
225 unsigned int constSize = ConstantToSize(CV, Target);
227 toAsm << "\t.size" << "\t" << valID << "," << constSize << "\n";
229 toAsm << valID << ":\n";
231 printConstantValueOnly(CV);
234 // enterSection - Use this method to enter a different section of the output
235 // executable. This is used to only output necessary section transitions.
237 void enterSection(enum Sections S) {
238 if (S == CurSection) return; // Only switch section if necessary
241 toAsm << "\n\t.section ";
244 default: assert(0 && "Bad section name!");
245 case Text: toAsm << "\".text\""; break;
246 case ReadOnlyData: toAsm << "\".rodata\",#alloc"; break;
247 case InitRWData: toAsm << "\".data\",#alloc,#write"; break;
248 case ZeroInitRWData: toAsm << "\".bss\",#alloc,#write"; break;
253 // getID Wrappers - Ensure consistent usage
254 // Symbol names in Sparc assembly language have these rules:
255 // (a) Must match { letter | _ | . | $ } { letter | _ | . | $ | digit }*
256 // (b) A name beginning in "." is treated as a local name.
257 std::string getID(const Function *F) {
258 return Mang->getValueName(F);
260 std::string getID(const BasicBlock *BB) {
261 return ".L_" + getID(BB->getParent()) + "_" + Mang->getValueName(BB);
263 std::string getID(const GlobalVariable *GV) {
264 return Mang->getValueName(GV);
266 std::string getID(const Constant *CV) {
267 return ".C_" + Mang->getValueName(CV);
269 std::string getID(const GlobalValue *GV) {
270 if (const GlobalVariable *V = dyn_cast<GlobalVariable>(GV))
272 else if (const Function *F = dyn_cast<Function>(GV))
274 assert(0 && "Unexpected type of GlobalValue!");
278 // Combines expressions
279 inline std::string ConstantArithExprToString(const ConstantExpr* CE,
280 const TargetMachine &TM,
281 const std::string &op) {
282 return "(" + valToExprString(CE->getOperand(0), TM) + op
283 + valToExprString(CE->getOperand(1), TM) + ")";
286 /// ConstantExprToString() - Convert a ConstantExpr to an asm expression
287 /// and return this as a string.
289 std::string ConstantExprToString(const ConstantExpr* CE,
290 const TargetMachine& target);
292 /// valToExprString - Helper function for ConstantExprToString().
293 /// Appends result to argument string S.
295 std::string valToExprString(const Value* V, const TargetMachine& target);
297 } // End anonymous namespace
300 /// Print a single constant value.
302 void AsmPrinter::printSingleConstantValue(const Constant* CV) {
303 assert(CV->getType() != Type::VoidTy &&
304 CV->getType() != Type::TypeTy &&
305 CV->getType() != Type::LabelTy &&
306 "Unexpected type for Constant");
308 assert((!isa<ConstantArray>(CV) && ! isa<ConstantStruct>(CV))
309 && "Aggregate types should be handled outside this function");
311 toAsm << "\t" << TypeToDataDirective(CV->getType()) << "\t";
313 if (const ConstantPointerRef* CPR = dyn_cast<ConstantPointerRef>(CV)) {
314 // This is a constant address for a global variable or method.
315 // Use the name of the variable or method as the address value.
316 assert(isa<GlobalValue>(CPR->getValue()) && "Unexpected non-global");
317 toAsm << getID(CPR->getValue()) << "\n";
318 } else if (isa<ConstantPointerNull>(CV)) {
319 // Null pointer value
321 } else if (const ConstantExpr* CE = dyn_cast<ConstantExpr>(CV)) {
322 // Constant expression built from operators, constants, and symbolic addrs
323 toAsm << ConstantExprToString(CE, Target) << "\n";
324 } else if (CV->getType()->isPrimitiveType()) {
325 // Check primitive types last
326 if (CV->getType()->isFloatingPoint()) {
327 // FP Constants are printed as integer constants to avoid losing
329 double Val = cast<ConstantFP>(CV)->getValue();
330 if (CV->getType() == Type::FloatTy) {
331 float FVal = (float)Val;
332 char *ProxyPtr = (char*)&FVal; // Abide by C TBAA rules
333 toAsm << *(unsigned int*)ProxyPtr;
334 } else if (CV->getType() == Type::DoubleTy) {
335 char *ProxyPtr = (char*)&Val; // Abide by C TBAA rules
336 toAsm << *(uint64_t*)ProxyPtr;
338 assert(0 && "Unknown floating point type!");
341 toAsm << "\t! " << CV->getType()->getDescription()
342 << " value: " << Val << "\n";
343 } else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
344 toAsm << (int)CB->getValue() << "\n";
346 WriteAsOperand(toAsm, CV, false, false) << "\n";
349 assert(0 && "Unknown elementary type for constant");
353 /// Print a constant value or values (it may be an aggregate).
354 /// Uses printSingleConstantValue() to print each individual value.
356 void AsmPrinter::printConstantValueOnly(const Constant* CV,
357 int numPadBytesAfter) {
358 if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
359 if (CVA->isString()) {
360 // print the string alone and return
361 toAsm << "\t" << ".ascii" << "\t" << getAsCString(CVA) << "\n";
363 // Not a string. Print the values in successive locations
364 const std::vector<Use> &constValues = CVA->getValues();
365 for (unsigned i=0; i < constValues.size(); i++)
366 printConstantValueOnly(cast<Constant>(constValues[i].get()));
368 } else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
369 // Print the fields in successive locations. Pad to align if needed!
370 const StructLayout *cvsLayout =
371 Target.getTargetData().getStructLayout(CVS->getType());
372 const std::vector<Use>& constValues = CVS->getValues();
373 unsigned sizeSoFar = 0;
374 for (unsigned i=0, N = constValues.size(); i < N; i++) {
375 const Constant* field = cast<Constant>(constValues[i].get());
377 // Check if padding is needed and insert one or more 0s.
379 Target.getTargetData().getTypeSize(field->getType());
380 int padSize = ((i == N-1? cvsLayout->StructSize
381 : cvsLayout->MemberOffsets[i+1])
382 - cvsLayout->MemberOffsets[i]) - fieldSize;
383 sizeSoFar += (fieldSize + padSize);
385 // Now print the actual field value
386 printConstantValueOnly(field, padSize);
388 assert(sizeSoFar == cvsLayout->StructSize &&
389 "Layout of constant struct may be incorrect!");
392 printSingleConstantValue(CV);
394 if (numPadBytesAfter)
395 PrintZeroBytesToPad(numPadBytesAfter);
398 /// ConstantExprToString() - Convert a ConstantExpr to an asm expression
399 /// and return this as a string.
401 std::string AsmPrinter::ConstantExprToString(const ConstantExpr* CE,
402 const TargetMachine& target) {
404 switch(CE->getOpcode()) {
405 case Instruction::GetElementPtr:
406 { // generate a symbolic expression for the byte address
407 const Value* ptrVal = CE->getOperand(0);
408 std::vector<Value*> idxVec(CE->op_begin()+1, CE->op_end());
409 const TargetData &TD = target.getTargetData();
410 S += "(" + valToExprString(ptrVal, target) + ") + ("
411 + utostr(TD.getIndexedOffset(ptrVal->getType(),idxVec)) + ")";
415 case Instruction::Cast:
416 // Support only non-converting casts for now, i.e., a no-op.
417 // This assertion is not a complete check.
418 assert(target.getTargetData().getTypeSize(CE->getType()) ==
419 target.getTargetData().getTypeSize(CE->getOperand(0)->getType()));
420 S += "(" + valToExprString(CE->getOperand(0), target) + ")";
423 case Instruction::Add:
424 S += ConstantArithExprToString(CE, target, ") + (");
427 case Instruction::Sub:
428 S += ConstantArithExprToString(CE, target, ") - (");
431 case Instruction::Mul:
432 S += ConstantArithExprToString(CE, target, ") * (");
435 case Instruction::Div:
436 S += ConstantArithExprToString(CE, target, ") / (");
439 case Instruction::Rem:
440 S += ConstantArithExprToString(CE, target, ") % (");
443 case Instruction::And:
444 // Logical && for booleans; bitwise & otherwise
445 S += ConstantArithExprToString(CE, target,
446 ((CE->getType() == Type::BoolTy)? ") && (" : ") & ("));
449 case Instruction::Or:
450 // Logical || for booleans; bitwise | otherwise
451 S += ConstantArithExprToString(CE, target,
452 ((CE->getType() == Type::BoolTy)? ") || (" : ") | ("));
455 case Instruction::Xor:
456 // Bitwise ^ for all types
457 S += ConstantArithExprToString(CE, target, ") ^ (");
461 assert(0 && "Unsupported operator in ConstantExprToString()");
468 /// valToExprString - Helper function for ConstantExprToString().
469 /// Appends result to argument string S.
471 std::string AsmPrinter::valToExprString(const Value* V,
472 const TargetMachine& target) {
475 if (const Constant* CV = dyn_cast<Constant>(V)) { // symbolic or known
476 if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV))
477 S += std::string(CB == ConstantBool::True ? "1" : "0");
478 else if (const ConstantSInt *CI = dyn_cast<ConstantSInt>(CV))
479 S += itostr(CI->getValue());
480 else if (const ConstantUInt *CI = dyn_cast<ConstantUInt>(CV))
481 S += utostr(CI->getValue());
482 else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV))
483 S += ftostr(CFP->getValue());
484 else if (isa<ConstantPointerNull>(CV))
486 else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
487 S += valToExprString(CPR->getValue(), target);
488 else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV))
489 S += ConstantExprToString(CE, target);
492 } else if (const GlobalValue* GV = dyn_cast<GlobalValue>(V)) {
498 assert(0 && "Cannot convert value to string");
499 S += "<illegal-value>";
505 //===----------------------------------------------------------------------===//
506 // SparcAsmPrinter Code
507 //===----------------------------------------------------------------------===//
511 struct SparcAsmPrinter : public FunctionPass, public AsmPrinter {
512 inline SparcAsmPrinter(std::ostream &os, const TargetMachine &t)
513 : AsmPrinter(os, t) {}
515 const Function *currFunction;
517 const char *getPassName() const {
518 return "Output Sparc Assembly for Functions";
521 virtual bool doInitialization(Module &M) {
526 virtual bool runOnFunction(Function &F) {
532 virtual bool doFinalization(Module &M) {
537 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
538 AU.setPreservesAll();
541 void emitFunction(const Function &F);
543 void emitBasicBlock(const MachineBasicBlock &MBB);
544 void emitMachineInst(const MachineInstr *MI);
546 unsigned int printOperands(const MachineInstr *MI, unsigned int opNum);
547 void printOneOperand(const MachineOperand &Op, MachineOpCode opCode);
549 bool OpIsBranchTargetLabel(const MachineInstr *MI, unsigned int opNum);
550 bool OpIsMemoryAddressBase(const MachineInstr *MI, unsigned int opNum);
552 unsigned getOperandMask(unsigned Opcode) {
555 case V9::SUBcci: return 1 << 3; // Remove CC argument
556 default: return 0; // By default, don't hack operands...
560 void emitGlobals(const Module &M);
561 void printGlobalVariable(const GlobalVariable *GV);
564 } // End anonymous namespace
567 SparcAsmPrinter::OpIsBranchTargetLabel(const MachineInstr *MI,
568 unsigned int opNum) {
569 switch (MI->getOpcode()) {
581 SparcAsmPrinter::OpIsMemoryAddressBase(const MachineInstr *MI,
582 unsigned int opNum) {
583 if (Target.getInstrInfo().isLoad(MI->getOpcode()))
585 else if (Target.getInstrInfo().isStore(MI->getOpcode()))
592 #define PrintOp1PlusOp2(mop1, mop2, opCode) \
593 printOneOperand(mop1, opCode); \
595 printOneOperand(mop2, opCode);
598 SparcAsmPrinter::printOperands(const MachineInstr *MI,
601 const MachineOperand& mop = MI->getOperand(opNum);
603 if (OpIsBranchTargetLabel(MI, opNum)) {
604 PrintOp1PlusOp2(mop, MI->getOperand(opNum+1), MI->getOpcode());
606 } else if (OpIsMemoryAddressBase(MI, opNum)) {
608 PrintOp1PlusOp2(mop, MI->getOperand(opNum+1), MI->getOpcode());
612 printOneOperand(mop, MI->getOpcode());
618 SparcAsmPrinter::printOneOperand(const MachineOperand &mop,
619 MachineOpCode opCode)
621 bool needBitsFlag = true;
623 if (mop.isHiBits32())
625 else if (mop.isLoBits32())
627 else if (mop.isHiBits64())
629 else if (mop.isLoBits64())
632 needBitsFlag = false;
634 switch (mop.getType())
636 case MachineOperand::MO_VirtualRegister:
637 case MachineOperand::MO_CCRegister:
638 case MachineOperand::MO_MachineRegister:
640 int regNum = (int)mop.getAllocatedRegNum();
642 if (regNum == Target.getRegInfo().getInvalidRegNum()) {
643 // better to print code with NULL registers than to die
644 toAsm << "<NULL VALUE>";
646 toAsm << "%" << Target.getRegInfo().getUnifiedRegName(regNum);
651 case MachineOperand::MO_ConstantPoolIndex:
653 toAsm << ".CPI_" << currFunction->getName()
654 << "_" << mop.getConstantPoolIndex();
658 case MachineOperand::MO_PCRelativeDisp:
660 const Value *Val = mop.getVRegValue();
661 assert(Val && "\tNULL Value in SparcAsmPrinter");
663 if (const BasicBlock *BB = dyn_cast<BasicBlock>(Val))
665 else if (const Function *M = dyn_cast<Function>(Val))
667 else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Val))
669 else if (const Constant *CV = dyn_cast<Constant>(Val))
672 assert(0 && "Unrecognized value in SparcAsmPrinter");
676 case MachineOperand::MO_SignExtendedImmed:
677 toAsm << mop.getImmedValue();
680 case MachineOperand::MO_UnextendedImmed:
681 toAsm << (uint64_t) mop.getImmedValue();
685 toAsm << mop; // use dump field
693 void SparcAsmPrinter::emitMachineInst(const MachineInstr *MI) {
694 unsigned Opcode = MI->getOpcode();
696 if (Target.getInstrInfo().isDummyPhiInstr(Opcode))
697 return; // IGNORE PHI NODES
699 toAsm << "\t" << Target.getInstrInfo().getName(Opcode) << "\t";
701 unsigned Mask = getOperandMask(Opcode);
703 bool NeedComma = false;
705 for (unsigned OpNum = 0; OpNum < MI->getNumOperands(); OpNum += N)
706 if (! ((1 << OpNum) & Mask)) { // Ignore this operand?
707 if (NeedComma) toAsm << ", "; // Handle comma outputting
709 N = printOperands(MI, OpNum);
717 void SparcAsmPrinter::emitBasicBlock(const MachineBasicBlock &MBB) {
718 // Emit a label for the basic block
719 toAsm << getID(MBB.getBasicBlock()) << ":\n";
721 // Loop over all of the instructions in the basic block...
722 for (MachineBasicBlock::const_iterator MII = MBB.begin(), MIE = MBB.end();
724 emitMachineInst(*MII);
725 toAsm << "\n"; // Separate BB's with newlines
728 void SparcAsmPrinter::emitFunction(const Function &F) {
729 std::string methName = getID(&F);
730 toAsm << "!****** Outputing Function: " << methName << " ******\n";
732 // Emit constant pool for this function
733 const MachineConstantPool *MCP = MachineFunction::get(&F).getConstantPool();
734 const std::vector<Constant*> &CP = MCP->getConstants();
736 enterSection(AsmPrinter::ReadOnlyData);
737 for (unsigned i = 0, e = CP.size(); i != e; ++i) {
738 std::string cpiName = ".CPI_" + F.getName() + "_" + utostr(i);
739 printConstant(CP[i], cpiName);
742 enterSection(AsmPrinter::Text);
743 toAsm << "\t.align\t4\n\t.global\t" << methName << "\n";
744 //toAsm << "\t.type\t" << methName << ",#function\n";
745 toAsm << "\t.type\t" << methName << ", 2\n";
746 toAsm << methName << ":\n";
748 // Output code for all of the basic blocks in the function...
749 MachineFunction &MF = MachineFunction::get(&F);
750 for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E;++I)
753 // Output a .size directive so the debugger knows the extents of the function
754 toAsm << ".EndOf_" << methName << ":\n\t.size "
755 << methName << ", .EndOf_"
756 << methName << "-" << methName << "\n";
758 // Put some spaces between the functions
762 void SparcAsmPrinter::printGlobalVariable(const GlobalVariable* GV) {
763 if (GV->hasExternalLinkage())
764 toAsm << "\t.global\t" << getID(GV) << "\n";
766 if (GV->hasInitializer() && ! GV->getInitializer()->isNullValue()) {
767 printConstant(GV->getInitializer(), getID(GV));
769 toAsm << "\t.align\t" << TypeToAlignment(GV->getType()->getElementType(),
771 toAsm << "\t.type\t" << getID(GV) << ",#object\n";
772 toAsm << "\t.reserve\t" << getID(GV) << ","
773 << Target.findOptimalStorageSize(GV->getType()->getElementType())
778 void SparcAsmPrinter::emitGlobals(const Module &M) {
779 // Output global variables...
780 for (Module::const_giterator GI = M.gbegin(), GE = M.gend(); GI != GE; ++GI)
781 if (! GI->isExternal()) {
782 assert(GI->hasInitializer());
783 if (GI->isConstant())
784 enterSection(AsmPrinter::ReadOnlyData); // read-only, initialized data
785 else if (GI->getInitializer()->isNullValue())
786 enterSection(AsmPrinter::ZeroInitRWData); // read-write zero data
788 enterSection(AsmPrinter::InitRWData); // read-write non-zero data
790 printGlobalVariable(GI);
796 FunctionPass *llvm::createAsmPrinterPass(std::ostream &Out,
797 const TargetMachine &TM) {
798 return new SparcAsmPrinter(Out, TM);