diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-09-01 20:41:53 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-09-01 20:41:53 +0000 |
| commit | be996931274f1965b4da7ab06a94b141841c4c8f (patch) | |
| tree | 457b791bfd2a1f7836cb7edf3d4298c6112a974b /clang/lib/AST/Decl.cpp | |
| parent | 026cb58a441c15822411f0cdf94da501b1e24cd6 (diff) | |
| download | bcm5719-llvm-be996931274f1965b4da7ab06a94b141841c4c8f.tar.gz bcm5719-llvm-be996931274f1965b4da7ab06a94b141841c4c8f.zip | |
Fix the source-range information for an EnumConstantDecl; previously,
it did not include the initializer expression.
llvm-svn: 112739
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 9d9f27e1a07..b7be02d7453 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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) { |

