This patch re-types everywhere that passes a File::OpenOptions
as a uint32_t so it actually uses File::OpenOptions.
It also converts some OpenOptions related functions that fail
by returning 0 or NULL into llvm::Expected
split off from https://reviews.llvm.org/D68737
A better way to handle that is to make this a typed enum (enum OpenOptions : uint16_t). Then you can add something like LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/0xffffu) to make sure the bitmask operators also work well.