aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-19 07:46:45 +0000
committerChris Lattner <sabre@nondot.org>2009-01-19 07:46:45 +0000
commita11d61793341fea195c29a0dab3fbd74f2b39a8c (patch)
tree8cff5248e13216b898f92723678d94b9a0ff78d3 /include/clang/Basic/SourceManager.h
parent9ee7d456b427e002f7fe1844b64bec8055c8db52 (diff)
Rename SourceManager::getCanonicalFileID -> getFileID. There is
no longer such thing as a non-canonical FileID. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 41fa04183c..202a7c55aa 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -409,15 +409,6 @@ public:
return getContentCache(FID)->Entry;
}
- /// getCanonicalFileID - Return the canonical FileID for a SourceLocation.
- /// A file can have multiple FileIDs if it is large enough to be broken
- /// into multiple chunks. This method returns the unique FileID without
- /// chunk information for a given SourceLocation. Use this method when
- /// you want to compare FileIDs across SourceLocations.
- FileID getCanonicalFileID(SourceLocation SpellingLoc) const {
- return getDecomposedFileLoc(SpellingLoc).first;
- }
-
/// getDecomposedFileLoc - Decompose the specified file location into a raw
/// FileID + Offset pair. The first element is the FileID, the second is the
/// offset from the start of the buffer of the location.
@@ -437,7 +428,13 @@ public:
return std::make_pair(FileID::Create(Loc.getChunkID()-ChunkNo), Offset);
}
-
+
+ /// getFileID - Return the FileID for a SourceLocation.
+ ///
+ FileID getFileID(SourceLocation SpellingLoc) const {
+ return getDecomposedFileLoc(SpellingLoc).first;
+ }
+
/// getFullFilePos - This (efficient) method returns the offset from the start
/// of the file that the specified spelling SourceLocation represents. This
/// returns the location of the actual character data, not the instantiation
@@ -449,13 +446,13 @@ public:
/// isFromSameFile - Returns true if both SourceLocations correspond to
/// the same file.
bool isFromSameFile(SourceLocation Loc1, SourceLocation Loc2) const {
- return getCanonicalFileID(Loc1) == getCanonicalFileID(Loc2);
+ return getFileID(Loc1) == getFileID(Loc2);
}
/// isFromMainFile - Returns true if the file of provided SourceLocation is
/// the main file.
bool isFromMainFile(SourceLocation Loc) const {
- return getCanonicalFileID(Loc) == getMainFileID();
+ return getFileID(Loc) == getMainFileID();
}
/// isInSystemHeader - Returns if a SourceLocation is in a system header.