[llvm-branch-commits] [cfe-branch] r119662 - /cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 17 18:38:06 PST 2010
Author: ddunbar
Date: Wed Nov 17 20:38:05 2010
New Revision: 119662
URL: http://llvm.org/viewvc/llvm-project?rev=119662&view=rev
Log:
Merge r119452:
--
Author: Ted Kremenek <kremenek at apple.com>
Date: Wed Nov 17 02:18:35 2010 +0000
CursorVisitor: Migrate handling of
'SizeOfAlignOfExpr' and 'CXXSCalarValueInitExpr'
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=119662&r1=119661&r2=119662&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp Wed Nov 17 20:38:05 2010
@@ -339,9 +339,7 @@
// Expression visitors
bool VisitOffsetOfExpr(OffsetOfExpr *E);
- bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
bool VisitDesignatedInitExpr(DesignatedInitExpr *E);
- bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E);
bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E);
bool VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E);
@@ -1476,17 +1474,6 @@
return false;
}
-bool CursorVisitor::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
- if (E->isArgumentType()) {
- if (TypeSourceInfo *TSInfo = E->getArgumentTypeInfo())
- return Visit(TSInfo->getTypeLoc());
-
- return false;
- }
-
- return VisitExpr(E);
-}
-
bool CursorVisitor::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
// Visit the designators.
typedef DesignatedInitExpr::Designator Designator;
@@ -1518,13 +1505,6 @@
return Visit(MakeCXCursor(E->getInit(), StmtParent, TU));
}
-bool CursorVisitor::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
- if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo())
- return Visit(TSInfo->getTypeLoc());
-
- return false;
-}
-
bool CursorVisitor::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
// Visit base expression.
if (Visit(MakeCXCursor(E->getBase(), StmtParent, TU)))
@@ -1688,6 +1668,7 @@
void VisitCompoundStmt(CompoundStmt *S);
void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { /* Do nothing. */ }
void VisitCXXNewExpr(CXXNewExpr *E);
+ void VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
void VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
void VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
void VisitCXXTypeidExpr(CXXTypeidExpr *E);
@@ -1704,6 +1685,7 @@
void VisitObjCEncodeExpr(ObjCEncodeExpr *E);
void VisitObjCMessageExpr(ObjCMessageExpr *M);
void VisitOverloadExpr(OverloadExpr *E);
+ void VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
void VisitStmt(Stmt *S);
void VisitSwitchStmt(SwitchStmt *S);
void VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
@@ -1786,6 +1768,9 @@
AddStmt(CE->getCallee());
AddStmt(CE->getArg(0));
}
+void EnqueueVisitor::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
+ AddTypeLoc(E->getTypeSourceInfo());
+}
void EnqueueVisitor::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
EnqueueChildren(E);
AddTypeLoc(E->getTypeSourceInfo());
@@ -1868,6 +1853,11 @@
AddExplicitTemplateArgs(E->getOptionalExplicitTemplateArgs());
WL.push_back(OverloadExprParts(E, Parent));
}
+void EnqueueVisitor::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
+ EnqueueChildren(E);
+ if (E->isArgumentType())
+ AddTypeLoc(E->getArgumentTypeInfo());
+}
void EnqueueVisitor::VisitStmt(Stmt *S) {
EnqueueChildren(S);
}
@@ -1970,9 +1960,7 @@
// Cases not yet handled by the data-recursion
// algorithm.
case Stmt::OffsetOfExprClass:
- case Stmt::SizeOfAlignOfExprClass:
case Stmt::DesignatedInitExprClass:
- case Stmt::CXXScalarValueInitExprClass:
case Stmt::CXXPseudoDestructorExprClass:
case Stmt::DependentScopeDeclRefExprClass:
case Stmt::CXXDependentScopeMemberExprClass:
More information about the llvm-branch-commits
mailing list