Hm. This doesn't look like it will actually handle pairs containing any non-struct type, where you have to use AddInteger or AddPointer as appropriate. (Why don't those have FoldingSetTraits directly?) http://reviews.llvm.org/D3895