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
This commit is contained in:
Douglas Gregor 2010-01-21 20:48:56 +00:00
parent 43f2eecffa
commit 6479fc4554
1 changed files with 16 additions and 0 deletions

View File

@ -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) {