summaryrefslogtreecommitdiffstats
path: root/clang/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
commit06d6d327624362916672eeda0d8c1167394c8cff (patch)
tree9dc1ceb91c81d6ad26cda8080ad4b4b9ec972c60 /clang/tools/CIndex/CXCursor.cpp
parent065f8d11caf73d75fbdedbe3a0fc0cddf56cb8a9 (diff)
downloadbcm5719-llvm-06d6d327624362916672eeda0d8c1167394c8cff.tar.gz
bcm5719-llvm-06d6d327624362916672eeda0d8c1167394c8cff.zip
Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens(). llvm-svn: 98837
Diffstat (limited to 'clang/tools/CIndex/CXCursor.cpp')
-rw-r--r--clang/tools/CIndex/CXCursor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/tools/CIndex/CXCursor.cpp b/clang/tools/CIndex/CXCursor.cpp
index 1e5265ee9af..407f44c70a0 100644
--- a/clang/tools/CIndex/CXCursor.cpp
+++ b/clang/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 } };
OpenPOWER on IntegriCloud