diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-09-09 16:14:44 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-09-09 16:14:44 +0000 |
| commit | 54e5b13a2717293ddd7743ae3183e29d6ec3c9d4 (patch) | |
| tree | e9e29bdd4a2888a158ba520f8bea02470e45335f /clang/tools/libclang | |
| parent | db0ddaa50bb3e7eba4b247c50b1e705f75e4c7c3 (diff) | |
| download | bcm5719-llvm-54e5b13a2717293ddd7743ae3183e29d6ec3c9d4.tar.gz bcm5719-llvm-54e5b13a2717293ddd7743ae3183e29d6ec3c9d4.zip | |
Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.
llvm-svn: 113492
Diffstat (limited to 'clang/tools/libclang')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index a561b4a7f3c..83ae84ef520 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -366,7 +366,6 @@ public: bool VisitCaseStmt(CaseStmt *S); bool VisitWhileStmt(WhileStmt *S); bool VisitForStmt(ForStmt *S); -// bool VisitSwitchCase(SwitchCase *S); // Expression visitors bool VisitDeclRefExpr(DeclRefExpr *E); @@ -385,12 +384,13 @@ public: // FIXME: InitListExpr (for the designators) // FIXME: DesignatedInitExpr bool VisitCXXTypeidExpr(CXXTypeidExpr *E); + bool VisitCXXUuidofExpr(CXXUuidofExpr *E); bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } bool VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E); bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E); bool VisitCXXNewExpr(CXXNewExpr *E); bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E); - // FIXME: UnaryTypeTraitExpr has poor source-location information. + bool VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E); bool VisitOverloadExpr(OverloadExpr *E); bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E); bool VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E); @@ -1590,6 +1590,17 @@ bool CursorVisitor::VisitCXXTypeidExpr(CXXTypeidExpr *E) { return VisitExpr(E); } +bool CursorVisitor::VisitCXXUuidofExpr(CXXUuidofExpr *E) { + if (E->isTypeOperand()) { + if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo()) + return Visit(TSInfo->getTypeLoc()); + + return false; + } + + return VisitExpr(E); +} + bool CursorVisitor::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) return Visit(TSInfo->getTypeLoc()); @@ -1651,6 +1662,10 @@ bool CursorVisitor::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) { return false; } +bool CursorVisitor::VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) { + return Visit(E->getQueriedTypeSourceInfo()->getTypeLoc()); +} + bool CursorVisitor::VisitOverloadExpr(OverloadExpr *E) { // Visit the nested-name-specifier. if (NestedNameSpecifier *Qualifier = E->getQualifier()) |

