bnbarham added inline comments.
Comment at: clang/include/clang/Basic/SourceManager.h:147-163
/// Indicates whether the buffer itself was provided to override
/// the actual file contents.
///
/// When true, the original entry may be a virtual file that does not
//
dexonsmith added inline comments.
Comment at: clang/include/clang/Basic/SourceManager.h:135-139
/// References the file which the contents were actually loaded from.
///
/// Can be different from 'Entry' if we overridden the contents of one file
/// with the contents
dexonsmith added inline comments.
Comment at: clang/include/clang/Basic/SourceManager.h:261-263
+ /// FIXME: Make non-optional using a virtual file as needed, remove \c
+ /// Filename and use \c OrigEntry.getNameAsRequested() instead.
+ OptionalFileEntryRefDegradesToFileEntryP
benlangmuir added a comment.
Thanks for the timely review!
> the DenseMaps that need this unique-by-FileEntry* behaviour should probably
> be the ones using a custom DenseMapInfo.
Yeah, that's the way I'm currently leaning. Make the default for `DenseMap`
and `==` be path equality and have a
dexonsmith added inline comments.
Comment at: clang/include/clang/Basic/SourceManager.h:652-662
+ llvm::DenseMap
+ NamedFileInfos;
+
/// Memoized information about all of the files tracked by this
/// SourceManager.
///
It feels expensive to have b
dexonsmith added inline comments.
Comment at: clang/include/clang/Basic/SourceManager.h:135-139
/// References the file which the contents were actually loaded from.
///
/// Can be different from 'Entry' if we overridden the contents of one file
/// with the contents
dexonsmith added a comment.
> Consider making the FileEntryRef changes here the default -- it doesn't make
> sense to me that FileEntryRef == or DenseMap would match FileEntry pointer
> semantics instead of filename semantics.
Yeah, that was something I added, and I agree it's unfortunate / har
benlangmuir created this revision.
Herald added a project: All.
benlangmuir requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
When including a header, store the filename per include (per FileInfo)
rather than storing it once in the ContentCac