diff options
author | Rui Ueyama <ruiu@google.com> | 2019-05-16 02:14:00 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2019-05-16 02:14:00 +0000 |
commit | 7d4761928e7895650b5f57a30a1be250de4082df (patch) | |
tree | 70e2503082abaf0d92f2deb92dd6899852be0cc8 /llvm/lib/Object/Object.cpp | |
parent | 3d09131aeed691bbb88db76afd64028bb72588cc (diff) | |
download | llvm-7d4761928e7895650b5f57a30a1be250de4082df.zip llvm-7d4761928e7895650b5f57a30a1be250de4082df.tar.gz llvm-7d4761928e7895650b5f57a30a1be250de4082df.tar.bz2 |
Simplify SymbolTable::add{Defined,Undefined,...} functions.
SymbolTable's add-family functions have lots of parameters because
when they have to create a new symbol, they forward given arguments
to Symbol's constructors. Therefore, the functions take at least as
many arguments as their corresponding constructors.
This patch simplifies the add-family functions. Now, the functions
take a symbol instead of arguments to construct a symbol. If there's
no existing symbol, a given symbol is memcpy'ed to the symbol table.
Otherwise, the functions attempt to merge the existing and a given
new symbol.
I also eliminated `CanOmitFromDynSym` parameter, so that the functions
take really one argument.
Symbol classes are trivially constructible, so looks like constructing
them to pass to add-family functions is as cheap as passing a lot of
arguments to the functions. A quick benchmark showed that this patch
seems performance-neutral.
This is a preparation for
http://lists.llvm.org/pipermail/llvm-dev/2019-April/131902.html
Differential Revision: https://reviews.llvm.org/D61855
llvm-svn: 360838
Diffstat (limited to 'llvm/lib/Object/Object.cpp')
0 files changed, 0 insertions, 0 deletions