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)
commitaab67b571a3dc984d8990fdb05285c76b11f83d6
tree745c5a9a6b1f9d590bb5527fea9a95ee01632948
parent2f56266234e55b12437c800327c96a65e305bf08
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

llvm-svn: 374440
llvm/include/llvm/ADT/StringMap.h
llvm/include/llvm/ADT/StringSet.h
llvm/include/llvm/IR/Metadata.h
llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
llvm/lib/LTO/LTOCodeGenerator.cpp