From acca41167ce78bb032906f6b1d2ced62efbe059a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 21 Dec 2011 16:56:38 +0000 Subject: [PATCH] [libclang] In visitPreprocessedEntitiesInRange we are interested in a file region so translate the range to file locations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147058 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index a5b390a53a..525c5fc0f5 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -193,8 +193,8 @@ static bool visitPreprocessedEntitiesInRange(SourceRange R, if (!Visitor.shouldVisitIncludedEntities()) { // If the begin/end of the range lie in the same FileID, do the optimization // where we skip preprocessed entities that do not come from the same FileID. - FID = SM.getFileID(R.getBegin()); - if (FID != SM.getFileID(R.getEnd())) + FID = SM.getFileID(SM.getFileLoc(R.getBegin())); + if (FID != SM.getFileID(SM.getFileLoc(R.getEnd()))) FID = FileID(); } -- 2.40.0