Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.12 -> 1.13 X86AsmPrinter.cpp updated: 1.150 -> 1.151 X86AsmPrinter.h updated: 1.4 -> 1.5 X86IntelAsmPrinter.cpp updated: 1.8 -> 1.9 --- Log message: Switch to using the shared constant pool printer, along with using shorter CPI ids --- Diffs of the changes: (+5 -31) X86ATTAsmPrinter.cpp | 4 ++-- X86AsmPrinter.cpp | 27 +-------------------------- X86AsmPrinter.h | 1 - X86IntelAsmPrinter.cpp | 4 ++-- 4 files changed, 5 insertions(+), 31 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.12 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.13 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.12 Mon Nov 21 01:51:23 2005 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Mon Nov 21 02:32:23 2005 @@ -29,7 +29,7 @@ O << "\n\n"; // Print out constants referenced by the function - printConstantPool(MF.getConstantPool()); + EmitConstantPool(MF.getConstantPool()); // Print out labels for the function. SwitchSection("\t.text\n", MF.getFunction()); @@ -176,7 +176,7 @@ O << "]"; return; } else if (BaseReg.isConstantPoolIndex()) { - O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" + O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_" << BaseReg.getConstantPoolIndex(); if (DispSpec.getImmedValue()) O << "+" << DispSpec.getImmedValue(); Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.150 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.151 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.150 Mon Nov 21 01:51:23 2005 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Mon Nov 21 02:32:23 2005 @@ -68,37 +68,12 @@ Data64bitsDirective = 0; // we can't emit a 64-bit unit ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. PrivateGlobalPrefix = "L"; // Marker for constant pool idxs + ConstantPoolSection = "\t.const\n"; } return AsmPrinter::doInitialization(M); } -/// printConstantPool - Print to the current output stream assembly -/// representations of the constants in the constant pool MCP. This is -/// used to print out constants which have been "spilled to memory" by -/// the code generator. -/// -void X86SharedAsmPrinter::printConstantPool(MachineConstantPool *MCP) { - const std::vector<Constant*> &CP = MCP->getConstants(); - const TargetData &TD = TM.getTargetData(); - - if (CP.empty()) return; - - SwitchSection(forDarwin ? "\t.const\n" : "\t.section .rodata\n", 0); - - for (unsigned i = 0, e = CP.size(); i != e; ++i) { - // FIXME: force doubles to be naturally aligned. We should handle this - // more correctly in the future. - if (CP[i]->getType() == Type::DoubleTy) - EmitAlignment(3); - else - EmitAlignment(TD.getTypeAlignmentShift(CP[i]->getType())); - O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i - << ":\t\t\t\t\t" << CommentString << *CP[i] << "\n"; - EmitGlobalConstant(CP[i]); - } -} - bool X86SharedAsmPrinter::doFinalization(Module &M) { const TargetData &TD = TM.getTargetData(); Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.4 llvm/lib/Target/X86/X86AsmPrinter.h:1.5 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.4 Mon Nov 21 01:11:11 2005 +++ llvm/lib/Target/X86/X86AsmPrinter.h Mon Nov 21 02:32:23 2005 @@ -32,7 +32,6 @@ : AsmPrinter(O, TM), forCygwin(false), forDarwin(false) { } bool doInitialization(Module &M); - void printConstantPool(MachineConstantPool *MCP); bool doFinalization(Module &M); bool forCygwin; Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.8 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.9 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.8 Mon Nov 21 01:51:23 2005 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Mon Nov 21 02:32:23 2005 @@ -29,7 +29,7 @@ O << "\n\n"; // Print out constants referenced by the function - printConstantPool(MF.getConstantPool()); + EmitConstantPool(MF.getConstantPool()); // Print out labels for the function. SwitchSection("\t.text\n", MF.getFunction()); @@ -143,7 +143,7 @@ O << "]"; return; } else if (BaseReg.isConstantPoolIndex()) { - O << "[" << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" + O << "[" << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_" << BaseReg.getConstantPoolIndex(); if (IndexReg.getReg()) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits