1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

fix some more issues where we expected GetSection to do "get or create"

llvm-svn: 77700
This commit is contained in:
Chris Lattner 2009-07-31 18:27:48 +00:00
parent 6bec53e39d
commit 4d1b33e52e

View File

@ -1052,8 +1052,13 @@ bool AsmParser::ParseDirectiveDarwinZerofill() {
// 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 @@ bool AsmParser::ParseDirectiveDarwinZerofill() {
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;
}