[PATCH] D89554: SourceManager: Clarify that FileInfo always has a ContentCache, NFC

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 07:45:21 PDT 2020


dexonsmith created this revision.
dexonsmith added a reviewer: arphaman.
Herald added subscribers: ributzka, martong.
Herald added a reviewer: shafik.
dexonsmith requested review of this revision.

It turns out that `FileInfo` *always* has a ContentCache. Clarify that
in the code:

- Update the private version of `SourceManager::createFileID` to take a `ContentCache&` instead of `ContentCache*`, and rename it to `createFileIDImpl` for clarity.
- Change `FileInfo::getContentCache` to return a reference.


https://reviews.llvm.org/D89554

Files:
  clang/include/clang/Basic/SourceManager.h
  clang/lib/AST/ASTImporter.cpp
  clang/lib/Basic/SourceManager.cpp
  clang/lib/Lex/ScratchBuffer.cpp
  clang/lib/Rewrite/Rewriter.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/tools/libclang/CIndexInclusionStack.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89554.298634.patch
Type: text/x-patch
Size: 16102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201016/f8437e2c/attachment-0001.bin>


More information about the cfe-commits mailing list