[PATCH] D49678: [llvm-objcopy] Adding support for compressed DWARF debug sections.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 14:49:59 PDT 2018


JDevlieghere added a comment.

Few nits



================
Comment at: include/llvm/Object/Compressor.h:31
+  /// Compress section data.
+  /// @param W Destination buffer stream for compressed data..
+  Error writeCompressedSectionData(support::endian::Writer &W) {
----------------
s/.././


================
Comment at: include/llvm/Object/Compressor.h:39
+
+  explicit Compressor(StringRef Data) : SectionData(Data) {}
+
----------------
nit: can we have the constructor on top?


================
Comment at: include/llvm/Object/Compressor.h:93
+
+// Returns compressed section content, including header data.  Return value is
+// a tuple that includes if the zlib library hit any errors, followed by a
----------------
Any reason this isn't a doxygen comment?


================
Comment at: include/llvm/Object/Compressor.h:99
+Expected<std::unique_ptr<SmallVectorImpl<char>>>
+compress(const StringRef Contents, uint64_t Align,
+         DebugCompressionType CompressionType) {
----------------
Remove the const.


================
Comment at: lib/Object/Compressor.cpp:41
+      (CompressionType == DebugCompressionType::GNU) ? ".z" : ".";
+  Expected<std::string> NewName =
+      Prefix + Name.substr(Name.startswith(".debug") ? 1 : 2).str();
----------------
You could just return the string, it's wrap it in an Expect for you.


Repository:
  rL LLVM

https://reviews.llvm.org/D49678





More information about the llvm-commits mailing list