/// FieldDecl - An instance of this class is created by Sema::ActOnField to
/// represent a member of a struct/union/class.
-class FieldDecl : public NamedDecl {
+class FieldDecl : public ValueDecl {
bool Mutable : 1;
- QualType DeclType;
Expr *BitWidth;
protected:
FieldDecl(Kind DK, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable)
- : NamedDecl(DK, DC, L, Id), Mutable(Mutable), DeclType(T),
- BitWidth(BW)
+ : ValueDecl(DK, DC, L, Id, T), Mutable(Mutable), BitWidth(BW)
{ }
public:
IdentifierInfo *Id, QualType T, Expr *BW,
bool Mutable);
- QualType getType() const { return DeclType; }
-
/// isMutable - Determines whether this field is mutable (C++ only).
bool isMutable() const { return Mutable; }
DECL(TranslationUnit, Decl)
ABSTRACT_DECL(Named, Decl)
DECL(OverloadedFunction, NamedDecl)
- DECL(Field, NameDecl)
- DECL(ObjCIvar, FieldDecl)
- DECL(ObjCAtDefsField, FieldDecl)
DECL(Namespace, NamedDecl)
DECL(UsingDirective, NamedDecl)
ABSTRACT_DECL(Type, NamedDecl)
DECL(CXXConstructor, CXXMethodDecl)
DECL(CXXDestructor, CXXMethodDecl)
DECL(CXXConversion, CXXMethodDecl)
+ DECL(Field, ValueDecl)
+ DECL(ObjCIvar, FieldDecl)
+ DECL(ObjCAtDefsField, FieldDecl)
DECL(Var, ValueDecl)
DECL(ImplicitParam, VarDecl)
DECL(CXXClassVar, VarDecl)
void FieldDecl::EmitImpl(Serializer& S) const {
S.EmitBool(Mutable);
S.Emit(getType());
- NamedDecl::EmitInRec(S);
+ ValueDecl::EmitInRec(S);
S.EmitOwnedPtr(BitWidth);
}
FieldDecl* decl = new (C) FieldDecl(Field, 0, SourceLocation(), NULL,
QualType(), 0, false);
decl->Mutable = D.ReadBool();
- decl->DeclType.ReadBackpatch(D);
- decl->ReadInRec(D, C);
+ decl->ValueDecl::ReadInRec(D, C);
decl->BitWidth = D.ReadOwnedPtr<Expr>(C);
return decl;
}