<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 3, 2013, at 11:12 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Why is this in @implementation? It's not legal to provide a superclass name there, only in @interface, right?</div><div><br></div><div>Jordan</div></div></blockquote><div><br></div><div>This is legal:</div><div><br></div><div><div>@interface S</div><div>@end</div><div><br></div><div>@interface I : S</div><div>@end</div><div><br></div><div>@implementation I : S</div><div>@end</div></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><br><div><div>On May 3, 2013, at 11:05 , Argyrios Kyrtzidis <<a href="mailto:akyrtzi@gmail.com">akyrtzi@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: akirtzidis<br>Date: Fri May  3 13:05:44 2013<br>New Revision: 181039<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=181039&view=rev">http://llvm.org/viewvc/llvm-project?rev=181039&view=rev</a><br>Log:<br>Keep track of an @implementation's super class name location, if one was provided.<br><br>Modified:<br>   cfe/trunk/include/clang/AST/DeclObjC.h<br>   cfe/trunk/lib/AST/ASTImporter.cpp<br>   cfe/trunk/lib/AST/DeclObjC.cpp<br>   cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>   cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>   cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br><br>Modified: cfe/trunk/include/clang/AST/DeclObjC.h<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/DeclObjC.h (original)<br>+++ cfe/trunk/include/clang/AST/DeclObjC.h Fri May  3 13:05:44 2013<br>@@ -1798,6 +1798,8 @@ class ObjCImplementationDecl : public Ob<br>  virtual void anchor();<br>  /// Implementation Class's super class.<br>  ObjCInterfaceDecl *SuperClass;<br>+  SourceLocation SuperLoc;<br>+<br>  /// \@implementation may have private ivars.<br>  SourceLocation IvarLBraceLoc;<br>  SourceLocation IvarRBraceLoc;<br>@@ -1818,10 +1820,11 @@ class ObjCImplementationDecl : public Ob<br>                         ObjCInterfaceDecl *classInterface,<br>                         ObjCInterfaceDecl *superDecl,<br>                         SourceLocation nameLoc, SourceLocation atStartLoc,<br>+                         SourceLocation superLoc = SourceLocation(),<br>                         SourceLocation IvarLBraceLoc=SourceLocation(),<span class="Apple-converted-space"> </span><br>                         SourceLocation IvarRBraceLoc=SourceLocation())<br>    : ObjCImplDecl(ObjCImplementation, DC, classInterface, nameLoc, atStartLoc),<br>-       SuperClass(superDecl), IvarLBraceLoc(IvarLBraceLoc),<span class="Apple-converted-space"> </span><br>+       SuperClass(superDecl), SuperLoc(superLoc), IvarLBraceLoc(IvarLBraceLoc),<br>       IvarRBraceLoc(IvarRBraceLoc),<br>       IvarInitializers(0), NumIvarInitializers(0),<br>       HasNonZeroConstructors(false), HasDestructors(false) {}<br>@@ -1831,6 +1834,7 @@ public:<br>                                        ObjCInterfaceDecl *superDecl,<br>                                        SourceLocation nameLoc,<br>                                        SourceLocation atStartLoc,<br>+                                     SourceLocation superLoc = SourceLocation(),<br>                                        SourceLocation IvarLBraceLoc=SourceLocation(),<span class="Apple-converted-space"> </span><br>                                        SourceLocation IvarRBraceLoc=SourceLocation());<br><br>@@ -1903,6 +1907,7 @@ public:<br><br>  const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }<br>  ObjCInterfaceDecl *getSuperClass() { return SuperClass; }<br>+  SourceLocation getSuperLoc() const { return SuperLoc; }<br><br>  void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }<br><br><br>Modified: cfe/trunk/lib/AST/ASTImporter.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br>+++ cfe/trunk/lib/AST/ASTImporter.cpp Fri May  3 13:05:44 2013<br>@@ -3650,6 +3650,7 @@ Decl *ASTNodeImporter::VisitObjCImplemen<br>                                          Iface, Super,<br>                                          Importer.Import(D->getLocation()),<br>                                          Importer.Import(D->getAtStartLoc()),<br>+                                          Importer.Import(D->getSuperLoc()),<br>                                          Importer.Import(D->getIvarLBraceLoc()),<br>                                          Importer.Import(D->getIvarRBraceLoc()));<br><br><br>Modified: cfe/trunk/lib/AST/DeclObjC.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/DeclObjC.cpp (original)<br>+++ cfe/trunk/lib/AST/DeclObjC.cpp Fri May  3 13:05:44 2013<br>@@ -1648,12 +1648,13 @@ ObjCImplementationDecl::Create(ASTContex<br>                               ObjCInterfaceDecl *SuperDecl,<br>                               SourceLocation nameLoc,<br>                               SourceLocation atStartLoc,<br>+                               SourceLocation superLoc,<br>                               SourceLocation IvarLBraceLoc,<br>                               SourceLocation IvarRBraceLoc) {<br>  if (ClassInterface && ClassInterface->hasDefinition())<br>    ClassInterface = ClassInterface->getDefinition();<br>  return new (C) ObjCImplementationDecl(DC, ClassInterface, SuperDecl,<br>-                                        nameLoc, atStartLoc,<br>+                                        nameLoc, atStartLoc, superLoc,<br>                                        IvarLBraceLoc, IvarRBraceLoc);<br>}<br><br><br>Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Fri May  3 13:05:44 2013<br>@@ -1045,7 +1045,7 @@ Decl *Sema::ActOnStartClassImplementatio<br><br>  ObjCImplementationDecl* IMPDecl =<br>    ObjCImplementationDecl::Create(Context, CurContext, IDecl, SDecl,<br>-                                   ClassLoc, AtClassImplLoc);<br>+                                   ClassLoc, AtClassImplLoc, SuperClassLoc);<br><br>  if (CheckObjCDeclScope(IMPDecl))<br>    return ActOnObjCContainerStartDefinition(IMPDecl);<br><br>Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)<br>+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Fri May  3 13:05:44 2013<br>@@ -849,6 +849,7 @@ void ASTDeclReader::VisitObjCCategoryImp<br>void ASTDeclReader::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {<br>  VisitObjCImplDecl(D);<br>  D->setSuperClass(ReadDeclAs<ObjCInterfaceDecl>(Record, Idx));<br>+  D->SuperLoc = ReadSourceLocation(Record, Idx);<br>  D->setIvarLBraceLoc(ReadSourceLocation(Record, Idx));<br>  D->setIvarRBraceLoc(ReadSourceLocation(Record, Idx));<br>  D->setHasNonZeroConstructors(Record[Idx++]);<br><br>Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=181039&r1=181038&r2=181039&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=181039&r1=181038&r2=181039&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)<br>+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Fri May  3 13:05:44 2013<br>@@ -613,6 +613,7 @@ void ASTDeclWriter::VisitObjCCategoryImp<br>void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {<br>  VisitObjCImplDecl(D);<br>  Writer.AddDeclRef(D->getSuperClass(), Record);<br>+  Writer.AddSourceLocation(D->getSuperLoc(), Record);<br>  Writer.AddSourceLocation(D->getIvarLBraceLoc(), Record);<br>  Writer.AddSourceLocation(D->getIvarRBraceLoc(), Record);<br>  Record.push_back(D->hasNonZeroConstructors());<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></div></blockquote></div><br></body></html>