]> granicus.if.org Git - llvm/commit
ADT: Save a word in every StringSet entry
authorJordan Rose <jordan_rose@apple.com>
Thu, 10 Oct 2019 20:22:53 +0000 (20:22 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 10 Oct 2019 20:22:53 +0000 (20:22 +0000)
commit404192053aec766e0498633763c60b0a1e87712c
tree5241ad8bcb8c3adf9d6680550a2e4cf7d80809f9
parent0e8408c6d44e10287875c1bb151dae1c8515284f
ADT: Save a word in every StringSet entry

Add a specialization to StringMap (actually StringMapEntry) for a
value type of NoneType (the type of llvm::None), and use it for
StringSet. This'll save us a word from every entry in a StringSet,
used for alignment with the size_t that stores the string length.

I could have gone all the way to some kind of empty base class
optimization, but that seemed like overkill. Someone can consider
adding that in the future, though.

https://reviews.llvm.org/D68586

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374440 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringMap.h
include/llvm/ADT/StringSet.h
include/llvm/IR/Metadata.h
include/llvm/LTO/legacy/LTOCodeGenerator.h
lib/LTO/LTOCodeGenerator.cpp