summaryrefslogtreecommitdiffstats
path: root/clang/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang')
-rw-r--r--clang/include/clang/Parse/Action.h29
-rw-r--r--clang/include/clang/Parse/DeclSpec.h17
-rw-r--r--clang/include/clang/Parse/Parser.h14
3 files changed, 54 insertions, 6 deletions
diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h
index ec9a4d0dd26..20845ad9d63 100644
--- a/clang/include/clang/Parse/Action.h
+++ b/clang/include/clang/Parse/Action.h
@@ -21,6 +21,7 @@ namespace clang {
// Semantic.
class DeclSpec;
class Declarator;
+ class ObjcKeywordInfo;
class AttributeList;
// Parse.
class Scope;
@@ -430,7 +431,35 @@ public:
tok::TokenKind Kind) {
return 0;
}
+ //===----------------------- Obj-C Declarations -------------------------===//
+ virtual DeclTy *ObjcStartClassInterface(SourceLocation AtInterafceLoc,
+ IdentifierInfo *ClassName, SourceLocation ClassLoc,
+ IdentifierInfo *SuperName, SourceLocation SuperLoc,
+ IdentifierInfo **ProtocolNames, unsigned NumProtocols,
+ AttributeList *AttrList) {
+ return 0;
+ }
+ virtual void ObjCContinueClassInterface(SourceLocation InterfaceLoc) {
+ return;
+ }
+ virtual void ObjCStartCategoryInterface() {
+ return;
+ }
+ virtual void ObjCFinishInterface() {
+ return;
+ }
+ virtual DeclTy *ObjcBuildMethodDeclaration(
+ SourceLocation MethodLoc, tok::TokenKind MethodType, TypeTy *ReturnType,
+ ObjcKeywordInfo *Keywords, unsigned NumKeywords, AttributeList *attrs) {
+ return 0;
+ }
+ virtual DeclTy *ObjcBuildMethodDeclaration(
+ SourceLocation MethodLoc, tok::TokenKind MethodType, TypeTy *ReturnType,
+ IdentifierInfo *SelectorName, AttributeList *attrs) {
+ return 0;
+ }
+
//===----------------------- Obj-C Expressions --------------------------===//
virtual ExprResult ParseObjCStringLiteral(ExprTy *string) {
return 0;
diff --git a/clang/include/clang/Parse/DeclSpec.h b/clang/include/clang/Parse/DeclSpec.h
index 6a15290072e..de22360120e 100644
--- a/clang/include/clang/Parse/DeclSpec.h
+++ b/clang/include/clang/Parse/DeclSpec.h
@@ -562,7 +562,24 @@ public:
bool getInvalidType() { return InvalidType; }
};
+struct ObjcKeywordInfo {
+ IdentifierInfo *SelectorName; // optional
+ SourceLocation SelectorLoc;
+ SourceLocation ColonLoc;
+ Action::TypeTy *TypeInfo; // optional
+ bool InvalidType;
+ IdentifierInfo *ArgumentName;
+ AttributeList *AttrList;
+ ObjcKeywordInfo() {}
+ ObjcKeywordInfo(IdentifierInfo *selName, SourceLocation sLoc,
+ SourceLocation cLoc, Action::TypeTy *tInfo,
+ IdentifierInfo *argName, AttributeList *aList)
+ : SelectorName(selName), SelectorLoc(sLoc), ColonLoc(cLoc), TypeInfo(tInfo),
+ ArgumentName(argName), AttrList(aList) {
+ }
+};
+
} // end namespace clang
#endif
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index f05a2ec5b56..c49d242ab53 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -258,9 +258,11 @@ private:
DeclTy *ParseObjCAtClassDeclaration(SourceLocation atLoc);
DeclTy *ParseObjCAtInterfaceDeclaration(SourceLocation atLoc,
AttributeList *prefixAttrs = 0);
- void ParseObjCClassInstanceVariables(DeclTy *interfaceDecl);
- bool ParseObjCProtocolReferences();
- void ParseObjCInterfaceDeclList(DeclTy *interfaceDecl);
+ void ParseObjCClassInstanceVariables(DeclTy *interfaceDecl,
+ llvm::SmallVectorImpl<DeclTy*> &IvarDecls);
+ bool ParseObjCProtocolReferences(llvm::SmallVectorImpl<IdentifierInfo*> &);
+ void ParseObjCInterfaceDeclList(DeclTy *interfaceDecl,
+ llvm::SmallVectorImpl<DeclTy*> &MethodDecls);
DeclTy *ParseObjCAtProtocolDeclaration(SourceLocation atLoc);
DeclTy *ParseObjCAtImplementationDeclaration(SourceLocation atLoc);
DeclTy *ParseObjCAtEndDeclaration(SourceLocation atLoc);
@@ -284,10 +286,10 @@ private:
IdentifierInfo *ObjcPropertyAttrs[objc_NumAttrs];
bool isObjCPropertyAttribute();
- void ParseObjCTypeName();
+ TypeTy *ParseObjCTypeName();
void ParseObjCMethodRequirement();
- void ParseObjCMethodPrototype(bool decl);
- void ParseObjCMethodDecl(tok::TokenKind mType, SourceLocation mLoc);
+ DeclTy *ParseObjCMethodPrototype(bool decl);
+ DeclTy *ParseObjCMethodDecl(tok::TokenKind mType, SourceLocation mLoc);
void ParseObjCPropertyAttribute(DeclTy *interfaceDecl);
void ParseObjCPropertyDecl(DeclTy *interfaceDecl);
OpenPOWER on IntegriCloud