Delay creating an alias for @@@.

With this we only create an alias for @@@ once we know if it should
use @ or @@. This avoids last minutes renames and hacks to handle MS
names.

This only handles the ELF writer. LTO still has issues with @@@
aliases.

llvm-svn: 327160
diff --git a/llvm/lib/Object/RecordStreamer.cpp b/llvm/lib/Object/RecordStreamer.cpp
index a9e3a46..56e9ce7 100644
--- a/llvm/lib/Object/RecordStreamer.cpp
+++ b/llvm/lib/Object/RecordStreamer.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "RecordStreamer.h"
+#include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCSymbol.h"
 
 using namespace llvm;
@@ -112,8 +113,9 @@
   markDefined(*Symbol);
 }
 
-void RecordStreamer::emitELFSymverDirective(MCSymbol *Alias,
+void RecordStreamer::emitELFSymverDirective(StringRef AliasName,
                                             const MCSymbol *Aliasee) {
+  MCSymbol *Alias = getContext().getOrCreateSymbol(AliasName);
   const MCExpr *Value = MCSymbolRefExpr::create(Aliasee, getContext());
   EmitAssignment(Alias, Value);
   SymverAliasMap[Aliasee].push_back(Alias);
diff --git a/llvm/lib/Object/RecordStreamer.h b/llvm/lib/Object/RecordStreamer.h
index 4d11909..e1e23f2 100644
--- a/llvm/lib/Object/RecordStreamer.h
+++ b/llvm/lib/Object/RecordStreamer.h
@@ -54,7 +54,7 @@
   void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
                         unsigned ByteAlignment) override;
   /// Record .symver aliases for later processing.
-  void emitELFSymverDirective(MCSymbol *Alias,
+  void emitELFSymverDirective(StringRef AliasName,
                               const MCSymbol *Aliasee) override;
   /// Return the map of .symver aliasee to associated aliases.
   DenseMap<const MCSymbol *, std::vector<MCSymbol *>> &symverAliases() {