[cfe-commits] r43613 - in /cfe/trunk: Sema/SemaDecl.cpp include/clang/AST/Decl.h
Devang Patel
dpatel at apple.com
Thu Nov 1 09:29:57 PDT 2007
Author: dpatel
Date: Thu Nov 1 11:29:56 2007
New Revision: 43613
URL: http://llvm.org/viewvc/llvm-project?rev=43613&view=rev
Log:
Propagate bitfield info.
Modified:
cfe/trunk/Sema/SemaDecl.cpp
cfe/trunk/include/clang/AST/Decl.h
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=43613&r1=43612&r2=43613&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Thu Nov 1 11:29:56 2007
@@ -1628,7 +1628,7 @@
FieldDecl *NewFD;
if (isa<RecordDecl>(static_cast<Decl *>(TagDecl)))
- NewFD = new FieldDecl(Loc, II, T);
+ NewFD = new FieldDecl(Loc, II, T, BitWidth);
else if (isa<ObjcInterfaceDecl>(static_cast<Decl *>(TagDecl))
|| isa<ObjcImplementationDecl>(static_cast<Decl *>(TagDecl)))
NewFD = new ObjcIvarDecl(Loc, II, T);
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=43613&r1=43612&r2=43613&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Thu Nov 1 11:29:56 2007
@@ -417,15 +417,20 @@
/// represent a member of a struct/union/class.
class FieldDecl : public NamedDecl {
QualType DeclType;
+ Expr *BitWidth;
public:
- FieldDecl(SourceLocation L, IdentifierInfo *Id, QualType T)
- : NamedDecl(Field, L, Id), DeclType(T) {}
- FieldDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, QualType T)
- : NamedDecl(DK, L, Id), DeclType(T) {}
+ FieldDecl(SourceLocation L, IdentifierInfo *Id, QualType T,
+ Expr *BW = NULL)
+ : NamedDecl(Field, L, Id), DeclType(T), BitWidth(BW) {}
+ FieldDecl(Kind DK, SourceLocation L, IdentifierInfo *Id, QualType T,
+ Expr *BW = NULL)
+ : NamedDecl(DK, L, Id), DeclType(T), BitWidth(BW) {}
QualType getType() const { return DeclType; }
QualType getCanonicalType() const { return DeclType.getCanonicalType(); }
+ bool isBitField() const { return BitWidth != NULL; }
+ Expr *getBitWidth() const { return BitWidth; }
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= FieldFirst && D->getKind() <= FieldLast;
More information about the cfe-commits
mailing list