Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
the files of different SourceLocations.  These methods correctly handle the
case where a file may have multiple FileIDs due to it being large enough
to be spread across several chunks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49682 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp
index c014475..83c264a 100644
--- a/lib/Basic/SourceLocation.cpp
+++ b/lib/Basic/SourceLocation.cpp
@@ -88,3 +88,7 @@
   assert (isValid());
   return SrcMgr->getBuffer(Loc.getFileID());
 }
+
+unsigned FullSourceLoc::getCanonicalFileID() const {
+  return SrcMgr->getCanonicalFileID(Loc);
+}