From 19e4a07e7317eacf88247614c97f11ab93409a04 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 14 Feb 2010 10:02:42 +0000 Subject: [PATCH] CIndex: Avoid an unnecessary getLocForEndOfToken call, the region of interest doesn't need to be a full token. - Doug, please review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96161 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/CIndex/CIndex.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index fd8ce2a425..5f8e25353d 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -1468,8 +1468,7 @@ CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) { SourceLocation SLoc = cxloc::translateSourceLocation(Loc); CXCursor Result = MakeCXCursorInvalid(CXCursor_NoDeclFound); if (SLoc.isValid()) { - SourceRange RegionOfInterest(SLoc, - CXXUnit->getPreprocessor().getLocForEndOfToken(SLoc, 1)); + SourceRange RegionOfInterest(SLoc, SLoc); // 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 -- 2.40.0