summaryrefslogtreecommitdiffstats
path: root/clang/tools
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-10 15:02:34 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-10 15:02:34 +0000
commite68aaca76612972237296a78dda60101343022a8 (patch)
treefb5f93bed7d76441ecaf169f6da9694b184513c9 /clang/tools
parent84fc4586f7744e0d65209d3a3c15ff7de5520923 (diff)
downloadbcm5719-llvm-e68aaca76612972237296a78dda60101343022a8.tar.gz
bcm5719-llvm-e68aaca76612972237296a78dda60101343022a8.zip
Teach the libclang cursor visitor to walk into the type information
provided by __builtin_types_compatible_p and __builtin_va_arg expressions, now that Abramo has added proper type-source information to those expressions. llvm-svn: 110681
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/libclang/CIndex.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index e8d2cad8497..34de78ca1cc 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -344,6 +344,8 @@ public:
// bool VisitSwitchCase(SwitchCase *S);
// Expression visitors
+ // FIXME: DeclRefExpr with template arguments, nested-name-specifier
+ // FIXME: MemberExpr with template arguments, nested-name-specifier
bool VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
bool VisitBlockExpr(BlockExpr *B);
bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
@@ -352,6 +354,11 @@ public:
bool VisitObjCEncodeExpr(ObjCEncodeExpr *E);
bool VisitOffsetOfExpr(OffsetOfExpr *E);
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
+ // FIXME: AddrLabelExpr (once we have cursors for labels)
+ bool VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
+ bool VisitVAArgExpr(VAArgExpr *E);
+ // FIXME: InitListExpr (for the designators)
+ // FIXME: DesignatedInitExpr
};
} // end anonymous namespace
@@ -1110,6 +1117,18 @@ bool CursorVisitor::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
return VisitExpr(E);
}
+bool CursorVisitor::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) {
+ return Visit(E->getArgTInfo1()->getTypeLoc()) ||
+ Visit(E->getArgTInfo2()->getTypeLoc());
+}
+
+bool CursorVisitor::VisitVAArgExpr(VAArgExpr *E) {
+ if (Visit(E->getWrittenTypeInfo()->getTypeLoc()))
+ return true;
+
+ return Visit(MakeCXCursor(E->getSubExpr(), StmtParent, TU));
+}
+
bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) {
if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo())
if (Visit(TSInfo->getTypeLoc()))
OpenPOWER on IntegriCloud