#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
+#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/SourceMgr.h"
return TokError("unexpected token in '.section' directive");
Lexer.Lex();
- Out.SwitchSection(Ctx.GetSection(Section.c_str()));
+ // FIXME: Arch specific.
+ MCSection *S = Ctx.GetSection(Section);
+ if (S == 0)
+ S = MCSection::Create(Section, Ctx);
+
+ Out.SwitchSection(S);
return false;
}
SectionStr += Directives;
}
- Out.SwitchSection(Ctx.GetSection(Section));
+ // FIXME: Arch specific.
+ MCSection *S = Ctx.GetSection(Section);
+ if (S == 0)
+ S = MCSection::Create(Section, Ctx);
+
+ Out.SwitchSection(S);
return false;
}
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/CommandLine.h"
OwningPtr<MCStreamer> Str(createAsmStreamer(Ctx, outs()));
// FIXME: Target hook & command line option for initial section.
- Str.get()->SwitchSection(Ctx.GetSection("__TEXT,__text,"
- "regular,pure_instructions"));
+ Str.get()->SwitchSection(MCSection::Create("__TEXT,__text,"
+ "regular,pure_instructions", Ctx));
AsmParser Parser(SrcMgr, Ctx, *Str.get());
OwningPtr<TargetAsmParser> TAP(GetTargetAsmParser(ProgName, Parser));