From: Abramo Bagnara Date: Tue, 8 Mar 2011 11:07:11 +0000 (+0000) Subject: Fixed bitfields source range. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2cf562cec11dec926c0a29a71769a27fed02962;p=clang Fixed bitfields source range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127237 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 2d5c1bf09f..bbfd123e4b 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1834,7 +1834,9 @@ public: RecordDecl *getParent() { return cast(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; } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 95f5756402..15f906b16e 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1968,6 +1968,11 @@ unsigned FieldDecl::getFieldIndex() const { return index; } +SourceRange FieldDecl::getSourceRange() const { + return SourceRange(getInnerLocStart(), + isBitField() ? BitWidth->getLocEnd() : getLocation()); +} + //===----------------------------------------------------------------------===// // TagDecl Implementation //===----------------------------------------------------------------------===//