From 8a4010d40c7ba61a92c728814639674726888e8f Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 11 Sep 2007 18:45:55 +0000 Subject: [PATCH] Change ObjcMethodDecl class derivation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41860 91177308-0d34-0410-b5e6-96231b3b80d8 --- clang.xcodeproj/project.pbxproj | 1 + include/clang/AST/Decl.h | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index f0f4c3f0b9..0ca23958c7 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -671,6 +671,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = ""; diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 838bad4b5f..644c0f7e43 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -560,32 +560,33 @@ public: /// ObjcMethodDecl - An instance of this class is created to represent an instance /// or class method declaration. -class ObjcMethodDecl : public ValueDecl { +class ObjcMethodDecl : public Decl { public: ObjcMethodDecl(SourceLocation L, IdentifierInfo *Id, QualType T, - bool isInstance = true, Decl *PrevDecl = 0) - : ValueDecl(ObjcMethod, L, Id, T, PrevDecl), ParamInfo(0), - MethodAttrs(0), IsInstance(isInstance) {} + AttributeList *M = 0, bool isInstance = true, + Decl *PrevDecl = 0) + : Decl(ObjcMethod, L, Id, PrevDecl), MethodDeclType(T), ParamInfo(0), + MethodAttrs(M), IsInstance(isInstance) {} virtual ~ObjcMethodDecl(); - unsigned getNumParams() const; - ParmVarDecl *getParamDecl(unsigned i) { - assert(i < getNumParams() && "Illegal param #"); + QualType getMethodType() const { return MethodDeclType; } + unsigned getNumMethodParams() const; + ParmVarDecl *getMethodParamDecl(unsigned i) { + assert(i < getNumMethodParams() && "Illegal param #"); return ParamInfo[i]; } void setParams(ParmVarDecl **NewParamInfo, unsigned NumParams); + AttributeList *getMethodAttrs() const {return MethodAttrs;} bool isInstance() const { return IsInstance; } - QualType getResultType() const { return getType(); } - void setMethodAttrs(AttributeList *attrs) {MethodAttrs = attrs;} - AttributeList *getMethodAttrs() const {return MethodAttrs;} - // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return D->getKind() == ObjcMethod; } static bool classof(const ObjcMethodDecl *D) { return true; } private: + // Type of this method. + QualType MethodDeclType; /// ParamInfo - new[]'d array of pointers to VarDecls for the formal /// parameters of this Method. This is null if there are no formals. ParmVarDecl **ParamInfo; @@ -593,6 +594,7 @@ private: /// List of attributes for this method declaration. AttributeList *MethodAttrs; + /// instance (true) or class (false) method. bool IsInstance : 1; }; -- 2.40.0