diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-21 08:29:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-21 08:29:17 +0000 |
commit | 6053010f9cfc5b129ed6c5d99237d8df10492159 (patch) | |
tree | 40e701cabad523b8ab993ad233d1314de4cc0203 | |
parent | c569e6108adf701bc51635b35cb18bd35a843d18 (diff) | |
download | external_llvm-6053010f9cfc5b129ed6c5d99237d8df10492159.zip external_llvm-6053010f9cfc5b129ed6c5d99237d8df10492159.tar.gz external_llvm-6053010f9cfc5b129ed6c5d99237d8df10492159.tar.bz2 |
Switch to using the generic constant pool emitter impl, use shorter
CPI names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24466 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Alpha/AlphaAsmPrinter.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/lib/Target/Alpha/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AlphaAsmPrinter.cpp index d9f1f88..4d70c1d 100644 --- a/lib/Target/Alpha/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AlphaAsmPrinter.cpp @@ -18,7 +18,6 @@ #include "llvm/Module.h" #include "llvm/Type.h" #include "llvm/Assembly/Writer.h" -#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/Target/TargetMachine.h" @@ -55,7 +54,6 @@ namespace { } bool printInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, bool IsCallOp = false); - void printConstantPool(MachineConstantPool *MCP); void printOperand(const MachineInstr *MI, int opNum, MVT::ValueType VT); void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true); void printMachineInstruction(const MachineInstr *MI); @@ -128,7 +126,7 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { } case MachineOperand::MO_ConstantPoolIndex: - O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" + O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_" << MO.getConstantPoolIndex(); return; @@ -173,7 +171,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { O << "\n\n"; // Print out constants referenced by the function - printConstantPool(MF.getConstantPool()); + EmitConstantPool(MF.getConstantPool()); // Print out labels for the function. SwitchSection("\t.section .text", MF.getFunction()); @@ -204,27 +202,6 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { return false; } - -/// 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 AlphaAsmPrinter::printConstantPool(MachineConstantPool *MCP) { - const std::vector<Constant*> &CP = MCP->getConstants(); - const TargetData &TD = TM.getTargetData(); - - if (CP.empty()) return; - - SwitchSection("\t.section .rodata", 0); - for (unsigned i = 0, e = CP.size(); i != e; ++i) { - EmitAlignment(TD.getTypeAlignmentShift(CP[i]->getType())); - O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i - << ":\t\t\t\t\t" << CommentString << *CP[i] << "\n"; - EmitGlobalConstant(CP[i]); - } -} - bool AlphaAsmPrinter::doInitialization(Module &M) { AsmPrinter::doInitialization(M); |