Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index faa4f5c..f07b9e0 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -767,9 +767,9 @@
   ObjCIvarDecl *curIvar = 0;
   if (!ivar_empty()) {
     ObjCInterfaceDecl::ivar_iterator I = ivar_begin(), E = ivar_end();
-    data().IvarList = &*I; ++I;
-    for (curIvar = data().IvarList; I != E; curIvar = &*I, ++I)
-      curIvar->setNextIvar(&*I);
+    data().IvarList = *I; ++I;
+    for (curIvar = data().IvarList; I != E; curIvar = *I, ++I)
+      curIvar->setNextIvar(*I);
   }
   
   for (const ObjCCategoryDecl *CDecl = getFirstClassExtension(); CDecl;
@@ -778,11 +778,11 @@
       ObjCCategoryDecl::ivar_iterator I = CDecl->ivar_begin(),
                                           E = CDecl->ivar_end();
       if (!data().IvarList) {
-        data().IvarList = &*I; ++I;
+        data().IvarList = *I; ++I;
         curIvar = data().IvarList;
       }
-      for ( ;I != E; curIvar = &*I, ++I)
-        curIvar->setNextIvar(&*I);
+      for ( ;I != E; curIvar = *I, ++I)
+        curIvar->setNextIvar(*I);
     }
   }
   
@@ -791,11 +791,11 @@
       ObjCImplementationDecl::ivar_iterator I = ImplDecl->ivar_begin(),
                                             E = ImplDecl->ivar_end();
       if (!data().IvarList) {
-        data().IvarList = &*I; ++I;
+        data().IvarList = *I; ++I;
         curIvar = data().IvarList;
       }
-      for ( ;I != E; curIvar = &*I, ++I)
-        curIvar->setNextIvar(&*I);
+      for ( ;I != E; curIvar = *I, ++I)
+        curIvar->setNextIvar(*I);
     }
   }
   return data().IvarList;
@@ -1175,7 +1175,7 @@
 ObjCPropertyImplDecl *ObjCImplDecl::
 FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const {
   for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
-    ObjCPropertyImplDecl *PID = &*i;
+    ObjCPropertyImplDecl *PID = *i;
     if (PID->getPropertyIvarDecl() &&
         PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
       return PID;
@@ -1190,7 +1190,7 @@
 ObjCPropertyImplDecl *ObjCImplDecl::
 FindPropertyImplDecl(IdentifierInfo *Id) const {
   for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
-    ObjCPropertyImplDecl *PID = &*i;
+    ObjCPropertyImplDecl *PID = *i;
     if (PID->getPropertyDecl()->getIdentifier() == Id)
       return PID;
   }