forked from OSchip/llvm-project
Copy symbol length when we replace a symbol.
Symbol's NameSize is computed lazily. Currently, when we replace a symbol, a cached length value can be discarded. This patch propagates that value. Differential Revision: https://reviews.llvm.org/D62234 llvm-svn: 361364
This commit is contained in:
parent
091aaa69d3
commit
ecf6eb515f
|
@ -486,6 +486,11 @@ void Symbol::replace(const Symbol &New) {
|
|||
IsPreemptible = Old.IsPreemptible;
|
||||
ScriptDefined = Old.ScriptDefined;
|
||||
|
||||
// Symbol length is computed lazily. If we already know a symbol length,
|
||||
// propagate it.
|
||||
if (NameData == Old.NameData && NameSize == 0 && Old.NameSize != 0)
|
||||
NameSize = Old.NameSize;
|
||||
|
||||
// Print out a log message if --trace-symbol was specified.
|
||||
// This is for debugging.
|
||||
if (Traced)
|
||||
|
|
Loading…
Reference in New Issue