diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-07-26 05:17:23 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-07-26 05:17:23 +0000 |
commit | 3201f382956ed9beee9fb31229c2835c1208889c (patch) | |
tree | 0263e25d31d2c692c38d301793e2cb05bef73262 /include/clang/Basic/SourceManager.h | |
parent | 1728762d5a8cfaf8d64385f47b311e84de1ae7a2 (diff) |
Clean up as many of the comments in Basic I can find to talk in terms of
'expansion' rather than 'instantiation' for macro source locations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index f4d36ea1e4..4a980dc15b 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -106,8 +106,8 @@ namespace SrcMgr { unsigned getSize() const; /// getSizeBytesMapped - Returns the number of bytes actually mapped for - /// this ContentCache. This can be 0 if the MemBuffer was not actually - /// instantiated. + /// this ContentCache. This can be 0 if the MemBuffer was not actually + /// expanded. unsigned getSizeBytesMapped() const; /// Returns the kind of memory used to back the memory buffer for @@ -174,8 +174,8 @@ namespace SrcMgr { /// that it represents and include stack information. /// /// Each FileInfo has include stack information, indicating where it came - /// from. This information encodes the #include chain that a token was - /// instantiated from. The main include file has an invalid IncludeLoc. + /// from. This information encodes the #include chain that a token was + /// expanded from. The main include file has an invalid IncludeLoc. /// /// FileInfos contain a "ContentCache *", with the contents of the file. /// @@ -235,8 +235,8 @@ namespace SrcMgr { /// ExpansionLocStart/ExpansionLocEnd - In a macro expansion, these /// indicate the start and end of the expansion. In object-like macros, - /// these will be the same. In a function-like macro instantiation, the - /// start will be the identifier and the end will be the ')'. Finally, in + /// these will be the same. In a function-like macro expansion, the start + /// will be the identifier and the end will be the ')'. Finally, in /// macro-argument instantitions, the end will be 'SourceLocation()', an /// invalid location. unsigned ExpansionLocStart, ExpansionLocEnd; @@ -309,7 +309,7 @@ namespace SrcMgr { /// ExpansionInfo. SourceManager keeps an array of these objects, and /// they are uniquely identified by the FileID datatype. class SLocEntry { - unsigned Offset; // low bit is set for instantiation info. + unsigned Offset; // low bit is set for expansion info. union { FileInfo File; ExpansionInfo Expansion; @@ -416,12 +416,12 @@ public: /// files and assigns unique FileID's for each unique #include chain. /// /// The SourceManager can be queried for information about SourceLocation -/// objects, turning them into either spelling or instantiation locations. -/// Spelling locations represent where the bytes corresponding to a token came -/// from and instantiation locations represent where the location is in the -/// user's view. In the case of a macro expansion, for example, the spelling -/// location indicates where the expanded token came from and the instantiation -/// location specifies where it was expanded. +/// objects, turning them into either spelling or expansion locations. Spelling +/// locations represent where the bytes corresponding to a token came from and +/// expansion locations represent where the location is in the user's view. In +/// the case of a macro expansion, for example, the spelling location indicates +/// where the expanded token came from and the expansion location specifies +/// where it was expanded. class SourceManager : public llvm::RefCountedBase<SourceManager> { /// \brief Diagnostic object. Diagnostic &Diag; @@ -451,7 +451,7 @@ class SourceManager : public llvm::RefCountedBase<SourceManager> { /// \brief The table of SLocEntries that are local to this module. /// /// Positive FileIDs are indexes into this table. Entry 0 indicates an invalid - /// instantiation. + /// expansion. std::vector<SrcMgr::SLocEntry> LocalSLocEntryTable; /// \brief The table of SLocEntries that are loaded from other modules. @@ -558,7 +558,7 @@ public: } //===--------------------------------------------------------------------===// - // Methods to create new FileID's and instantiations. + // Methods to create new FileID's and macro expansions. //===--------------------------------------------------------------------===// /// createFileID - Create a new FileID that represents the specified file @@ -583,8 +583,8 @@ public: /// createMacroArgExpansionLoc - Return a new SourceLocation that encodes the /// fact that a token from SpellingLoc should actually be referenced from - /// ExpansionLoc, and that it represents the instantiation of a macro - /// argument into the function-like macro body. + /// ExpansionLoc, and that it represents the expansion of a macro argument + /// into the function-like macro body. SourceLocation createMacroArgExpansionLoc(SourceLocation Loc, SourceLocation ExpansionLoc, unsigned TokLength); @@ -746,7 +746,7 @@ public: /// that make up the lexed token can be found. SourceLocation getSpellingLoc(SourceLocation Loc) const { // Handle the non-mapped case inline, defer to out of line code to handle - // instantiations. + // expansions. if (Loc.isFileID()) return Loc; return getSpellingLocSlowCase(Loc); } @@ -765,9 +765,9 @@ public: return std::make_pair(FID, Loc.getOffset()-getSLocEntry(FID).getOffset()); } - /// getDecomposedExpansionLoc - Decompose the specified location into a - /// raw FileID + Offset pair. If the location is an instantiation record, - /// walk through it until we find the final location instantiated. + /// getDecomposedExpansionLoc - Decompose the specified location into a raw + /// FileID + Offset pair. If the location is an expansion record, walk + /// through it until we find the final location expanded. std::pair<FileID, unsigned> getDecomposedExpansionLoc(SourceLocation Loc) const { FileID FID = getFileID(Loc); @@ -781,7 +781,7 @@ public: } /// getDecomposedSpellingLoc - Decompose the specified location into a raw - /// FileID + Offset pair. If the location is an instantiation record, walk + /// FileID + Offset pair. If the location is an expansion record, walk /// through it until we find its spelling record. std::pair<FileID, unsigned> getDecomposedSpellingLoc(SourceLocation Loc) const { @@ -820,8 +820,8 @@ public: /// getColumnNumber - Return the column # for the specified file position. /// This is significantly cheaper to compute than the line number. This - /// returns zero if the column number isn't known. This may only be called on - /// a file sloc, so you must choose a spelling or instantiation location + /// returns zero if the column number isn't known. This may only be called + /// on a file sloc, so you must choose a spelling or expansion location /// before calling this method. unsigned getColumnNumber(FileID FID, unsigned FilePos, bool *Invalid = 0) const; @@ -860,8 +860,8 @@ public: /// or GNU line marker directives. This provides a view on the data that a /// user should see in diagnostics, for example. /// - /// Note that a presumed location is always given as the instantiation point - /// of an instantiation location, not at the spelling location. + /// Note that a presumed location is always given as the expansion point of + /// an expansion location, not at the spelling location. /// /// \returns The presumed location of the specified SourceLocation. If the /// presumed location cannot be calculate (e.g., because \p Loc is invalid @@ -1079,7 +1079,7 @@ private: } /// createExpansionLoc - Implements the common elements of storing an - /// instantiation info struct into the SLocEntry table and producing a source + /// expansion info struct into the SLocEntry table and producing a source /// location that refers to it. SourceLocation createExpansionLocImpl(const SrcMgr::ExpansionInfo &Expansion, unsigned TokLength, |