[llvm-commits] [llvm] r136023 - in /llvm/trunk: cmake/modules/ lib/Target/ARM/ lib/Target/ARM/AsmParser/ lib/Target/ARM/Disassembler/ lib/Target/ARM/InstPrinter/ lib/Target/ARM/MCTargetDesc/ lib/Target/Alpha/ lib/Target/Alpha/MCTargetDesc/ lib/Target/Alpha/Targ

Óscar Fuentes ofv at wanadoo.es
Mon Jul 25 19:18:27 PDT 2011


Chandler Carruth <chandlerc at google.com> writes:

>> I'm not sure I get this. Previous to your change, the LLVM library
>> (LLVMX86CodeGen, for instance) had LLVMX86CodeGen_TableGen as a
>> dependency (plus the tablegen source files) and its sublibraries
>> (LLVMX86AsmPrinter, ...) had LLVMX86CodeGen as a dependency.
>
> This is source of the confusion. The sublibraries no longer (in many cases)
> depend on LLVMX86CodeGen; specifically MCTargetDesc actively avoids such a
> dependency.

This is tangential. What I'm trying to say is that the sublibrary is not
built until the top library finishes building, which means that
tablegenning is done. If the sublibrary references symbols defined by
the top library (or the tablegenned files) that's a different topic.

>> Somehow
>> this didn't work. So why do we need add_public_tablegen_target at all?
>> The sublibraries, by depending on LLVMX86CodeGen, should not start
>> building until after LLVMX86CodeGen is created, which means that the
>> tablegenning is finished too.
>
> See above. The dependency that previously existed no longer does. Thus the
> need for a specific one for the only actual sharing between these two: the
> tablegen files.

This means an optimization for parallel builds, but doesn't make the
build any more robust.

The problem with explicitly stating the dependency on every sub-library
is that the writer must decide if the dependency actually exists or not
(and keep the decission up to date as changes are made to the
libraries.) And he has a lot of room for making a mistake. A failed
dependency on this scenario is, essentially, a heisenbug. Personally, I
prefer a global conservative rule.

BTW, possibly not related but the build is failing with:

Linking CXX executable ../../bin/llvm-mc                                                          
../../lib/libLLVMMSP430Desc.a(MSP430MCTargetDesc.cpp.o): In function `createMSP430MCInstPrinter(llvm::Target const&, unsigned int, llvm::MCAsmInfo const&)':
MSP430MCTargetDesc.cpp:(.text+0x18d): undefined reference to `vtable for llvm::MSP430InstPrinter'
../../lib/libLLVMMipsDesc.a(MipsMCTargetDesc.cpp.o): In function `createMipsMCInstPrinter(llvm::Target const&, unsigned int, llvm::MCAsmInfo const&)':
MipsMCTargetDesc.cpp:(.text+0x421): undefined reference to `vtable for llvm::MipsInstPrinter'
../../lib/libLLVMPowerPCDesc.a(PPCMCTargetDesc.cpp.o): In function `createPPCMCInstPrinter(llvm::Target const&, unsigned int, llvm::MCAsmInfo const&)':
PPCMCTargetDesc.cpp:(.text+0x330): undefined reference to `vtable for llvm::PPCInstPrinter'
../../lib/libLLVMARMDesc.a(ARMMCTargetDesc.cpp.o): In function `createARMMCInstPrinter(llvm::Target const&, unsigned int, llvm::MCAsmInfo const&)':
ARMMCTargetDesc.cpp:(.text+0x32d): undefined reference to `vtable for llvm::ARMInstPrinter'
../../lib/libLLVMMBlazeDesc.a(MBlazeMCTargetDesc.cpp.o): In function `createMBlazeMCInstPrinter(llvm::Target const&, unsigned int, llvm::MCAsmInfo const&)':
MBlazeMCTargetDesc.cpp:(.text+0x2ad): undefined reference to `vtable for llvm::MBlazeInstPrinter'
collect2: ld returned 1 exit status
make[2]: *** [bin/llvm-mc] Error 1
make[1]: *** [tools/llvm-mc/CMakeFiles/llvm-mc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....



More information about the llvm-commits mailing list