[PATCH] D28105: [DWARF] - Introduce DWARFCompression class.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 10:24:46 PST 2017


> +Decompressor::Decompressor(StringRef Name, StringRef Data, bool IsLE,
> +                           bool Is64Bit)
> +    : SectionName(Name), SectionData(Data), IsLittleEndian(IsLE),
> +      Is64Bit(Is64Bit), DecompressedSize(0) {
> +  if (!zlib::isAvailable()) {
> +    setError("zlib is not available");
> +    return;
> +  }

Since this is in LLVM, maybe we should change the error handling:

* Make the constructor private.
* Add a create static method that return an Expected<Decompressor>.
* Similar for the other methods, return an Error/Expected instead of
  using setError.

Cheers,
Rafael


More information about the llvm-commits mailing list