IR: Extract set logic from Instruction attachments, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 24 Apr 2015 20:36:25 +0000 (20:36 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 24 Apr 2015 20:36:25 +0000 (20:36 +0000)
commitcbc28dc549ca03e6db3b6b0c7d373cc44487032c
treed159dea196ff1de17cd0b6f3291de1e8c70a0e6c
parentcfbfe6f29cb9f66766fe0851062ca239a8299acb
IR: Extract set logic from Instruction attachments, NFC

Extract the set logic for metadata attachments from `Instruction` so it
can be reused for `Function` (PR23340).

This data structure makes a `SmallVector<>` look (a little) like a map,
just doing the bare minimum to support the `Instruction` (and soon,
`Function`) metadata API.

llvm-svn: 235769
llvm/lib/IR/LLVMContextImpl.h
llvm/lib/IR/Metadata.cpp