diff options
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 5006b00929..99392a0982 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -122,7 +122,7 @@ namespace SrcMgr { /// \brief The number of lines in this ContentCache. /// /// This is only valid if SourceLineCache is non-null. - unsigned NumLines : 31; + unsigned NumLines; /// \brief Indicates whether the buffer itself was provided to override /// the actual file contents. @@ -135,12 +135,17 @@ namespace SrcMgr { /// file considered as a system one. unsigned IsSystemFile : 1; + /// \brief True if this file may be transient, that is, if it might not + /// exist at some later point in time when this content entry is used, + /// after serialization and deserialization. + unsigned IsTransient : 1; + ContentCache(const FileEntry *Ent = nullptr) : ContentCache(Ent, Ent) {} ContentCache(const FileEntry *Ent, const FileEntry *contentEnt) : Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt), SourceLineCache(nullptr), NumLines(0), BufferOverridden(false), - IsSystemFile(false) {} + IsSystemFile(false), IsTransient(false) {} ~ContentCache(); @@ -149,7 +154,7 @@ namespace SrcMgr { /// is not transferred, so this is a logical error. ContentCache(const ContentCache &RHS) : Buffer(nullptr, false), SourceLineCache(nullptr), - BufferOverridden(false), IsSystemFile(false) { + BufferOverridden(false), IsSystemFile(false), IsTransient(false) { OrigEntry = RHS.OrigEntry; ContentsEntry = RHS.ContentsEntry; @@ -862,17 +867,13 @@ public: /// This should be called before parsing has begun. void disableFileContentsOverride(const FileEntry *File); - /// \brief Request that the contents of the given source file are written - /// to a created module file if they are used in this compilation. This - /// removes the requirement that the file still exist when the module is used - /// (but does not make the file visible to header search and the like when - /// the module is used). - void embedFileContentsInModule(const FileEntry *SourceFile); - - /// \brief Request that all files that are read during this compilation be - /// written to any created module file. - void setEmbedAllFileContentsInModule(bool Embed) { - FilesAreTransient = Embed; + /// \brief Specify that a file is transient. + void setFileIsTransient(const FileEntry *SourceFile); + + /// \brief Specify that all files that are read during this compilation are + /// transient. + void setAllFilesAreTransient(bool Transient) { + FilesAreTransient = Transient; } //===--------------------------------------------------------------------===// |