Fixed bitfields source range.

llvm-svn: 127237
This commit is contained in:
Abramo Bagnara 2011-03-08 11:07:11 +00:00
parent 05334dad60
commit 20c9e24241
2 changed files with 8 additions and 1 deletions

View File

@ -1834,7 +1834,9 @@ public:
RecordDecl *getParent() {
return cast<RecordDecl>(getDeclContext());
}
SourceRange getSourceRange() const;
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classof(const FieldDecl *D) { return true; }

View File

@ -1968,6 +1968,11 @@ unsigned FieldDecl::getFieldIndex() const {
return index;
}
SourceRange FieldDecl::getSourceRange() const {
return SourceRange(getInnerLocStart(),
isBitField() ? BitWidth->getLocEnd() : getLocation());
}
//===----------------------------------------------------------------------===//
// TagDecl Implementation
//===----------------------------------------------------------------------===//