[PATCH] D17879: [ELF] - Simplify a SymbolBody interface a bit.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 01:56:34 PST 2016


grimar created this revision.
grimar added reviewers: davide, emaste, rafael, ruiu.
grimar added subscribers: llvm-commits, grimar.

I think we can get rid of few accessors in that class, and replace
them with direct field access.

Positive features from that are (just an IMHO of course):
* Use of direct fields instead of accessor is more readable as you can never know the exact logic of accessor when looking on it (will it just return the pre-ready result or has some condition).
* Code generally is a bit shorter (please refer to the patch code).
* Less methods in interfaces.
* Currently 2 bitfields *probably* consume less memory than single int8 (that depends on structures aligment I think and I did not look close on difference for this patch). Also looks like we will not need any other flags, but even if we will, I think 1-2 new bitfields is probably more preferable than 1-2 new methods because of profits mentioned above.

http://reviews.llvm.org/D17879

Files:
  ELF/InputSection.cpp
  ELF/OutputSections.cpp
  ELF/SymbolTable.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/Target.cpp
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17879.49804.patch
Type: text/x-patch
Size: 5807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160304/dd95a27e/attachment.bin>


More information about the llvm-commits mailing list