diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-11-20 18:04:32 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-01-26 15:56:19 -0800 |
commit | ad7aaa475e5e632242b07380ec47d2f35d077209 (patch) | |
tree | 7633c37dced0ea3e786f9fa47ee048e0a04dee63 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 4d28f0a6a4036388694bb83aebc0db9334b82f6e (diff) | |
download | llvm-ad7aaa475e5e632242b07380ec47d2f35d077209.zip llvm-ad7aaa475e5e632242b07380ec47d2f35d077209.tar.gz llvm-ad7aaa475e5e632242b07380ec47d2f35d077209.tar.bz2 |
Frontend: Fix layering between create{,Default}OutputFile, NFC
Fix layering between `CompilerInstance::createDefaultOutputFile` and the
two versions of `createOutputFile`.
- Add missing configuration flags to `createDefaultOutputFile` so that
GeneratePCHAction and GenerateModuleFromModuleMapAction can use it.
They previously promised that temporary files were turned on; now
`createDefaultOutputFile` handles that logic.
- Lift the logic handling `InFile` and `Extension` to
`createDefaultOutputFile`, since it's only the callers of that
function that are using it.
- Rename the deeper of the two `createOutputFile`s to
`createOutputFileImpl` and make it private to `CompilerInstance` (to
prove that no one else is using it).
- Sink the logic for adding to `CompilerInstance::OutputFiles` down to
`createOutputFileImpl`, allowing two "optional" (but always used)
`std::string*` out parameters to be removed.
- Instead of passing a `std::error_code` out parameter into
`createOutputFileImpl`, have it return `Expected<>`.
- As a drive-by, inline `CompilerInstance::addOutputFile` into its only
caller, `createOutputFileImpl`.
Clean layering makes it easier for a future commit to extract
`createOutputFileImpl` out of `CompilerInstance`.
Differential Revision: https://reviews.llvm.org/D93248
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions