The two classes are the same other than a few exceptions. This patch merges them using templates. llvm-svn: 234060