IR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 6 Apr 2016 17:56:08 +0000 (17:56 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 6 Apr 2016 17:56:08 +0000 (17:56 +0000)
commitef06d445e09eb8b4204f5cdc877d82b6ec4d1cf0
tree809e442de771c3fe52e6e39b09324d7663e2c95e
parentf3d08ef59af271ee8fae2f37708cfb67c821442a
IR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC

Use a DenseSet instead of a DenseMap for constants in LLVMContextImpl.
Last time I looked at this was some time before r223588, when
DenseSet<V> had no advantage over DenseMap<V,char>.  After r223588,
there's a 50% memory savings.

This is all mechanical.  There were little bits of missing API from
DenseSet so I added the trivial implementations:

  - iterator::operator++(int)
  - template <class LookupKeyT> insert_as(ValueTy, LookupKeyT)

There should be no functionality change, just reduced memory consumption
(this wasn't on a profile or anything; just a cleanup I stumbled on).

llvm-svn: 265577
llvm/include/llvm/ADT/DenseSet.h
llvm/lib/IR/ConstantsContext.h
llvm/lib/IR/LLVMContextImpl.cpp