FailedChanges

Summary

  1. Frontend: Simplify handling of non-seeking streams in CompilerInstance, NFC (details)
  2. [llc] Add reportError helper and canonicalize error messages (details)
  3. Frontend: Fix layering between create{,Default}OutputFile, NFC (details)
Commit 2f721476d10c1cc7a5336650a85012f78c94d33a by Duncan P. N. Exon Smith
Frontend: Simplify handling of non-seeking streams in CompilerInstance, NFC

Add a new `raw_pwrite_ostream` variant, `buffer_unique_ostream`, which
is like `buffer_ostream` but with unique ownership of the stream it's
wrapping. Use this in CompilerInstance to simplify the ownership of
non-seeking output streams, avoiding logic sprawled around to deal with
them specially.

This also simplifies future work to encapsulate output files in a
different class.

Differential Revision: https://reviews.llvm.org/D93260
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp (diff)
The file was modifiedllvm/lib/Support/raw_ostream.cpp (diff)
The file was modifiedclang/include/clang/Frontend/CompilerInstance.h (diff)
The file was modifiedllvm/include/llvm/Support/raw_ostream.h (diff)
Commit 4d28f0a6a4036388694bb83aebc0db9334b82f6e by i
[llc] Add reportError helper and canonicalize error messages
The file was modifiedllvm/test/CodeGen/AMDGPU/invalid-alloca.ll (diff)
The file was modifiedllvm/test/tools/llc/aix-pic-setting.ll (diff)
The file was modifiedllvm/tools/llc/llc.cpp (diff)
Commit ad7aaa475e5e632242b07380ec47d2f35d077209 by Duncan P. N. Exon Smith
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
The file was modifiedclang/tools/driver/cc1_main.cpp (diff)
The file was modifiedclang/include/clang/Frontend/CompilerInstance.h (diff)
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp (diff)
The file was modifiedclang/lib/Frontend/FrontendActions.cpp (diff)