6 Commits

Author SHA1 Message Date
Giacomo Vercesi ec3231d7e6 TemporaryFile: fix move assignment
Fix the move assignment operator of `TemporaryFile`, which would behave
incorrectly if the object was moved into itself.
2025-05-05 16:02:40 +02:00
Giacomo Vercesi cf08ae41be Drop usage of llvm::ErrorOr<T>
Remove the last two remaining classes in revng which used the
`llvm::ErrorOr` class, replace them with `llvm::Expected`.
2025-05-05 16:02:40 +02:00
Giacomo Vercesi 761e84fc9f Add revng::cantFail
Add the `revng::cantFail` function which allows to wrap functions with
`std::error_code` and check their result. This is analogous to
`llvm::cantFail` for `llvm::Error`.
2025-02-05 10:46:00 +01:00
Giacomo Vercesi 7f0bea6f6a Improve TemporaryFile
This commit adds the following enhancements to `TemporaryFile`:
* Adds TemporaryFile::make to allow catching the error if the temporary
  file creation fails
* Fix the move assignment, as it would leak the original file until shutdown
* Fix the destructor, as it would be called even on a moved object
2023-09-06 15:23:43 +02:00
Alessandro Di Federico 02c69b0421 TemporaryFile: use RemoveFileOnSignal 2022-09-26 18:05:38 +02:00
Alessandro Di Federico f44363f621 Introduce TemporaryFile 2022-03-08 12:25:47 +01:00