]> granicus.if.org Git - clang/commitdiff
[libclang] In visitPreprocessedEntitiesInRange we are interested in a file region
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 21 Dec 2011 16:56:38 +0000 (16:56 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 21 Dec 2011 16:56:38 +0000 (16:56 +0000)
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

index a5b390a53a4754e6c507492d9f14d33cbde5ddc0..525c5fc0f56ab96e6bfac403c15e1a3d84a4787a 100644 (file)
@@ -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();
   }