Reapply r149311 which I reverted by mistake.

 Original log:

 Convert ProgramStateRef to a smart pointer for managing the reference counts of ProgramStates.  This leads to a slight memory
 improvement, and a simplification of the logic for managing ProgramState objects.
 # Please enter the commit message for your changes. Lines starting

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149339 91177308-0d34-0410-b5e6-96231b3b80d8
6 files changed