OSDN Git Service

There is only one current section.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 27 May 2015 20:52:32 +0000 (20:52 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 27 May 2015 20:52:32 +0000 (20:52 +0000)
commit41cea417fa6d4e25ed06b5e3c555c16766337eb5
tree5654d6c1a849911c37e057917d07549ae80f2ab3
parent8cc212a07e6fc1918c1d9ada10f972830bf5a907
There is only one current section.

Both MCStreamer and MCObjectStreamer were maintaining a current section
variable and they were slightly out of sync. I don't think this was observable,
but was inefficient and error prone.

Changing this requires a few cascading changes:

* SwitchSection has to call ChangeSection earlier for ChangeSection to see
  the old section.
* With that change, ChangeSection cannot call EmitLabel, since during
  ChangeSection we are still in the old section.
* When the object streamer requires a begin label, just reused the existing
  generic support for begin labels instead of calling EmitLabel directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238357 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCObjectStreamer.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCELFStreamer.cpp
lib/MC/MCMachOStreamer.cpp
lib/MC/MCObjectStreamer.cpp
lib/MC/MCParser/AsmParser.cpp
lib/MC/MCParser/ELFAsmParser.cpp
lib/MC/MCStreamer.cpp