summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceLocation.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-14 21:04:18 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-14 21:04:18 +0000
commit17acadebb493ea4a1227d18a87abf8a56953b205 (patch)
tree8ef10f54ea82ccf3d382f5f45b67e9fdfe1e49e7 /clang/lib/Basic/SourceLocation.cpp
parent4fff979a434199b1f842fb04f4c5faf5390fffda (diff)
downloadbcm5719-llvm-17acadebb493ea4a1227d18a87abf8a56953b205.tar.gz
bcm5719-llvm-17acadebb493ea4a1227d18a87abf8a56953b205.zip
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. llvm-svn: 49682
Diffstat (limited to 'clang/lib/Basic/SourceLocation.cpp')
-rw-r--r--clang/lib/Basic/SourceLocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp
index c01447567fb..83c264ad0b0 100644
--- a/clang/lib/Basic/SourceLocation.cpp
+++ b/clang/lib/Basic/SourceLocation.cpp
@@ -88,3 +88,7 @@ const llvm::MemoryBuffer* FullSourceLoc::getBuffer() const {
assert (isValid());
return SrcMgr->getBuffer(Loc.getFileID());
}
+
+unsigned FullSourceLoc::getCanonicalFileID() const {
+ return SrcMgr->getCanonicalFileID(Loc);
+}
OpenPOWER on IntegriCloud