[PATCH] D12545: [elf2] Add basic archive file support.

Rafael Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 14:17:49 PDT 2015


Another thing: I see that you moved createFile out of Driver.cpp.

That is not what COFF does and I think I agree with COFF on this one.
The files we will support at the top level are not the ones we support
inside a .a. It is better to error early if we are given a .so or a
linker script inside an archive.

Cheers,
Rafael



On 2 September 2015 at 16:48, Rafael Espíndola
<rafael.espindola at gmail.com> wrote:
> The warnings with the file kind were really an issue with the existing
> code. I have fixed that and rebased your patch. I also include the
> change to use  std::vector<Lazy> LazySymbols;.
>
> The remaining warnings look like new issues:
>
> /home/espindola/llvm/llvm/tools/lld/ELF/Writer.cpp:317:13: warning:
> enumeration value 'LazyKind' not handled in switch [-Wswitch]
>     switch (Body->kind()) {
>             ^
> /home/espindola/llvm/llvm/tools/lld/ELF/Writer.cpp:317:13: warning:
> enumeration value 'LazyKind' not handled in switch [-Wswitch]
> /home/espindola/llvm/llvm/tools/lld/ELF/Writer.cpp:317:13: warning:
> enumeration value 'LazyKind' not handled in switch [-Wswitch]
> /home/espindola/llvm/llvm/tools/lld/ELF/Writer.cpp:317:13: warning:
> enumeration value 'LazyKind' not handled in switch [-Wswitch]
> /home/espindola/llvm/llvm/tools/lld/ELF/Writer.cpp:317:13: warning:
> enumeration value 'LazyKind' not handled in switch [-Wswitch
>
> Please fix them and upload a new patch.
>
>
> On 2 September 2015 at 11:50, Rafael Espíndola
> <rafael.espindola at gmail.com> wrote:
>> Why use a llvm::MallocAllocator? It seems better to not have an
>> allocator and use a smart pointer or use a BumpPtrAllocator.
>>
>> Given that the allocator is used for exactly one allocation per file,
>> wouldn't it be the same to replace
>>
>>   std::vector<Lazy *> LazySymbols;
>>   llvm::MallocAllocator Alloc;
>>
>> With
>>
>>   std::vector<Lazy> LazySymbols
>> ?
>>
>> On 2 September 2015 at 11:33, Rafael Ávila de Espíndola
>> <llvm-commits at lists.llvm.org> wrote:
>>> rafael added inline comments.
>>>
>>> ================
>>> Comment at: ELF/InputFiles.cpp:15
>>> @@ -14,2 +14,3 @@
>>>  #include "llvm/ADT/STLExtras.h"
>>> +#include "llvm/Support/FileSystem.h"
>>>
>>> ----------------
>>> Not used.
>>>
>>>
>>> http://reviews.llvm.org/D12545
>>>
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list