Add class and super class location info to ObjCInterfaceDecl...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index a0d4ff7..9285872 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -112,7 +112,8 @@
     // Synthesize "@class Protocol;
     ObjCInterfaceDecl *ProtocolDecl =
       ObjCInterfaceDecl::Create(Context, SourceLocation(), 0, 
-                                &Context.Idents.get("Protocol"), true);
+                                &Context.Idents.get("Protocol"), 
+                                SourceLocation(), true);
     Context.setObjCProtoType(Context.getObjCInterfaceType(ProtocolDecl));
     
     // Synthesize "typedef struct objc_object { Class isa; } *id;"
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 1276450..776a50f 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -98,7 +98,7 @@
   }
   else {
     IDecl = ObjCInterfaceDecl::Create(Context, AtInterfaceLoc, NumProtocols,
-                                      ClassName);
+                                      ClassName, ClassLoc);
   
     ObjCInterfaceDecls[ClassName] = IDecl;
     // Remember that this needs to be removed when the scope is popped.
@@ -126,6 +126,7 @@
       }
     }
     IDecl->setSuperClass(SuperClassEntry);
+    IDecl->setSuperClassLoc(SuperLoc);
     IDecl->setLocEnd(SuperLoc);
   } else { // we have a root class.
     IDecl->setLocEnd(ClassLoc);
@@ -383,7 +384,7 @@
     // Legacy case of @implementation with no corresponding @interface.
     // Build, chain & install the interface decl into the identifier.
     IDecl = ObjCInterfaceDecl::Create(Context, AtClassImplLoc, 0, ClassName, 
-                                      false, true);
+                                      ClassLoc, false, true);
     ObjCInterfaceDecls[ClassName] = IDecl;
     IDecl->setSuperClass(SDecl);
     IDecl->setLocEnd(ClassLoc);
@@ -591,7 +592,7 @@
     ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl); 
     if (!IDecl) {  // Not already seen?  Make a forward decl.
       IDecl = ObjCInterfaceDecl::Create(Context, AtClassLoc, 0, IdentList[i],
-                                        true);
+                                        SourceLocation(), true);
       ObjCInterfaceDecls[IdentList[i]] = IDecl;
 
       // Remember that this needs to be removed when the scope is popped.