diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-03-09 18:42:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-03-09 18:42:25 +0000 |
commit | 47b4d6ba196d09900284caff7ed372b3878f28ef (patch) | |
tree | df9dca690710ef6908ad52eba2cc20f94afba41f /llvm/lib/Object | |
parent | 2cd489feb2b99d1a24aab4c8971ae528e0b77d78 (diff) | |
download | bcm5719-llvm-47b4d6ba196d09900284caff7ed372b3878f28ef.tar.gz bcm5719-llvm-47b4d6ba196d09900284caff7ed372b3878f28ef.zip |
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
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/RecordStreamer.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Object/RecordStreamer.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Object/RecordStreamer.cpp b/llvm/lib/Object/RecordStreamer.cpp index a9e3a46b519..56e9ce73047 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 @@ void RecordStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, 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 4d119091a3d..e1e23f260ac 100644 --- a/llvm/lib/Object/RecordStreamer.h +++ b/llvm/lib/Object/RecordStreamer.h @@ -54,7 +54,7 @@ public: 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() { |