|
@@ -2320,11 +2320,9 @@ class ObjCImplDecl : public ObjCContainerDecl {
|
|
protected:
|
|
protected:
|
|
ObjCImplDecl(Kind DK, DeclContext *DC,
|
|
ObjCImplDecl(Kind DK, DeclContext *DC,
|
|
ObjCInterfaceDecl *classInterface,
|
|
ObjCInterfaceDecl *classInterface,
|
|
|
|
+ IdentifierInfo *Id,
|
|
SourceLocation nameLoc, SourceLocation atStartLoc)
|
|
SourceLocation nameLoc, SourceLocation atStartLoc)
|
|
- : ObjCContainerDecl(DK, DC,
|
|
|
|
- classInterface? classInterface->getIdentifier()
|
|
|
|
- : nullptr,
|
|
|
|
- nameLoc, atStartLoc),
|
|
|
|
|
|
+ : ObjCContainerDecl(DK, DC, Id, nameLoc, atStartLoc),
|
|
ClassInterface(classInterface) {}
|
|
ClassInterface(classInterface) {}
|
|
|
|
|
|
public:
|
|
public:
|
|
@@ -2386,9 +2384,6 @@ public:
|
|
class ObjCCategoryImplDecl : public ObjCImplDecl {
|
|
class ObjCCategoryImplDecl : public ObjCImplDecl {
|
|
void anchor() override;
|
|
void anchor() override;
|
|
|
|
|
|
- // Category name
|
|
|
|
- IdentifierInfo *Id;
|
|
|
|
-
|
|
|
|
// Category name location
|
|
// Category name location
|
|
SourceLocation CategoryNameLoc;
|
|
SourceLocation CategoryNameLoc;
|
|
|
|
|
|
@@ -2396,8 +2391,9 @@ class ObjCCategoryImplDecl : public ObjCImplDecl {
|
|
ObjCInterfaceDecl *classInterface,
|
|
ObjCInterfaceDecl *classInterface,
|
|
SourceLocation nameLoc, SourceLocation atStartLoc,
|
|
SourceLocation nameLoc, SourceLocation atStartLoc,
|
|
SourceLocation CategoryNameLoc)
|
|
SourceLocation CategoryNameLoc)
|
|
- : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, nameLoc, atStartLoc),
|
|
|
|
- Id(Id), CategoryNameLoc(CategoryNameLoc) {}
|
|
|
|
|
|
+ : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id,
|
|
|
|
+ nameLoc, atStartLoc),
|
|
|
|
+ CategoryNameLoc(CategoryNameLoc) {}
|
|
public:
|
|
public:
|
|
static ObjCCategoryImplDecl *Create(ASTContext &C, DeclContext *DC,
|
|
static ObjCCategoryImplDecl *Create(ASTContext &C, DeclContext *DC,
|
|
IdentifierInfo *Id,
|
|
IdentifierInfo *Id,
|
|
@@ -2407,37 +2403,10 @@ public:
|
|
SourceLocation CategoryNameLoc);
|
|
SourceLocation CategoryNameLoc);
|
|
static ObjCCategoryImplDecl *CreateDeserialized(ASTContext &C, unsigned ID);
|
|
static ObjCCategoryImplDecl *CreateDeserialized(ASTContext &C, unsigned ID);
|
|
|
|
|
|
- /// getIdentifier - Get the identifier that names the category
|
|
|
|
- /// interface associated with this implementation.
|
|
|
|
- /// FIXME: This is a bad API, we are hiding NamedDecl::getIdentifier()
|
|
|
|
- /// with a different meaning. For example:
|
|
|
|
- /// ((NamedDecl *)SomeCategoryImplDecl)->getIdentifier()
|
|
|
|
- /// returns the class interface name, whereas
|
|
|
|
- /// ((ObjCCategoryImplDecl *)SomeCategoryImplDecl)->getIdentifier()
|
|
|
|
- /// returns the category name.
|
|
|
|
- IdentifierInfo *getIdentifier() const {
|
|
|
|
- return Id;
|
|
|
|
- }
|
|
|
|
- void setIdentifier(IdentifierInfo *II) { Id = II; }
|
|
|
|
-
|
|
|
|
ObjCCategoryDecl *getCategoryDecl() const;
|
|
ObjCCategoryDecl *getCategoryDecl() const;
|
|
|
|
|
|
SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
|
|
SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
|
|
|
|
|
|
- /// getName - Get the name of identifier for the class interface associated
|
|
|
|
- /// with this implementation as a StringRef.
|
|
|
|
- //
|
|
|
|
- // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
|
|
|
|
- // meaning.
|
|
|
|
- StringRef getName() const { return Id ? Id->getName() : StringRef(); }
|
|
|
|
-
|
|
|
|
- /// @brief Get the name of the class associated with this interface.
|
|
|
|
- //
|
|
|
|
- // FIXME: Deprecated, move clients to getName().
|
|
|
|
- std::string getNameAsString() const {
|
|
|
|
- return getName();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
|
|
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
|
|
static bool classofKind(Kind K) { return K == ObjCCategoryImpl;}
|
|
static bool classofKind(Kind K) { return K == ObjCCategoryImpl;}
|
|
|
|
|
|
@@ -2493,7 +2462,10 @@ class ObjCImplementationDecl : public ObjCImplDecl {
|
|
SourceLocation superLoc = SourceLocation(),
|
|
SourceLocation superLoc = SourceLocation(),
|
|
SourceLocation IvarLBraceLoc=SourceLocation(),
|
|
SourceLocation IvarLBraceLoc=SourceLocation(),
|
|
SourceLocation IvarRBraceLoc=SourceLocation())
|
|
SourceLocation IvarRBraceLoc=SourceLocation())
|
|
- : ObjCImplDecl(ObjCImplementation, DC, classInterface, nameLoc, atStartLoc),
|
|
|
|
|
|
+ : ObjCImplDecl(ObjCImplementation, DC, classInterface,
|
|
|
|
+ classInterface ? classInterface->getIdentifier()
|
|
|
|
+ : nullptr,
|
|
|
|
+ nameLoc, atStartLoc),
|
|
SuperClass(superDecl), SuperLoc(superLoc), IvarLBraceLoc(IvarLBraceLoc),
|
|
SuperClass(superDecl), SuperLoc(superLoc), IvarLBraceLoc(IvarLBraceLoc),
|
|
IvarRBraceLoc(IvarRBraceLoc),
|
|
IvarRBraceLoc(IvarRBraceLoc),
|
|
IvarInitializers(nullptr), NumIvarInitializers(0),
|
|
IvarInitializers(nullptr), NumIvarInitializers(0),
|