[llvm] r303331 - [lib/Object] - Minor API update for llvm::Decompressor.

İsmail Dönmez via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 01:52:38 PDT 2017


Hi,

On Thu, May 18, 2017 at 10:00 AM, George Rimar via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: grimar
> Date: Thu May 18 03:00:01 2017
> New Revision: 303331
>
> URL: http://llvm.org/viewvc/llvm-project?rev=303331&view=rev
> Log:
> [lib/Object] - Minor API update for llvm::Decompressor.
>
> I revisited Decompressor API (issue with it was triggered during D32865 review)
> and found it is probably provides more then we really need.
>
> Issue was about next method's signature:
>
> Error decompress(SmallString<32> &Out);
> It is too strict. At first I wanted to change it to decompress(SmallVectorImpl<char> &Out),
> but then found it is still not flexible because sticks to SmallVector.
>
> During reviews was suggested to use templating to simplify code. Patch do that.
>
> Differential revision: https://reviews.llvm.org/D33200
>
> Modified:
>     llvm/trunk/include/llvm/Object/Decompressor.h
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
>     llvm/trunk/lib/Object/Decompressor.cpp
>     llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>
> Modified: llvm/trunk/include/llvm/Object/Decompressor.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Decompressor.h?rev=303331&r1=303330&r2=303331&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/Decompressor.h (original)
> +++ llvm/trunk/include/llvm/Object/Decompressor.h Thu May 18 03:00:01 2017
> @@ -30,7 +30,10 @@ public:
>
>    /// @brief Resize the buffer and uncompress section data into it.
>    /// @param Out         Destination buffer.
> -  Error decompress(SmallString<32> &Out);
> +  template <class T> Error Decompressor::resizeAndDecompress(T &Out) {

clang doesn't like this (Linux, x86-64):

/opt/clang/bin/clang++   -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_GLOBAL_ISEL
-D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -Ilib/Object -I../lib/Object -Iinclude
-I../include -O2 -g -stdlib=libc++ -fPIC -fvisibility-inlines-hidden
-Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic
-Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics
-ffunction-sections -fdata-sections -O2 -g  -fPIC   -UNDEBUG
-fno-exceptions -fno-rtti -MD -MT
lib/Object/CMakeFiles/LLVMObject.dir/Decompressor.cpp.o -MF
lib/Object/CMakeFiles/LLVMObject.dir/Decompressor.cpp.o.d -o
lib/Object/CMakeFiles/LLVMObject.dir/Decompressor.cpp.o -c
/home/abuild/rpmbuild/BUILD/llvm/lib/Object/Decompressor.cpp
In file included from
/home/abuild/rpmbuild/BUILD/llvm/lib/Object/Decompressor.cpp:10:
../include/llvm/Object/Decompressor.h:33:42: error: extra
qualification on member 'resizeAndDecompress'
  template <class T> Error Decompressor::resizeAndDecompress(T &Out) {
                           ~~~~~~~~~~~~~~^
1 error generated.


More information about the llvm-commits mailing list