[PATCH] D66130: [ELF] Initialize 2 fields of Symbol in SymbolTable::insert

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 02:59:59 PDT 2019


peter.smith added a comment.

LGTM too, I agree with George that making the comment specific isn't helpful but a general one isn't doing any harm.

An alternative is to make an initialization function in Symbol and have the default constructor call that for the bitfields. This could be called from SymbolTable::insert. This would have the benefit that we'd only have to update one place for a new field. I notice that canInline is given a different default value from the default constructor, but if this is important it could be a parameter to the initialization function.

A further alternative is to wrap the bitfields in a struct that can be initialized and copied as a whole, but would require every use of one of the fields to be updated.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66130/new/

https://reviews.llvm.org/D66130





More information about the llvm-commits mailing list