@@ -795,7 +795,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
795795 // /
796796 // / Used to cache results from and speed-up \c getDecomposedIncludedLoc
797797 // / function.
798- mutable llvm::DenseMap<FileID, std::pair<FileID, unsigned > > IncludedLocMap;
798+ mutable llvm::DenseMap<FileID, FileIDAndOffset > IncludedLocMap;
799799
800800 // / The key value into the IsBeforeInTUCache table.
801801 using IsBeforeInTUCacheKey = std::pair<FileID, FileID>;
@@ -1269,7 +1269,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
12691269 // /
12701270 // / The first element is the FileID, the second is the offset from the
12711271 // / start of the buffer of the location.
1272- std::pair<FileID, unsigned > getDecomposedLoc (SourceLocation Loc) const {
1272+ FileIDAndOffset getDecomposedLoc (SourceLocation Loc) const {
12731273 FileID FID = getFileID (Loc);
12741274 auto *Entry = getSLocEntryOrNull (FID);
12751275 if (!Entry)
@@ -1281,8 +1281,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
12811281 // /
12821282 // / If the location is an expansion record, walk through it until we find
12831283 // / the final location expanded.
1284- std::pair<FileID, unsigned >
1285- getDecomposedExpansionLoc (SourceLocation Loc) const {
1284+ FileIDAndOffset getDecomposedExpansionLoc (SourceLocation Loc) const {
12861285 FileID FID = getFileID (Loc);
12871286 auto *E = getSLocEntryOrNull (FID);
12881287 if (!E)
@@ -1299,8 +1298,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
12991298 // /
13001299 // / If the location is an expansion record, walk through it until we find
13011300 // / its spelling record.
1302- std::pair<FileID, unsigned >
1303- getDecomposedSpellingLoc (SourceLocation Loc) const {
1301+ FileIDAndOffset getDecomposedSpellingLoc (SourceLocation Loc) const {
13041302 FileID FID = getFileID (Loc);
13051303 auto *E = getSLocEntryOrNull (FID);
13061304 if (!E)
@@ -1314,7 +1312,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
13141312
13151313 // / Returns the "included/expanded in" decomposed location of the given
13161314 // / FileID.
1317- std::pair<FileID, unsigned > getDecomposedIncludedLoc (FileID FID) const ;
1315+ FileIDAndOffset getDecomposedIncludedLoc (FileID FID) const ;
13181316
13191317 // / Returns the offset from the start of the file that the
13201318 // / specified SourceLocation represents.
@@ -1682,18 +1680,17 @@ class SourceManager : public RefCountedBase<SourceManager> {
16821680 // / are in the same TU. The second bool is true if the first is true
16831681 // / and \p LOffs is before \p ROffs.
16841682 std::pair<bool , bool >
1685- isInTheSameTranslationUnit (std::pair<FileID, unsigned > &LOffs,
1686- std::pair<FileID, unsigned > &ROffs) const ;
1683+ isInTheSameTranslationUnit (FileIDAndOffset &LOffs,
1684+ FileIDAndOffset &ROffs) const ;
16871685
16881686 // / \param Loc a source location in a loaded AST (of a PCH/Module file).
16891687 // / \returns a FileID uniquely identifies the AST of a loaded
16901688 // / module/PCH where `Loc` is at.
16911689 FileID getUniqueLoadedASTFileID (SourceLocation Loc) const ;
16921690
16931691 // / Determines whether the two decomposed source location is in the same TU.
1694- bool isInTheSameTranslationUnitImpl (
1695- const std::pair<FileID, unsigned > &LOffs,
1696- const std::pair<FileID, unsigned > &ROffs) const ;
1692+ bool isInTheSameTranslationUnitImpl (const FileIDAndOffset &LOffs,
1693+ const FileIDAndOffset &ROffs) const ;
16971694
16981695 // / Determines the order of 2 source locations in the "source location
16991696 // / address space".
@@ -1979,11 +1976,10 @@ class SourceManager : public RefCountedBase<SourceManager> {
19791976 SourceLocation getSpellingLocSlowCase (SourceLocation Loc) const ;
19801977 SourceLocation getFileLocSlowCase (SourceLocation Loc) const ;
19811978
1982- std::pair<FileID, unsigned >
1979+ FileIDAndOffset
19831980 getDecomposedExpansionLocSlowCase (const SrcMgr::SLocEntry *E) const ;
1984- std::pair<FileID, unsigned >
1985- getDecomposedSpellingLocSlowCase (const SrcMgr::SLocEntry *E,
1986- unsigned Offset) const ;
1981+ FileIDAndOffset getDecomposedSpellingLocSlowCase (const SrcMgr::SLocEntry *E,
1982+ unsigned Offset) const ;
19871983 void computeMacroArgsCache (MacroArgsMap &MacroArgsCache, FileID FID) const ;
19881984 void associateFileChunkWithMacroArgExp (MacroArgsMap &MacroArgsCache,
19891985 FileID FID,
0 commit comments