[all-commits] [llvm/llvm-project] 74a878: SourceManager: Clarify that FileInfo always has a ...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Fri Oct 23 09:39:15 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 74a8783480219f5f0e5c4673a6d0e29b4ad99877
      https://github.com/llvm/llvm-project/commit/74a8783480219f5f0e5c4673a6d0e29b4ad99877
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

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

  Log Message:
  -----------
  SourceManager: Clarify that FileInfo always has a ContentCache, NFC

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.

Differential Revision: https://reviews.llvm.org/D89554




More information about the All-commits mailing list