[llvm-commits] [llvm] r77700 - /llvm/trunk/tools/llvm-mc/AsmParser.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 31 11:27:48 PDT 2009
Author: lattner
Date: Fri Jul 31 13:27:48 2009
New Revision: 77700
URL: http://llvm.org/viewvc/llvm-project?rev=77700&view=rev
Log:
fix some more issues where we expected GetSection to do "get or create"
Modified:
llvm/trunk/tools/llvm-mc/AsmParser.cpp
Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=77700&r1=77699&r2=77700&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Fri Jul 31 13:27:48 2009
@@ -1052,8 +1052,13 @@
// If this is the end of the line all that was wanted was to create the
// the section but with no symbol.
if (Lexer.is(AsmToken::EndOfStatement)) {
+ // FIXME: Arch specific.
+ MCSection *S = Ctx.GetSection(Section);
+ if (S == 0)
+ S = MCSection::Create(Section, Ctx);
+
// Create the zerofill section but no symbol
- Out.EmitZerofill(Ctx.GetSection(Section.c_str()));
+ Out.EmitZerofill(S);
return false;
}
@@ -1107,8 +1112,13 @@
if (Sym->getSection() || Ctx.GetSymbolValue(Sym))
return Error(IDLoc, "invalid symbol redefinition");
+ // FIXME: Arch specific.
+ MCSection *S = Ctx.GetSection(Section);
+ if (S == 0)
+ S = MCSection::Create(Section, Ctx);
+
// Create the zerofill Symbol with Size and Pow2Alignment
- Out.EmitZerofill(Ctx.GetSection(Section.c_str()), Sym, Size, Pow2Alignment);
+ Out.EmitZerofill(S, Sym, Size, Pow2Alignment);
return false;
}
More information about the llvm-commits
mailing list