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 | a754a03550003a0f2b93d57e0854be5939814c33 (patch) | |
| tree | 278c1e63d949e60c4e6dc921bfc9f9e93cce5316 /clang/tools/libclang/CIndex.cpp | |
| parent | edb062887fc244ce9460408ff0b7c5b6ecf70050 (diff) | |
| download | bcm5719-llvm-a754a03550003a0f2b93d57e0854be5939814c33.tar.gz bcm5719-llvm-a754a03550003a0f2b93d57e0854be5939814c33.zip | |
[libclang] For a CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor,
return from clang_getCursorLocation the start location of the method name.
rdar://11105223
llvm-svn: 153303
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index cb86c46ba44..f15de4b7581 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/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); } |

