diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-01-21 20:48:56 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-01-21 20:48:56 +0000 |
| commit | 6479fc4554599d8427e46f5e88ae0d9c134b3d5b (patch) | |
| tree | 7c5684f36f24c85d85e9800e5bac91bd3d3d51a6 /clang/tools | |
| parent | 43f2eecffaf644c56c95c807ce7c1a4488800bf3 (diff) | |
| download | bcm5719-llvm-6479fc4554599d8427e46f5e88ae0d9c134b3d5b.tar.gz bcm5719-llvm-6479fc4554599d8427e46f5e88ae0d9c134b3d5b.zip | |
Teach the cursor visitor to walk into typeof types (both kinds). This
is hard to test now; tests will come when we can walk stataements and
expressions properly.
llvm-svn: 94099
Diffstat (limited to 'clang/tools')
| -rw-r--r-- | clang/tools/CIndex/CIndex.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp index e3772da94eb..070cb18d779 100644 --- a/clang/tools/CIndex/CIndex.cpp +++ b/clang/tools/CIndex/CIndex.cpp @@ -200,6 +200,11 @@ public: bool VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL); bool VisitFunctionTypeLoc(FunctionTypeLoc TL); bool VisitArrayTypeLoc(ArrayTypeLoc TL); + // FIXME: Implement for TemplateSpecializationTypeLoc + // FIXME: Implement visitors here when the unimplemented TypeLocs get + // implemented + bool VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL); + bool VisitTypeOfTypeLoc(TypeOfTypeLoc TL); }; } // end anonymous namespace @@ -532,6 +537,17 @@ bool CursorVisitor::VisitArrayTypeLoc(ArrayTypeLoc TL) { return false; } +bool CursorVisitor::VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL) { + return Visit(MakeCXCursor(TL.getUnderlyingExpr(), StmtParent, TU)); +} + +bool CursorVisitor::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) { + if (TypeSourceInfo *TSInfo = TL.getUnderlyingTInfo()) + return Visit(TSInfo->getTypeLoc()); + + return false; +} + CXString CIndexer::createCXString(const char *String, bool DupString){ CXString Str; if (DupString) { |

