Handle Objective-C type arguments.
Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241542 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/ASTContext.h 29 additions, 0 deletionsinclude/clang/AST/ASTContext.h
- include/clang/AST/DataRecursiveASTVisitor.h 8 additions, 1 deletioninclude/clang/AST/DataRecursiveASTVisitor.h
- include/clang/AST/DeclObjC.h 25 additions, 17 deletionsinclude/clang/AST/DeclObjC.h
- include/clang/AST/RecursiveASTVisitor.h 8 additions, 0 deletionsinclude/clang/AST/RecursiveASTVisitor.h
- include/clang/AST/Type.h 98 additions, 17 deletionsinclude/clang/AST/Type.h
- include/clang/AST/TypeLoc.h 63 additions, 24 deletionsinclude/clang/AST/TypeLoc.h
- include/clang/Basic/DiagnosticParseKinds.td 2 additions, 3 deletionsinclude/clang/Basic/DiagnosticParseKinds.td
- include/clang/Basic/DiagnosticSemaKinds.td 30 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/Parse/Parser.h 2 additions, 0 deletionsinclude/clang/Parse/Parser.h
- include/clang/Sema/DeclSpec.h 28 additions, 0 deletionsinclude/clang/Sema/DeclSpec.h
- include/clang/Sema/Sema.h 27 additions, 1 deletioninclude/clang/Sema/Sema.h
- lib/AST/ASTContext.cpp 66 additions, 26 deletionslib/AST/ASTContext.cpp
- lib/AST/ASTDiagnostic.cpp 10 additions, 0 deletionslib/AST/ASTDiagnostic.cpp
- lib/AST/ASTImporter.cpp 17 additions, 10 deletionslib/AST/ASTImporter.cpp
- lib/AST/DeclObjC.cpp 27 additions, 0 deletionslib/AST/DeclObjC.cpp
- lib/AST/Type.cpp 87 additions, 12 deletionslib/AST/Type.cpp
- lib/AST/TypeLoc.cpp 16 additions, 0 deletionslib/AST/TypeLoc.cpp
- lib/AST/TypePrinter.cpp 34 additions, 37 deletionslib/AST/TypePrinter.cpp
- lib/Parse/ParseDecl.cpp 40 additions, 10 deletionslib/Parse/ParseDecl.cpp
- lib/Parse/ParseObjc.cpp 129 additions, 17 deletionslib/Parse/ParseObjc.cpp
Loading
Please register or sign in to comment