IR: Simplify uniquing for MDNode
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 17 Nov 2014 23:28:21 +0000 (23:28 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 17 Nov 2014 23:28:21 +0000 (23:28 +0000)
commit66a2b0564e2f7a4ab0021c2a9edf849d782c7f02
tree22fa0c2acd47d319c2c663cc9ba947710fc2c7b6
parent8083adcaca55889a224904c2fcca6151137c9e14
IR: Simplify uniquing for MDNode

Change uniquing from a `FoldingSet` to a `DenseSet` with custom
`DenseMapInfo`.  Unfortunately, this doesn't save any memory, since
`DenseSet<T>` is a simple wrapper for `DenseMap<T, char>`, but I'll come
back to fix that later.

I used the name `GenericDenseMapInfo` to the custom `DenseMapInfo` since
I'll be splitting `MDNode` into two classes soon: `MDNodeFwdDecl` for
temporaries, and `GenericMDNode` for everything else.

I also added a non-debug-info reduced version of a type-uniquing test
that started failing on an earlier draft of this patch.

Part of PR21532.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222191 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Metadata.h
lib/IR/LLVMContextImpl.cpp
lib/IR/LLVMContextImpl.h
lib/IR/Metadata.cpp
test/Linker/Inputs/unique-fwd-decl-b.ll [new file with mode: 0644]
test/Linker/unique-fwd-decl-a.ll [new file with mode: 0644]