llvm-6502/tools
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
..
bugpoint Fix #includes after my last commit. 2013-01-10 21:56:40 +00:00
bugpoint-passes Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
gold Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llc Switch TargetTransformInfo from an immutable analysis pass that requires 2013-01-07 01:37:14 +00:00
lli Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-ar Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-as Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-bcanalyzer Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-config Re-enable support for --program-prefix. 2012-10-01 18:40:32 +00:00
llvm-cov Remove accidental commit. 2012-11-07 18:39:32 +00:00
llvm-diff Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-dis Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-dwarfdump Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-extract Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-jitlistener Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-link Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-mc Remove MCTargetAsmLexer and its derived classes now that edis, 2012-12-20 14:43:30 +00:00
llvm-mcmarkup MC: Simple example parser for MC assembly markup. 2012-10-31 23:24:13 +00:00
llvm-nm Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-objdump [llvm-objdump] Emit addresses with the correct number of leading 0's. 2013-01-10 22:40:50 +00:00
llvm-prof Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-ranlib Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
llvm-readobj Use the generic dump template. Extracted from a patch by Sami Liedes. 2012-12-31 16:53:01 +00:00
llvm-rtdyld Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-shlib Add support for the OpenBSD for Bitrig. 2012-08-06 20:52:18 +00:00
llvm-size Sort the #include lines for tools/... 2012-12-04 10:44:52 +00:00
llvm-stress Move CallGraphSCCPass.h into the Analysis tree; that's where the 2013-01-07 15:26:48 +00:00
llvm-symbolizer llvm-symbolizer: add DATA command that allows to symbolize global variables. 2013-01-11 07:16:20 +00:00
lto Expose an InitToTextSection through MCStreamer. 2013-01-14 19:04:57 +00:00
macho-dump Refactor data-in-code annotations. 2012-05-18 19:12:01 +00:00
opt Added -view-callgraph module pass. 2013-01-11 17:28:14 +00:00
CMakeLists.txt Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
LLVMBuild.txt Adding tests for the Intel JIT event listener's MCJIT support. 2012-11-21 20:38:26 +00:00
Makefile Make building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting. 2012-11-27 01:24:25 +00:00