diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-30 06:17:16 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-30 06:17:16 +0000 |
| commit | 6a715dccdf596d39d2b480beac48385f1fa73219 (patch) | |
| tree | a2e9ef2faf74adcc76246e6f17d82939becce971 /llvm/tools/llvm-mc/AsmParser.cpp | |
| parent | 905976b1db17157b8ae04953bb052b76928b6ba7 (diff) | |
| download | bcm5719-llvm-6a715dccdf596d39d2b480beac48385f1fa73219.tar.gz bcm5719-llvm-6a715dccdf596d39d2b480beac48385f1fa73219.zip | |
llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).
llvm-svn: 80484
Diffstat (limited to 'llvm/tools/llvm-mc/AsmParser.cpp')
| -rw-r--r-- | llvm/tools/llvm-mc/AsmParser.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/tools/llvm-mc/AsmParser.cpp b/llvm/tools/llvm-mc/AsmParser.cpp index 74512ca9353..032b25eeb64 100644 --- a/llvm/tools/llvm-mc/AsmParser.cpp +++ b/llvm/tools/llvm-mc/AsmParser.cpp @@ -1257,15 +1257,17 @@ bool AsmParser::ParseDirectiveComm(bool IsLocal) { if (!Sym->isUndefined()) return Error(IDLoc, "invalid symbol redefinition"); + // '.lcomm' is equivalent to '.zerofill'. // Create the Symbol as a common or local common with Size and Pow2Alignment - if (IsLocal) + if (IsLocal) { Out.EmitZerofill(getMachOSection("__DATA", "__bss", MCSectionMachO::S_ZEROFILL, 0, SectionKind()), - Sym, Size, Pow2Alignment); - else - Out.EmitCommonSymbol(Sym, Size, Pow2Alignment); + Sym, Size, 1 << Pow2Alignment); + return false; + } + Out.EmitCommonSymbol(Sym, Size, 1 << Pow2Alignment); return false; } @@ -1355,7 +1357,7 @@ bool AsmParser::ParseDirectiveDarwinZerofill() { Out.EmitZerofill(getMachOSection(Segment, Section, MCSectionMachO::S_ZEROFILL, 0, SectionKind()), - Sym, Size, Pow2Alignment); + Sym, Size, 1 << Pow2Alignment); return false; } @@ -1426,10 +1428,11 @@ bool AsmParser::ParseDirectiveDarwinLsym() { Lexer.Lex(); - // Create the Sym with the value of the Expr - Out.EmitLocalSymbol(Sym, Expr); - - return false; + // We don't currently support this directive. + // + // FIXME: Diagnostic location! + (void) Sym; + return TokError("directive '.lsym' is unsupported"); } /// ParseDirectiveInclude |

