diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-31 17:47:16 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-31 17:47:16 +0000 |
| commit | 0f5a6fc38b7a40e6f28e6614870ea2683734771d (patch) | |
| tree | dc951cc707e6552f7c006ece9ced8064315df68a /llvm/tools/llvm-mc/AsmParser.cpp | |
| parent | f332516136f31c04519acded563c9fbe4be3e257 (diff) | |
| download | bcm5719-llvm-0f5a6fc38b7a40e6f28e6614870ea2683734771d.tar.gz bcm5719-llvm-0f5a6fc38b7a40e6f28e6614870ea2683734771d.zip | |
fix a bunch of failing tests now that MCContext::GetSection doesn't create sections.
llvm-svn: 77689
Diffstat (limited to 'llvm/tools/llvm-mc/AsmParser.cpp')
| -rw-r--r-- | llvm/tools/llvm-mc/AsmParser.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/tools/llvm-mc/AsmParser.cpp b/llvm/tools/llvm-mc/AsmParser.cpp index 3cd2b8e7540..8348479240d 100644 --- a/llvm/tools/llvm-mc/AsmParser.cpp +++ b/llvm/tools/llvm-mc/AsmParser.cpp @@ -17,6 +17,7 @@ #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" @@ -641,7 +642,12 @@ bool AsmParser::ParseDirectiveDarwinSection() { 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; } @@ -657,7 +663,12 @@ bool AsmParser::ParseDirectiveSectionSwitch(const char *Section, 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; } |

