Skip to content
  • Chris Lattner's avatar
    Switch initialization of the protocol list for an interface decl to use · ca1e8485
    Chris Lattner authored
    the standard "set these as the list of protocols" interface instead of a 
    strange "set this as the size and then set each one to the value" interface.
    The problem with the later is that it a) is completely different from 
    everything else, b) is awkward, and c) doesn't handle the case when a
    referenced protocol is invalid: it set it to null.
    
    This meant that all clients downstream would have to handle null protocols
    in the protocol list, and empirically they didn't.  Fix this by not setting
    invalid protocols in the referenced protocol list, fixing the crash on 
    test/Sema/objc-interface-1.m
    
    While I'm at it, clean up some locations so that we produce:
    
    t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
    @interface NSWhatever : NSObject <NSCopying>
    ~~~~~~~~~~~~~~~~~~~~~   ^
    
    instead of:
    
    t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
    @interface NSWhatever : NSObject <NSCopying>
    ^
    
    llvm-svn: 53846
    ca1e8485
Loading