Always print the implicit .text at the start of an asm file.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 5 Mar 2014 20:09:15 +0000 (20:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 5 Mar 2014 20:09:15 +0000 (20:09 +0000)
commitfc5436c95132cbbf3c2fc950d3c5906cc8ed62dd
tree9555e07e32414c6e43d3213e2256b1c700a1a441
parent82d372e12bc20de0a37c23a9a1f288f4fda0dae2
Always print the implicit .text at the start of an asm file.

Before llvm-mc would print it, but llc was assuming that it would produce
another section changing directive before one was needed. That assumption is
false with inline asm.

Fixes PR19049.

Another option would be to always create the section, but in the asm printer
avoid printing sections changes during initialization. That would work, but
* We do use the fact that llvm-mc prints it in testing. The tests can be changed
  if needed.
* A quick poll on IRC suggest that most developers prefer the implicit .text to
  be printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203001 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCELFStreamer.h
include/llvm/MC/MCStreamer.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/MC/MCAsmStreamer.cpp
lib/MC/MCELFStreamer.cpp
lib/MC/MCStreamer.cpp
lib/MC/WinCOFFStreamer.cpp
test/CodeGen/X86/GC/ocaml-gc.ll
test/CodeGen/X86/pr19049.ll [new file with mode: 0644]