diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-11-07 18:25:36 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-11-07 18:25:36 +0000 |
commit | df12300eec0539d9ef599c43a089b15ee29a70b0 (patch) | |
tree | fbd285ca15d3147cc7ac4bb79f68b01dd1ba8cd0 | |
parent | 74ca15e3f76c91138998c908e1ab2044acd11fd3 (diff) | |
download | clang-df12300eec0539d9ef599c43a089b15ee29a70b0.tar.gz |
[index] __builtin_offset's field reference is located at the end location
The starting location is the location of the '.'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317596 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Index/IndexBody.cpp | 2 | ||||
-rw-r--r-- | test/Index/Core/index-source.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Index/IndexBody.cpp b/lib/Index/IndexBody.cpp index a54d2cbb92..ac34956b24 100644 --- a/lib/Index/IndexBody.cpp +++ b/lib/Index/IndexBody.cpp @@ -432,7 +432,7 @@ public: 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(), + IndexCtx.handleReference(Component.getField(), Component.getLocEnd(), Parent, ParentDC, SymbolRoleSet(), {}); // FIXME: Try to resolve dependent field references. } diff --git a/test/Index/Core/index-source.cpp b/test/Index/Core/index-source.cpp index cb64bd7396..6ad600b351 100644 --- a/test/Index/Core/index-source.cpp +++ b/test/Index/Core/index-source.cpp @@ -543,7 +543,7 @@ void foo() { __builtin_offsetof(Struct2, array[1][0].field); // CHECK: [[@LINE-1]]:31 | field/C | array | c:@N@index_offsetof@S@Struct2@FI@array | <no-cgname> | Ref,RelCont | rel: 1 // CHECK-NEXT: RelCont | foo | c:@N@index_offsetof@F@foo# -// CHECK: [[@LINE-3]]:42 | field/C | field | c:@N@index_offsetof@S@Struct@FI@field | <no-cgname> | Ref,RelCont | rel: 1 +// CHECK: [[@LINE-3]]:43 | field/C | field | c:@N@index_offsetof@S@Struct@FI@field | <no-cgname> | Ref,RelCont | rel: 1 // CHECK-NEXT: RelCont | foo | c:@N@index_offsetof@F@foo# } |