diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-18 03:09:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-18 03:09:07 +0000 |
commit | e77f443dbca8cdc23e5aa94a2653367e4a7cbe47 (patch) | |
tree | 6a465ce7a03f7e38ef28831d8e29f55c93e4861d /tools/CIndex/CXCursor.cpp | |
parent | 63e5d7c85299134f088033614afd9eb213c50b48 (diff) |
Start adding cursor kinds for attributes, with first exposing
IBActionAttr and IBOutletAttr respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/CIndex/CXCursor.cpp')
-rw-r--r-- | tools/CIndex/CXCursor.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/CIndex/CXCursor.cpp b/tools/CIndex/CXCursor.cpp index ec1477eb8a..0fa73a513d 100644 --- a/tools/CIndex/CXCursor.cpp +++ b/tools/CIndex/CXCursor.cpp @@ -72,6 +72,23 @@ static CXCursorKind GetCursorKind(Decl *D) { return CXCursor_NotImplemented; } +static CXCursorKind GetCursorKind(const Attr *A) { + assert(A && "Invalid arguments!"); + switch (A->getKind()) { + default: break; + case Attr::IBActionKind: return CXCursor_IBActionAttr; + case Attr::IBOutletKind: return CXCursor_IBOutletAttr; + } + + return CXCursor_UnexposedAttr; +} + +CXCursor cxcursor::MakeCXCursor(const Attr *A, Decl *Parent, ASTUnit *TU) { + assert(A && Parent && TU && "Invalid arguments!"); + CXCursor C = { GetCursorKind(A), { Parent, (void*)A, TU } }; + return C; +} + CXCursor cxcursor::MakeCXCursor(Decl *D, ASTUnit *TU) { assert(D && TU && "Invalid arguments!"); CXCursor C = { GetCursorKind(D), { D, 0, TU } }; |