diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-11-07 17:29:11 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-11-07 17:29:11 +0000 |
commit | 7b760095cb75ff8e7e08132272ff38909d5473c4 (patch) | |
tree | 3598ad77c18949e5e1b21134c7d0873ed9382fc7 /clang/lib | |
parent | 385a4e04895f8bc959bdf2ef03d7d6de0f74247f (diff) | |
download | bcm5719-llvm-7b760095cb75ff8e7e08132272ff38909d5473c4.tar.gz bcm5719-llvm-7b760095cb75ff8e7e08132272ff38909d5473c4.zip |
[index] index field references in __builtin_offset
rdar://35109556
llvm-svn: 317593
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Index/IndexBody.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Index/IndexBody.cpp b/clang/lib/Index/IndexBody.cpp index 6bbd3810250..a54d2cbb929 100644 --- a/clang/lib/Index/IndexBody.cpp +++ b/clang/lib/Index/IndexBody.cpp @@ -427,6 +427,17 @@ public: return true; } + + bool VisitOffsetOfExpr(OffsetOfExpr *S) { + for (unsigned I = 0, E = S->getNumComponents(); I != E; ++I) { + const OffsetOfNode &Component = S->getComponent(I); + if (Component.getKind() == OffsetOfNode::Field) + IndexCtx.handleReference(Component.getField(), Component.getLocStart(), + Parent, ParentDC, SymbolRoleSet(), {}); + // FIXME: Try to resolve dependent field references. + } + return true; + } }; } // anonymous namespace |