diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-23 03:33:19 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-23 03:33:19 +0000 |
commit | ccc6f36e53274fccae024f30ac5adb6be6f815d3 (patch) | |
tree | cf7f2ab807445acf642b3d4e9e08918be9cb7e92 /tools | |
parent | e8018f24f0f0e1cb1490c37b158da5d5c456e577 (diff) |
[libclang] For a CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor,
return from clang_getCursorLocation the start location of the method name.
rdar://11105223
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index cb86c46ba4..f15de4b758 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -3764,6 +3764,10 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) { Loc = VD->getLocation(); } + // For ObjC methods, give the start location of the method name. + if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) + Loc = MD->getSelectorStartLoc(); + return cxloc::translateSourceLocation(getCursorContext(C), Loc); } |