summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/CIndex/CIndex.cpp')
-rw-r--r--clang/tools/CIndex/CIndex.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index ce2188550bd..47d156c6ceb 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud