[PATCH] D25826: [ELF] Show error location for 'undefined symbol' errors

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 11:35:44 PDT 2016


I might not be catching your idea, but if you have the following line
in InputFiles.h:

std::unique_ptr<DWARFDebugLine> DwarfLine;

you will either have to:
a) #include <llvm/DebugInfo/DWARFDebugLine.h>
or
b) std::unique_ptr<DWARFDebugLine, MyDeleter> DwarfLine;

This is because std::default_deleter<T> checks sizeof(T) in
static_assert (where T is DWARFDebugLine)

2016-10-25 21:26 GMT+03:00 Rui Ueyama <ruiu at google.com>:
> On Tue, Oct 25, 2016 at 11:08 AM, Eugene Leviant <evgeny.leviant at gmail.com>
> wrote:
>>
>> evgeny777 added inline comments.
>>
>>
>> ================
>> Comment at: ELF/InputFiles.cpp:56
>> +
>> +template <class ELFT> DIHelper<ELFT>::~DIHelper() { delete DwarfLine; }
>> +
>> ----------------
>> ruiu wrote:
>> > Use unique_ptr to remove this dtor.
>> It's not possible unless you include DWARFContext.h to InputFiles.h or
>> override unique_ptr deleter (second template parameter). Is this better?
>
>
> You can have an empty dtor in InputFiles.cpp like `template <class ELFT>
> DIHelper<ELFT>::~DIHelper() {}` to write a definition of the dtor in the cpp
> file instead of in the header so that you don't need to include the
> DWARFContext.h, can't you?


More information about the llvm-commits mailing list