Call EmitFunctionHeader just before EmitFunctionBody.
[oota-llvm.git] / lib / Target / R600 / AMDGPUAsmPrinter.cpp
index 5e1b6a37e8f9022936c00c50d8265e3b5a51a2dc..35e95fc2aa5a8fb1398136f053f1da3906cbe6ab 100644 (file)
@@ -105,8 +105,6 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
   SetupMachineFunction(MF);
 
-  EmitFunctionHeader();
-
   MCContext &Context = getObjFileLowering().getContext();
   const MCSectionELF *ConfigSection =
       Context.getELFSection(".AMDGPU.config", ELF::SHT_PROGBITS, 0);
@@ -129,7 +127,7 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   HexLines.clear();
   DisasmLineMaxLen = 0;
 
-  OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
+  EmitFunctionHeader();
   EmitFunctionBody();
 
   if (isVerbose()) {