diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-11-01 23:26:51 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-11-01 23:26:51 +0000 |
| commit | 818e5c1839eead75e3e409ab60a2bb1f0be9a54f (patch) | |
| tree | bdd78d3a139a95ac4fa5f766efc806c99030c347 /clang/tools/libclang/CXCursor.h | |
| parent | 53078294ed3e82452cb5883d2ef3c2453e3ee41d (diff) | |
| download | bcm5719-llvm-818e5c1839eead75e3e409ab60a2bb1f0be9a54f.tar.gz bcm5719-llvm-818e5c1839eead75e3e409ab60a2bb1f0be9a54f.zip | |
Encapsulate within CXCursor the notion of whether a VarDecl* is the first Decl in a DeclGroup. We use this
to recover some context that is currently not modeled directly in the AST. Currently VarDecl's cannot
properly determine their source range because they have no context on whether or not they appear in a DeclGroup.
For the meantime, this bandaid suffices in libclang since that is where the correct SourceRange is directly needed.
Fixes <rdar://problem/8595749>.
llvm-svn: 117973
Diffstat (limited to 'clang/tools/libclang/CXCursor.h')
| -rw-r--r-- | clang/tools/libclang/CXCursor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/tools/libclang/CXCursor.h b/clang/tools/libclang/CXCursor.h index a31a3220767..7e518edef96 100644 --- a/clang/tools/libclang/CXCursor.h +++ b/clang/tools/libclang/CXCursor.h @@ -45,7 +45,8 @@ class TypeDecl; namespace cxcursor { CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent, ASTUnit *TU); -CXCursor MakeCXCursor(clang::Decl *D, ASTUnit *TU); +CXCursor MakeCXCursor(clang::Decl *D, ASTUnit *TU, + bool FirstInDeclGroup = true); CXCursor MakeCXCursor(clang::Stmt *S, clang::Decl *Parent, ASTUnit *TU); CXCursor MakeCXCursorInvalid(CXCursorKind K); @@ -183,6 +184,10 @@ inline bool operator!=(CXCursor X, CXCursor Y) { return !(X == Y); } +/// \brief Return true if the cursor represents a declaration that is the +/// first in a declaration group. +bool isFirstInDeclGroup(CXCursor C); + }} // end namespace: clang::cxcursor #endif |

