[all-commits] [llvm/llvm-project] b86dda: [clang] NFCI: Clean up `CompilerInstance::create{F...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Oct 2 11:01:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b86ddae1da651f921125a9864b45a5b11bc3b1c0
      https://github.com/llvm/llvm-project/commit/b86ddae1da651f921125a9864b45a5b11bc3b1c0
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2025-10-02 (Thu, 02 Oct 2025)

  Changed paths:
    M clang-tools-extra/clang-include-fixer/IncludeFixer.cpp
    M clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
    M clang/include/clang/Frontend/CompilerInstance.h
    M clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
    M clang/lib/Frontend/ChainedIncludesSource.cpp
    M clang/lib/Frontend/CompilerInstance.cpp
    M clang/lib/Frontend/FrontendAction.cpp
    M clang/lib/Testing/TestAST.cpp
    M clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp
    M clang/lib/Tooling/Tooling.cpp
    M clang/tools/clang-import-test/clang-import-test.cpp
    M clang/unittests/CodeGen/TestCompiler.h
    M clang/unittests/Serialization/ForceCheckFileInputTest.cpp
    M clang/unittests/Tooling/DependencyScanning/DependencyScannerTest.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

  Log Message:
  -----------
  [clang] NFCI: Clean up `CompilerInstance::create{File,Source}Manager()` (#160748)

The `CompilerInstance::createSourceManager()` function currently accepts
the `FileManager` to be used. However, all clients call
`CompilerInstance::createFileManager()` prior to creating the
`SourceManager`, and it never makes sense to use a `FileManager` in the
`SourceManager` that's different from the rest of the compiler. Passing
the `FileManager` explicitly is redundant, error-prone, and deviates
from the style of other `CompilerInstance` initialization APIs.

This PR therefore removes the `FileManager` parameter from
`createSourceManager()` and also stops returning the `FileManager`
pointer from `createFileManager()`, since that was its primary use. Now,
`createSourceManager()` internally calls `getFileManager()` instead.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list