Lift self-copy protection up to the header file and add self-move
authorChandler Carruth <chandlerc@gmail.com>
Tue, 26 Nov 2013 00:54:44 +0000 (00:54 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 26 Nov 2013 00:54:44 +0000 (00:54 +0000)
commitffd79061ccfea4c884d4d2646992aa30cf6514a2
tree820779ffbf112b404518d55f635d628001974851
parentb30824e1b97b9d2b4c8e11a5d684bef5b816b887
Lift self-copy protection up to the header file and add self-move
protection to the same layer.

This is in line with Howard's advice on how best to handle self-move
assignment as he explained on SO[1]. It also ensures that implementing
swap with move assignment continues to work in the case of self-swap.

[1]: http://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195705 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/SmallPtrSet.h
lib/Support/SmallPtrSet.cpp