Assume that we'll handle mangling the symbols earlier and just put the
authorEric Christopher <echristo@apple.com>
Mon, 17 May 2010 02:13:02 +0000 (02:13 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 17 May 2010 02:13:02 +0000 (02:13 +0000)
symbol to the file as we have it.  Simplifies out tbss handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103928 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCAsmStreamer.cpp
lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/directive_tbss.s

index 62735ad3f3a9a4f3f89bc9697c5d6610fc5db5ad..4f7699ca99d85da1e7933f6505e30404a06767db 100644 (file)
@@ -363,14 +363,13 @@ void MCAsmStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
   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);
index 18977de8adb9e035126a64f7fbb1f5dea1d6a9a4..e5af357de34d37ea0bec6e6f0b1f968354e2511e 100644 (file)
@@ -1436,13 +1436,9 @@ bool AsmParser::ParseDirectiveDarwinTBSS() {
   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");
index 01ba17be26372ae34657198c0e8cb3cd1f2e7008..38d3a3e1fcf28ac58ee86c881d4209226aaf81fc 100644 (file)
@@ -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