forked from OSchip/llvm-project
CIndex: Avoid an unnecessary getLocForEndOfToken call, the region of interest
doesn't need to be a full token. - Doug, please review. llvm-svn: 96161
This commit is contained in:
parent
6092d507f0
commit
edeb9b87e6
|
@ -1468,8 +1468,7 @@ CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) {
|
||||||
SourceLocation SLoc = cxloc::translateSourceLocation(Loc);
|
SourceLocation SLoc = cxloc::translateSourceLocation(Loc);
|
||||||
CXCursor Result = MakeCXCursorInvalid(CXCursor_NoDeclFound);
|
CXCursor Result = MakeCXCursorInvalid(CXCursor_NoDeclFound);
|
||||||
if (SLoc.isValid()) {
|
if (SLoc.isValid()) {
|
||||||
SourceRange RegionOfInterest(SLoc,
|
SourceRange RegionOfInterest(SLoc, SLoc);
|
||||||
CXXUnit->getPreprocessor().getLocForEndOfToken(SLoc, 1));
|
|
||||||
|
|
||||||
// FIXME: Would be great to have a "hint" cursor, then walk from that
|
// FIXME: Would be great to have a "hint" cursor, then walk from that
|
||||||
// hint cursor upward until we find a cursor whose source range encloses
|
// hint cursor upward until we find a cursor whose source range encloses
|
||||||
|
|
Loading…
Reference in New Issue