r317596 - [index] __builtin_offset's field reference is located at the end location

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 10:25:36 PST 2017


Author: arphaman
Date: Tue Nov  7 10:25:36 2017
New Revision: 317596

URL: http://llvm.org/viewvc/llvm-project?rev=317596&view=rev
Log:
[index] __builtin_offset's field reference is located at the end location

The starting location is the location of the '.'

Modified:
    cfe/trunk/lib/Index/IndexBody.cpp
    cfe/trunk/test/Index/Core/index-source.cpp

Modified: cfe/trunk/lib/Index/IndexBody.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexBody.cpp?rev=317596&r1=317595&r2=317596&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexBody.cpp (original)
+++ cfe/trunk/lib/Index/IndexBody.cpp Tue Nov  7 10:25:36 2017
@@ -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.
     }

Modified: cfe/trunk/test/Index/Core/index-source.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.cpp?rev=317596&r1=317595&r2=317596&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.cpp (original)
+++ cfe/trunk/test/Index/Core/index-source.cpp Tue Nov  7 10:25:36 2017
@@ -543,7 +543,7 @@ void foo() {
   __builtin_offsetof(Struct2, array[1][0].field);
 // CHECK: [[@LINE-1]]:31 | field/C | array | c:@N at index_offsetof@S at Struct2@FI at array | <no-cgname> | Ref,RelCont | rel: 1
 // CHECK-NEXT: RelCont | foo | c:@N at index_offsetof@F at foo#
-// CHECK: [[@LINE-3]]:42 | field/C | field | c:@N at index_offsetof@S at Struct@FI at field | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK: [[@LINE-3]]:43 | field/C | field | c:@N at index_offsetof@S at Struct@FI at field | <no-cgname> | Ref,RelCont | rel: 1
 // CHECK-NEXT: RelCont | foo | c:@N at index_offsetof@F at foo#
 }
 




More information about the cfe-commits mailing list