summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/AsmParser.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-30 06:17:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-30 06:17:16 +0000
commit6a715dccdf596d39d2b480beac48385f1fa73219 (patch)
treea2e9ef2faf74adcc76246e6f17d82939becce971 /llvm/tools/llvm-mc/AsmParser.cpp
parent905976b1db17157b8ae04953bb052b76928b6ba7 (diff)
downloadbcm5719-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.cpp21
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
OpenPOWER on IntegriCloud