Convert over to new SourceManager::isFromMainFile() instead of doing direct
FileID comparison (fixes insidious corner case with chunks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49684 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/HTMLPrint.cpp b/Driver/HTMLPrint.cpp
index ef20395..77e85d7 100644
--- a/Driver/HTMLPrint.cpp
+++ b/Driver/HTMLPrint.cpp
@@ -157,16 +157,13 @@
   SourceManager& SM = R.getSourceMgr();
   
   FullSourceLoc LPos = Pos.getLogicalLoc();
-  unsigned FileID = LPos.getLocation().getFileID();
+  unsigned FileID = SM.getCanonicalFileID(LPos.getLocation());
   
   assert (&LPos.getManager() == &SM && "SourceManagers are different!");
   
-  unsigned MainFileID = SM.getMainFileID();
-  
-  if (FileID != MainFileID)
+  if (!SM.isFromMainFile(LPos.getLocation()))
     return;
   
-  
   // Compute the column number.  Rewind from the current position to the start
   // of the line.
 
@@ -228,13 +225,12 @@
 
     ++Ranges;
     
-    if (B.getFileID() != MainFileID || E.getFileID() != MainFileID)
+    if (!SM.isFromMainFile(B) || !SM.isFromMainFile(E))
       continue;
     
     // Highlight the range.  Make the span tag the outermost tag for the
     // selected range.
     R.InsertCStrBefore(B, "<span class=\"mrange\">");
     R.InsertCStrAfter(E, "</span>");
-  }
-  
+  }  
 }