From a2406190ca28dc5901dfe747849c8eda9c29d7ee Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 28 Jan 2010 00:19:24 +0000 Subject: [PATCH] Drop the argument to AsmPrinter::EmitConstantPool and make it virtual. Overload it in the ARM backend to do nothing, since is does insane constant pool emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94708 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/AsmPrinter.h | 2 +- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 5 +++-- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 2 ++ lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 589788a7cc4..31cc868f057 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -220,7 +220,7 @@ namespace llvm { /// used to print out constants which have been "spilled to memory" by /// the code generator. /// - void EmitConstantPool(const MachineConstantPool *MCP); + virtual void EmitConstantPool(); /// EmitJumpTableInfo - Print assembly representations of the jump tables /// used by the current function to the current output stream. diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 2e61a6f655f..ed410a9614f 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -294,7 +294,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { /// function. void AsmPrinter::EmitFunctionHeader() { // Print out constants referenced by the function - EmitConstantPool(MF->getConstantPool()); + EmitConstantPool(); // Print the 'header' of function. const Function *F = MF->getFunction(); @@ -440,7 +440,8 @@ namespace { /// used to print out constants which have been "spilled to memory" by /// the code generator. /// -void AsmPrinter::EmitConstantPool(const MachineConstantPool *MCP) { +void AsmPrinter::EmitConstantPool() { + const MachineConstantPool *MCP = MF->getConstantPool(); const std::vector &CP = MCP->getConstants(); if (CP.empty()) return; diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index f263db4e7c7..348c455472c 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -164,6 +164,8 @@ namespace { void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); + + virtual void EmitConstantPool() {} // we emit constant pools customly! virtual void EmitFunctionEntryLabel(); void EmitStartOfAsmFile(Module &M); void EmitEndOfAsmFile(Module &M); diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp index e9813b6f028..e2e0b2befcf 100644 --- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp @@ -233,7 +233,7 @@ bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF) { SetupMachineFunction(MF); // Print out constants referenced by the function - EmitConstantPool(MF.getConstantPool()); + EmitConstantPool(); // Emit the function start directives emitFunctionStart(MF); -- 2.34.1