aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-31 18:27:48 +0000
committerChris Lattner <sabre@nondot.org>2009-07-31 18:27:48 +0000
commit6bdd74ca382db0d7125c5b1bf36a34254491d7e5 (patch)
treeca5940e93f69a5b659dc91b0fc73414455001a25 /tools
parent69bff07b4dc95fd0cc9d7580977beb08259daa17 (diff)
downloadexternal_llvm-6bdd74ca382db0d7125c5b1bf36a34254491d7e5.zip
external_llvm-6bdd74ca382db0d7125c5b1bf36a34254491d7e5.tar.gz
external_llvm-6bdd74ca382db0d7125c5b1bf36a34254491d7e5.tar.bz2
fix some more issues where we expected GetSection to do "get or create"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-mc/AsmParser.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp
index 8348479..90a9a33 100644
--- a/tools/llvm-mc/AsmParser.cpp
+++ b/tools/llvm-mc/AsmParser.cpp
@@ -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;
}