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

Commit
33 days ago
[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.
Author
Parents
Loading