llvm-6502/tools/lto
Eli Bendersky 030f63a397 Expose an InitToTextSection through MCStreamer.
The aim of this patch is to fix the following piece of code in the
platform-independent AsmParser:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.SwitchSection(Ctx.getMachOSection(
                        "__TEXT", "__text",
                        MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
                        0, SectionKind::getText()));
  }
}

This was added for the "-n" option of llvm-mc.

The proposed fix adds another virtual method to MCStreamer, called
InitToTextSection. Conceptually, it's similar to the existing
InitSections which initializes all common sections and switches to
text. The new method is implemented by each platform streamer in a way
that it sees fit. So AsmParser can now do this:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.InitToTextSection();
  }
}

Which is much more reasonable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172450 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:04:57 +00:00
..
CMakeLists.txt [CMake] Update dependencies to intrinsics_gen corresponding to r169711. 2012-12-10 05:27:15 +00:00
lto.cpp Revert r169656. 2012-12-10 21:33:45 +00:00
lto.exports Revert r169656. 2012-12-10 21:33:45 +00:00
LTOCodeGenerator.cpp Switch TargetTransformInfo from an immutable analysis pass that requires 2013-01-07 01:37:14 +00:00
LTOCodeGenerator.h Revert r169656. 2012-12-10 21:33:45 +00:00
LTODisassembler.cpp libLTO: Add a utility method to initialize the disassemblers. 2012-11-24 16:59:10 +00:00
LTOModule.cpp Expose an InitToTextSection through MCStreamer. 2013-01-14 19:04:57 +00:00
LTOModule.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
Makefile Place temporary LTO files into their own subdirectory. 2012-10-10 05:29:15 +00:00