aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-01 20:41:53 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-01 20:41:53 +0000
commit8e7139c9554230df64325f70fe202c83491ba7f5 (patch)
tree78b98e819fd0d324ae21005fe15d241f7b0c2c0d /lib/AST/Decl.cpp
parentf69cf18aa240b038dfd89f249e63f4cc6e1c5f65 (diff)
Fix the source-range information for an EnumConstantDecl; previously,
it did not include the initializer expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 9d9f27e1a0..b7be02d745 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1766,6 +1766,13 @@ EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD,
return new (C) EnumConstantDecl(CD, L, Id, T, E, V);
}
+SourceRange EnumConstantDecl::getSourceRange() const {
+ SourceLocation End = getLocation();
+ if (Init)
+ End = Init->getLocEnd();
+ return SourceRange(getLocation(), End);
+}
+
TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
TypeSourceInfo *TInfo) {