[llvm-branch-commits] [cfe-branch] r119655 - /cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 17 18:37:46 PST 2010
Author: ddunbar
Date: Wed Nov 17 20:37:46 2010
New Revision: 119655
URL: http://llvm.org/viewvc/llvm-project?rev=119655&view=rev
Log:
Merge r119439:
--
Author: Ted Kremenek <kremenek at apple.com>
Date: Wed Nov 17 00:50:41 2010 +0000
CursorVisitor: migrate handling of
CXXTypeidExpr to data-recursion algorithm.
Modified:
cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
Modified: cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp?rev=119655&r1=119654&r2=119655&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp Wed Nov 17 20:37:46 2010
@@ -341,7 +341,6 @@
bool VisitAddrLabelExpr(AddrLabelExpr *E);
bool VisitVAArgExpr(VAArgExpr *E);
bool VisitDesignatedInitExpr(DesignatedInitExpr *E);
- bool VisitCXXTypeidExpr(CXXTypeidExpr *E);
bool VisitCXXUuidofExpr(CXXUuidofExpr *E);
bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
@@ -1525,17 +1524,6 @@
return Visit(MakeCXCursor(E->getInit(), StmtParent, TU));
}
-bool CursorVisitor::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
- if (E->isTypeOperand()) {
- if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo())
- return Visit(TSInfo->getTypeLoc());
-
- return false;
- }
-
- return VisitExpr(E);
-}
-
bool CursorVisitor::VisitCXXUuidofExpr(CXXUuidofExpr *E) {
if (E->isTypeOperand()) {
if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo())
@@ -1707,6 +1695,7 @@
void VisitCXXNewExpr(CXXNewExpr *E);
void VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
void VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
+ void VisitCXXTypeidExpr(CXXTypeidExpr *E);
void VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E);
void VisitDeclRefExpr(DeclRefExpr *D);
void VisitDeclStmt(DeclStmt *S);
@@ -1792,6 +1781,11 @@
EnqueueChildren(E);
AddTypeLoc(E->getTypeSourceInfo());
}
+void EnqueueVisitor::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
+ EnqueueChildren(E);
+ if (E->isTypeOperand())
+ AddTypeLoc(E->getTypeOperandSourceInfo());
+}
void EnqueueVisitor::VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr
*E) {
More information about the llvm-branch-commits
mailing list