Make replaceSymbol a member function of Symbol.

This is a mechanical rewrite of replaceSymbol(A, B) to A->replace(B).
I also added a comment to Symbol::replace().

Technically this change is not necessary, but this change makes code a
bit more concise.

Differential Revision: https://reviews.llvm.org/D62117

llvm-svn: 361123
This commit is contained in:
Rui Ueyama
2019-05-20 03:36:33 +00:00
parent a6720e7407
commit faf541e1e1
6 changed files with 50 additions and 46 deletions

View File

@@ -530,8 +530,8 @@ static void replaceWithDefined(Symbol &Sym, SectionBase *Sec, uint64_t Value,
uint64_t Size) {
Symbol Old = Sym;
replaceSymbol(&Sym, Defined{Sym.File, Sym.getName(), Sym.Binding, Sym.StOther,
Sym.Type, Value, Size, Sec});
Sym.replace(Defined{Sym.File, Sym.getName(), Sym.Binding, Sym.StOther,
Sym.Type, Value, Size, Sec});
Sym.PltIndex = Old.PltIndex;
Sym.GotIndex = Old.GotIndex;