From 8dc4e1007a365578fe4252402e7c5b7653555961 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 17 Mar 2015 14:38:30 +0000 Subject: [PATCH] Make EmitFunctionHeader a private helper. llvm-svn: 232481 --- llvm/include/llvm/CodeGen/AsmPrinter.h | 7 +++---- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 ++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 3 --- llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp | 1 - llvm/lib/Target/X86/X86AsmPrinter.cpp | 3 --- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index dd20fdd..ffb4d1b 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -198,7 +198,6 @@ public: /// Emit the specified function out to the OutStreamer. bool runOnMachineFunction(MachineFunction &MF) override { SetupMachineFunction(MF); - EmitFunctionHeader(); EmitFunctionBody(); return false; } @@ -211,9 +210,6 @@ public: /// runOnMachineFunction. void SetupMachineFunction(MachineFunction &MF); - /// This method emits the header for the current function. - void EmitFunctionHeader(); - /// This method emits the body and trailer for a function. void EmitFunctionBody(); @@ -504,6 +500,9 @@ private: mutable unsigned Counter; mutable unsigned SetCounter; + /// This method emits the header for the current function. + void EmitFunctionHeader(); + /// Emit a blob of inline asm to the output streamer. void EmitInlineAsm(StringRef Str, const MCSubtargetInfo &STI, diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 5098768..3784851 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -782,6 +782,8 @@ void AsmPrinter::emitFrameAlloc(const MachineInstr &MI) { /// EmitFunctionBody - This method emits the body and trailer for a /// function. void AsmPrinter::EmitFunctionBody() { + EmitFunctionHeader(); + // Emit target-specific gunk before the function body. EmitFunctionBodyStart(); diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index 2c9f32b..e3c9dcb 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -120,9 +120,6 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { OutStreamer.EndCOFFSymbolDef(); } - // Have common code print out the function header with linkage info etc. - EmitFunctionHeader(); - // Emit the rest of the function body. EmitFunctionBody(); diff --git a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp index 35e95fc..d911014 100644 --- a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp +++ b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp @@ -127,7 +127,6 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) { HexLines.clear(); DisasmLineMaxLen = 0; - EmitFunctionHeader(); EmitFunctionBody(); if (isVerbose()) { diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp index bb0b9ce..f6033a7 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -63,9 +63,6 @@ bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) { OutStreamer.EndCOFFSymbolDef(); } - // Have common code print out the function header with linkage info etc. - EmitFunctionHeader(); - // Emit the rest of the function body. EmitFunctionBody(); -- 2.7.4