aboutsummaryrefslogtreecommitdiff
path: root/tools/CIndex/CXCursor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-18 18:04:21 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-18 18:04:21 +0000
commit572feb2a190b5e8b04fb06c4ac50ee0f61e93ff0 (patch)
tree1b1c104cdc5ce31037499d296680533eee629e01 /tools/CIndex/CXCursor.cpp
parent4ae8f298b1ea51b4c2234f9148e2e4349c9bdd23 (diff)
Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/CIndex/CXCursor.cpp')
-rw-r--r--tools/CIndex/CXCursor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/CIndex/CXCursor.cpp b/tools/CIndex/CXCursor.cpp
index 1e5265ee9a..407f44c70a 100644
--- a/tools/CIndex/CXCursor.cpp
+++ b/tools/CIndex/CXCursor.cpp
@@ -314,6 +314,16 @@ SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) {
reinterpret_cast<uintptr_t> (C.data[1])));
}
+CXCursor cxcursor::MakeMacroDefinitionCursor(MacroDefinition *MI, ASTUnit *TU) {
+ CXCursor C = { CXCursor_MacroDefinition, { MI, 0, TU } };
+ return C;
+}
+
+MacroDefinition *cxcursor::getCursorMacroDefinition(CXCursor C) {
+ assert(C.kind == CXCursor_MacroDefinition);
+ return static_cast<MacroDefinition *>(C.data[0]);
+}
+
CXCursor cxcursor::MakeMacroInstantiationCursor(MacroInstantiation *MI,
ASTUnit *TU) {
CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } };