зеркало из https://github.com/microsoft/clang-1.git
[libclang] Properly handle @encode() in RecursiveASTVisitor and traverse
its type source info. Fixes indexing references inside @encode(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
4b0e6f1da3
Коммит
87014f33f1
|
@ -1241,8 +1241,7 @@ bool RecursiveASTVisitor<Derived>::Traverse##DECL (DECL *D) { \
|
|||
DEF_TRAVERSE_DECL(AccessSpecDecl, { })
|
||||
|
||||
DEF_TRAVERSE_DECL(BlockDecl, {
|
||||
TypeSourceInfo *TInfo = D->getSignatureAsWritten();
|
||||
if (TInfo)
|
||||
if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
|
||||
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
|
||||
TRY_TO(TraverseStmt(D->getBody()));
|
||||
// This return statement makes sure the traversal of nodes in
|
||||
|
@ -2130,7 +2129,10 @@ DEF_TRAVERSE_STMT(ExtVectorElementExpr, { })
|
|||
DEF_TRAVERSE_STMT(GNUNullExpr, { })
|
||||
DEF_TRAVERSE_STMT(ImplicitValueInitExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCBoolLiteralExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCEncodeExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCEncodeExpr, {
|
||||
if (TypeSourceInfo *TInfo = S->getEncodedTypeSourceInfo())
|
||||
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
|
||||
})
|
||||
DEF_TRAVERSE_STMT(ObjCIsaExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCIvarRefExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCMessageExpr, { })
|
||||
|
|
|
@ -1188,7 +1188,8 @@ bool RecursiveASTVisitor<Derived>::Traverse##DECL (DECL *D) { \
|
|||
DEF_TRAVERSE_DECL(AccessSpecDecl, { })
|
||||
|
||||
DEF_TRAVERSE_DECL(BlockDecl, {
|
||||
TRY_TO(TraverseTypeLoc(D->getSignatureAsWritten()->getTypeLoc()));
|
||||
if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
|
||||
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
|
||||
TRY_TO(TraverseStmt(D->getBody()));
|
||||
// This return statement makes sure the traversal of nodes in
|
||||
// decls_begin()/decls_end() (done in the DEF_TRAVERSE_DECL macro)
|
||||
|
@ -2079,7 +2080,10 @@ DEF_TRAVERSE_STMT(ExtVectorElementExpr, { })
|
|||
DEF_TRAVERSE_STMT(GNUNullExpr, { })
|
||||
DEF_TRAVERSE_STMT(ImplicitValueInitExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCBoolLiteralExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCEncodeExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCEncodeExpr, {
|
||||
if (TypeSourceInfo *TInfo = S->getEncodedTypeSourceInfo())
|
||||
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
|
||||
})
|
||||
DEF_TRAVERSE_STMT(ObjCIsaExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCIvarRefExpr, { })
|
||||
DEF_TRAVERSE_STMT(ObjCMessageExpr, { })
|
||||
|
|
Загрузка…
Ссылка в новой задаче