[llvm-commits] [llvm] r103928 - in /llvm/trunk: lib/MC/MCAsmStreamer.cpp lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/directive_tbss.s
Eric Christopher
echristo at apple.com
Sun May 16 19:13:02 PDT 2010
Author: echristo
Date: Sun May 16 21:13:02 2010
New Revision: 103928
URL: http://llvm.org/viewvc/llvm-project?rev=103928&view=rev
Log:
Assume that we'll handle mangling the symbols earlier and just put the
symbol to the file as we have it. Simplifies out tbss handling.
Modified:
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/directive_tbss.s
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=103928&r1=103927&r2=103928&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Sun May 16 21:13:02 2010
@@ -363,14 +363,13 @@
EmitEOL();
}
-// .tbss sym$tlv$init, size, align
+// .tbss sym, size, align
+// This depends that the symbol has already been mangled from the original,
+// e.g. _a.
void MCAsmStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {
assert(Symbol != NULL && "Symbol shouldn't be NULL!");
- OS << ".tbss ";
-
- // This is a mach-o specific directive and the name requires some mangling.
- OS << *Symbol << "$tlv$init, " << Size;
+ OS << ".tbss " << *Symbol << ", " << Size;
// Output align if we have it.
if (ByteAlignment != 0) OS << ", " << Log2_32(ByteAlignment);
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=103928&r1=103927&r2=103928&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sun May 16 21:13:02 2010
@@ -1436,13 +1436,9 @@
StringRef Name;
if (ParseIdentifier(Name))
return TokError("expected identifier in directive");
-
- // Demangle the name output. The trailing characters are guaranteed to be
- // $tlv$init so just strip that off.
- StringRef DemName = Name.substr(0, Name.size() - strlen("$tlv$init"));
-
+
// Handle the identifier as the key symbol.
- MCSymbol *Sym = CreateSymbol(DemName);
+ MCSymbol *Sym = CreateSymbol(Name);
if (Lexer.isNot(AsmToken::Comma))
return TokError("unexpected token in directive");
Modified: llvm/trunk/test/MC/AsmParser/directive_tbss.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_tbss.s?rev=103928&r1=103927&r2=103928&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_tbss.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_tbss.s Sun May 16 21:13:02 2010
@@ -1,4 +1,4 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
+# RUN: llvm-mc -triple i386-unknown-darwin %s | FileCheck %s
# CHECK: .tbss _a$tlv$init, 4
# CHECK: .tbss _b$tlv$init, 4, 3
More information about the llvm-commits
mailing list