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 | 7092c7e1dcf9d05741b400dd54bbd7d3419773b2 (patch) | |
tree | 3fad2e13afa525093397708d07283d0378d4884e /tools/llvm-mc/AsmParser.cpp | |
parent | 7a1e924b9a7dde1bf936e38777e48b4dda7e8d1c (diff) |
llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/AsmParser.cpp')
-rw-r--r-- | tools/llvm-mc/AsmParser.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp index 74512ca935..032b25eeb6 100644 --- a/tools/llvm-mc/AsmParser.cpp +++ b/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 |