};
private:
+ /// Loc - The location that this decl.
+ SourceLocation Loc;
+
/// DeclKind - This indicates which class this is.
Kind DeclKind : 8;
unsigned int InvalidDecl : 1;
protected:
- Decl(Kind DK) : DeclKind(DK), InvalidDecl(0) {
+ Decl(Kind DK, SourceLocation L) : Loc(L), DeclKind(DK), InvalidDecl(0) {
if (Decl::CollectingStats()) addDeclKind(DK);
}
virtual ~Decl();
public:
-
+ SourceLocation getLocation() const { return Loc; }
+ void setLocation(SourceLocation L) { Loc = L; }
+
Kind getKind() const { return DeclKind; }
const char *getDeclKindName() const;
/// variable, the tag for a struct).
IdentifierInfo *Identifier;
- /// Loc - The location that this decl.
- SourceLocation Loc;
-
/// NextDeclarator - If this decl was part of a multi-declarator declaration,
/// such as "int X, Y, *Z;" this indicates Decl for the next declarator.
ScopedDecl *NextDeclarator;
ScopedDecl *Next;
protected:
ScopedDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl)
- : Decl(DK), Identifier(Id), Loc(L), NextDeclarator(PrevDecl), Next(0) {}
+ : Decl(DK, L), Identifier(Id), NextDeclarator(PrevDecl), Next(0) {}
public:
IdentifierInfo *getIdentifier() const { return Identifier; }
- SourceLocation getLocation() const { return Loc; }
- void setLocation(SourceLocation L) { Loc = L; }
const char *getName() const;
ScopedDecl *getNext() const { return Next; }
/// Identifier - The identifier for this declaration (e.g. the name for the
/// variable, the tag for a struct).
IdentifierInfo *Identifier;
-
- /// Loc - The location that this decl.
- SourceLocation Loc;
QualType DeclType;
public:
FieldDecl(SourceLocation L, IdentifierInfo *Id, QualType T)
- : Decl(Field), Identifier(Id), Loc(L), DeclType(T) {}
+ : Decl(Field, L), Identifier(Id), DeclType(T) {}
FieldDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, QualType T)
- : Decl(DK), Identifier(Id), Loc(L), DeclType(T) {}
+ : Decl(DK, L), Identifier(Id), DeclType(T) {}
IdentifierInfo *getIdentifier() const { return Identifier; }
- SourceLocation getLocation() const { return Loc; }
- void setLocation(SourceLocation L) { Loc = L; }
const char *getName() const;
QualType getType() const { return DeclType; }
/// List of attributes for this method declaration.
AttributeList *MethodAttrs;
- /// Loc - location of this declaration.
- SourceLocation Loc;
-
public:
ObjcMethodDecl(SourceLocation L, Selector SelInfo, QualType T,
ParmVarDecl **paramInfo = 0, int numParams=-1,
AttributeList *M = 0, bool isInstance = true,
ImplementationControl impControl = None,
Decl *PrevDecl = 0)
- : Decl(ObjcMethod),
+ : Decl(ObjcMethod, L),
IsInstance(isInstance), DeclImplementation(impControl),
SelName(SelInfo), MethodDeclType(T),
ParamInfo(paramInfo), NumMethodParams(numParams),
- MethodAttrs(M), Loc(L) {}
+ MethodAttrs(M) {}
virtual ~ObjcMethodDecl();
Selector getSelector() const { return SelName; }
QualType getMethodType() const { return MethodDeclType; }
void setMethodParams(ParmVarDecl **NewParamInfo, unsigned NumParams);
AttributeList *getMethodAttrs() const {return MethodAttrs;}
- SourceLocation getLocation() const { return Loc; }
bool isInstance() const { return IsInstance; }
// Related to protocols declared in @protocol
void setDeclImplementation(ImplementationControl ic)
/// Next category belonging to this class
ObjcCategoryDecl *NextClassCategory;
- /// Location of cetagory declaration
- SourceLocation CatLoc;
-
public:
ObjcCategoryDecl(SourceLocation L, unsigned numRefProtocol)
- : Decl(ObjcCategory),
+ : Decl(ObjcCategory, L),
ClassInterface(0), ObjcCatName(0),
ReferencedProtocols(0), NumReferencedProtocols(-1),
InstanceMethods(0), NumInstanceMethods(-1),
ClassMethods(0), NumClassMethods(-1),
- NextClassCategory(0), CatLoc(L) {
+ NextClassCategory(0) {
if (numRefProtocol) {
ReferencedProtocols = new ObjcProtocolDecl*[numRefProtocol];
memset(ReferencedProtocols, '\0',
ClassInterface->setListCategories(this);
}
- SourceLocation getLocation() const { return CatLoc; }
-
static bool classof(const Decl *D) {
return D->getKind() == ObjcCategory;
}
ObjcMethodDecl **ClassMethods; // Null if category is not implementing any
int NumClassMethods; // -1 if category is not implementing any
- SourceLocation Loc;
-
public:
ObjcCategoryImplDecl(SourceLocation L, IdentifierInfo *Id,
ObjcInterfaceDecl *classInterface,
IdentifierInfo *catName)
- : Decl(ObjcCategoryImpl),
+ : Decl(ObjcCategoryImpl, L),
ClassInterface(classInterface),
ObjcCatName(catName),
InstanceMethods(0), NumInstanceMethods(-1),
- ClassMethods(0), NumClassMethods(-1), Loc(L) {}
+ ClassMethods(0), NumClassMethods(-1) {}
ObjcInterfaceDecl *getClassInterface() const {
return ClassInterface;
ObjcMethodDecl **insMethods, unsigned numInsMembers,
ObjcMethodDecl **clsMethods, unsigned numClsMembers);
- SourceLocation getLocation() const { return Loc; }
-
static bool classof(const Decl *D) {
return D->getKind() == ObjcCategoryImpl;
}