diff options
Diffstat (limited to 'tools/CIndex/CIndex.cpp')
-rw-r--r-- | tools/CIndex/CIndex.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index ce2188550b..47d156c6ce 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -1765,6 +1765,11 @@ CXCursor clang_getCursorReferenced(CXCursor C) { return clang_getNullCursor(); } + if (C.kind == CXCursor_MacroInstantiation) { + if (MacroDefinition *Def = getCursorMacroInstantiation(C)->getDefinition()) + return MakeMacroDefinitionCursor(Def, CXXUnit); + } + if (!clang_isReference(C.kind)) return clang_getNullCursor(); @@ -1803,6 +1808,9 @@ CXCursor clang_getCursorDefinition(CXCursor C) { WasReference = true; } + if (C.kind == CXCursor_MacroInstantiation) + return clang_getCursorReferenced(C); + if (!clang_isDeclaration(C.kind)) return clang_getNullCursor(); |